# Quota management

{% hint style="info" %}
This documentation is about an Early Adopter feature and the instructions detailled here are subject to changes. Please contact your usual AB Tasty contact if some instructions are unclear or if something is missing.
{% endhint %}

### What is the quota?

Your requests to Data Explorer will be limited by a monthly quota. You will be assigned every 1st of the month a certain amount of GigaBytes you can pull from our servers and the value each request will draw from your quota will depend on the volume of the data we are fetching. To help you frame your requests, we are providing tools to ask for your current quota and get an estimation of a specific request cost.

### Getting current quota

`GET https://api-data-explorer.abtasty.com/v2/clients/{{account_identifier}}/quota`

**Arguments**

| Parameter           | Type   | Required | Format           | Description     |
| ------------------- | ------ | -------- | ---------------- | --------------- |
| account\_identifier | string | true     | Example: "37976" | Your account ID |

**Headers**

| Name          | Required | Value                 |
| ------------- | -------- | --------------------- |
| Content-Type  | true     | `application/json`    |
| Authorization | true     | Bearer \[your\_token] |

Output example:

```json
{
    "last_scheduled_reset": "2023-01-18",
    "next_scheduled_reset": "2023-02-18",
    "last_manual_reset": "",
    "total_bytes": 1000000000,
    "remaining_bytes": 1000000000,
    "remaining_bytes_percentage": 100
}
```

In this example, my quota started on January 18th 2023 and will be reset on February 18th 2023. I currently have 1 GigaByte available over my monthly 1 GigaByte quota, which represents 100% of it.

### Getting an evaluation of a request

`GET https://api-data-explorer.abtasty.com/v2/clients/{{account_identifier}}/query/dryRun`

**Arguments**

| Parameter           | Type   | Required | Format           | Description     |
| ------------------- | ------ | -------- | ---------------- | --------------- |
| account\_identifier | string | true     | Example: "37976" | Your account ID |

**Headers**

| Name          | Required | Value                 |
| ------------- | -------- | --------------------- |
| Content-Type  | true     | `application/json`    |
| Authorization | true     | Bearer \[your\_token] |

{% hint style="warning" %}
You need to pass in the body the payload of the request you are trying to evaluate.
{% endhint %}

{% tabs %}
{% tab title="Request payload example" %}

```json
{
    "timeIntervals": [
        {
            "start": "1674464754",
            "end": "1674465054"
        }
    ],
    "dimensions": [
        "customerId",
        "campaignId",
        "variationId"
    ],
    "metrics": [
        {
            "key": "users"
        }
    ],
    "limit": 5
} 
```

{% endtab %}

{% tab title="Output" %}

```json
{
    "bytes_processed": 28763809,
    "percentage_processed": 2.8763809,
    "current_total_bytes": 1000000000,
    "current_remaining_bytes": 1000000000,
    "current_remaining_bytes_percentage": 100,
    "future_remaining_bytes_percentage": 97.1236191,
    "next_scheduled_reset": "2023-02-18"
}
```

{% endtab %}
{% endtabs %}

In this example, I'm requesting the amount of users per customerId, campaignId and variationId.

I'm expecting to have a list of all my unique visitors and their corresponding assigned campaigns and variations.

By sending this payload to the dry run route, I see that it will process around 29 MegaBytes which represents about 2.88% of my monthly quota. I could run this request daily without using all of my monthly quota.


---

# 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.abtasty.com/client-side/data-apis/data-explorer/de-quota.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.
