# Statistics

## Get global statistics

<mark style="color:blue;">`GET`</mark> `https://www.example.com/index.php?page=acymailing_front&option=com_acym&ctrl=api&task=getCampaignStatistics`

Get campaign statistics by campaign ID

#### Query Parameters

| Name                                         | Type | Description            |
| -------------------------------------------- | ---- | ---------------------- |
| campaignId<mark style="color:red;">\*</mark> | Int  | The ID of the campaign |

#### Headers

| Name                                      | Type   | Description                                                                                         |
| ----------------------------------------- | ------ | --------------------------------------------------------------------------------------------------- |
| Api-Key<mark style="color:red;">\*</mark> | String | The API key of a valid AcyMailing license used in the AcyMailing configuration page, tab "License". |

{% tabs %}
{% tab title="200: OK Array of statistics for each email of the campaign" %}

{% endtab %}
{% endtabs %}

## Get detailed statistics

<mark style="color:blue;">`GET`</mark> `https://www.example.com/index.php?page=acymailing_front&option=com_acym&ctrl=api&task=getCampaignStatisticsDetailed`

This route returns a listing of each user statistics for a specific campaign.

#### Query Parameters

| Name                                         | Type | Description                                                                                           |
| -------------------------------------------- | ---- | ----------------------------------------------------------------------------------------------------- |
| campaignId<mark style="color:red;">\*</mark> | Int  | ID of the campaign                                                                                    |
| offset                                       | Int  | From which element in the database you would like to start getting campaign, by default it's set to 0 |
| limit                                        | Int  | The number of campaigns you would like to get in your request, by default it's set to 100             |

#### Headers

| Name                                      | Type   | Description                                                                                         |
| ----------------------------------------- | ------ | --------------------------------------------------------------------------------------------------- |
| Api-key<mark style="color:red;">\*</mark> | String | The API key of a valid AcyMailing license used in the AcyMailing configuration page, tab "License". |

{% tabs %}
{% tab title="200: OK Array of user detailed statistics" %}

{% endtab %}

{% tab title="404: Not Found Campaign not found" %}

{% endtab %}
{% endtabs %}

## Get click statistics per user

<mark style="color:blue;">`GET`</mark> `https://www.example.com/index.php?page=acymailing_front&option=com_acym&ctrl=api&task=getCampaignStatisticsClicks`

This route returns a listing of all the users who have click statistics

#### Query Parameters

| Name                                         | Type | Description        |
| -------------------------------------------- | ---- | ------------------ |
| campaignId<mark style="color:red;">\*</mark> | Int  | ID of the campaign |

#### Headers

| Name                                      | Type   | Description                                                                                         |
| ----------------------------------------- | ------ | --------------------------------------------------------------------------------------------------- |
| Api-Key<mark style="color:red;">\*</mark> | String | The API key of a valid AcyMailing license used in the AcyMailing configuration page, tab "License". |

{% tabs %}
{% tab title="200: OK Array of user  statistics" %}

{% endtab %}

{% tab title="404: Not Found Campaign not found" %}

{% endtab %}
{% endtabs %}

## Get click statistics per URL

<mark style="color:blue;">`GET`</mark> `https://www.example.com/index.php?page=acymailing_front&option=com_acym&ctrl=api&task=getCampaignStatisticsLinks`

This route returns a listing of links statistics for a specific campaign.

#### Query Parameters

| Name                                         | Type | Description        |
| -------------------------------------------- | ---- | ------------------ |
| campaignId<mark style="color:red;">\*</mark> | Int  | ID of the campaign |

#### Headers

| Name                                      | Type   | Description                                                                                         |
| ----------------------------------------- | ------ | --------------------------------------------------------------------------------------------------- |
| Api-Key<mark style="color:red;">\*</mark> | String | The API key of a valid AcyMailing license used in the AcyMailing configuration page, tab "License". |

{% tabs %}
{% tab title="200: OK Array of links statistics" %}

{% endtab %}

{% tab title="404: Not Found Campaign not found" %}

{% 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.acymailing.com/rest-api/statistics.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.
