> ## Documentation Index
> Fetch the complete documentation index at: https://doc.convo.co.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve Daily Campaign Analytics for a Date Range

> Retrieve day-by-day campaign analytics over a date range, with sent, delivered, read, failed, and reply message counts for each day.

Use this endpoint to retrieve daily analytics for a specific campaign. The response breaks down message delivery metrics (sent, delivered, read, failed) by day across the requested date range.

## Endpoint

```text theme={null}
POST https://connect.api-wa.co/project-apis/v1/project/{project_id}/campaign/analytics/{campaign_id}
```

## Authentication

```text theme={null}
X-API-WA-Project-API-Pwd: YOUR_API_PASSWORD
```

## Path Parameters

<ParamField path="project_id" type="string" required>
  Your Convo project ID.
</ParamField>

<ParamField path="campaign_id" type="string" required>
  The unique ID of the campaign whose analytics you want to retrieve.
</ParamField>

## Request Body

<ParamField body="startDate" type="string" required>
  ISO 8601 date-time string for the start of the analytics range. Example: `"2024-01-01T00:00:00Z"`.
</ParamField>

<ParamField body="endDate" type="string" required>
  ISO 8601 date-time string for the end of the analytics range. Example: `"2024-01-07T23:59:59Z"`.
</ParamField>

## Request Example

```bash theme={null}
curl -X POST \
  "https://connect.api-wa.co/project-apis/v1/project/YOUR_PROJECT_ID/campaign/analytics/64b3e1ac7f2c0a001d8e9f34" \
  -H "X-API-WA-Project-API-Pwd: YOUR_API_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{
    "startDate": "2024-01-01T00:00:00Z",
    "endDate": "2024-01-07T23:59:59Z"
  }'
```

## Response

Returns a `chats` array where each element represents one day's analytics for the campaign.

<ResponseField name="chats" type="array">
  Array of daily analytics objects. Each object contains the following fields:

  <Expandable title="Analytics Object">
    <ResponseField name="dayDate" type="string">
      The date this analytics entry corresponds to, in ISO 8601 format.
    </ResponseField>

    <ResponseField name="sentChatCount" type="integer">
      Total number of messages sent on this day.
    </ResponseField>

    <ResponseField name="deliveredChatcount" type="integer">
      Total number of messages successfully delivered on this day.
    </ResponseField>

    <ResponseField name="readChatCount" type="integer">
      Total number of messages read by recipients on this day.
    </ResponseField>

    <ResponseField name="failedChatCount" type="integer">
      Total number of messages that failed to send on this day.
    </ResponseField>

    <ResponseField name="repliedToCampaignCount" type="integer">
      Number of contacts who replied to the campaign on this day.
    </ResponseField>

    <ResponseField name="engagementCount" type="integer">
      Total number of engagements (reads + replies + clicks) recorded on this day.
    </ResponseField>

    <ResponseField name="campaignMessages.total" type="integer">
      Total campaign messages dispatched on this day.
    </ResponseField>

    <ResponseField name="templateMessagesCount" type="integer">
      Number of template messages sent on this day.
    </ResponseField>
  </Expandable>
</ResponseField>

## Example Response

```json theme={null}
{
  "chats": [
    {
      "dayDate": "2024-01-01T00:00:00.000Z",
      "sentChatCount": 1520,
      "deliveredChatcount": 1490,
      "readChatCount": 1102,
      "failedChatCount": 30,
      "repliedToCampaignCount": 87,
      "engagementCount": 1189,
      "campaignMessages": {
        "total": 1520
      },
      "templateMessagesCount": 1520
    },
    {
      "dayDate": "2024-01-02T00:00:00.000Z",
      "sentChatCount": 320,
      "deliveredChatcount": 315,
      "readChatCount": 210,
      "failedChatCount": 5,
      "repliedToCampaignCount": 22,
      "engagementCount": 232,
      "campaignMessages": {
        "total": 320
      },
      "templateMessagesCount": 320
    }
  ]
}
```

## Error Responses

| Status Code | Description                                                                                             |
| ----------- | ------------------------------------------------------------------------------------------------------- |
| `400`       | Bad Request — The `startDate` or `endDate` value is missing or not a valid ISO date string.             |
| `500`       | Internal Server Error — An unexpected server-side error occurred. Retry the request or contact support. |
