# Analysis

{% hint style="info" %}
These endpoint are only available for customers on the **start-up** and **enterprise** plans. Any period selection is dependent on the plan's defined data retention;

* **Start-up** - 30 day retention period
* **Enterprise** - 2 year retention period
  {% endhint %}

## Get basic account usage for a period

<mark style="color:blue;">`GET`</mark> `https://api.smtpd.dev/api/v1/analysis/summary?from=2039823098&to=234987234`

<br>

#### Query Parameters

| Name | Type   | Description                                                                                                                                      |
| ---- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| to   | number | <p>Unix Timestamp (epoch) - defaults to the current time<br></p>                                                                                 |
| from | number | <p>Unix Timestamp (epoch) - defaults to current time minus 31 days<br>\* Max range between <code>from</code> and <code>to</code> is 365 days</p> |

#### Headers

| Name                                             | Type   | Description             |
| ------------------------------------------------ | ------ | ----------------------- |
| Authentication<mark style="color:red;">\*</mark> | string | `Bearer {access_token}` |

{% tabs %}
{% tab title="200 " %}

```
{
 	"group_by": {
		"accepted": {
			"current": 149,
			"previous": 0,
			"delta": 149
		},
		"bounce": {
			"current": 1,
			"previous": 0,
			"delta": 1
		},
		"click": {
			"current": 6,
			"previous": 0,
			"delta": 6
		},
		"delivered": {
			"current": 143,
			"previous": 0,
			"delta": 143
		},
		"open": {
			"current": 9,
			"previous": 0,
			"delta": 9
		},
		"processed": {
			"current": 149,
			"previous": 0,
			"delta": 149
		},
		"queued": {
			"current": 169,
			"previous": 0,
			"delta": 169
		},
		"rejected": {
			"current": 6,
			"previous": 0,
			"delta": 6
		},
		"sent": {
			"current": 149,
			"previous": 0,
			"delta": 149
		}
	},
 	"period": {
   		"from": 1606901470,
    		"to": 1607912472
  	}
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.smtpd.dev/api/analysis.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
