> ## Documentation Index
> Fetch the complete documentation index at: https://api.smartlead.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Positive Reply Stats by Sent Time

> Get positive replies by sent time to optimize sending schedule

## Query Parameters

<ParamField query="api_key" type="string" required>
  Your SmartLead API key
</ParamField>

<ParamField query="start_date" type="string" required>
  Start date (YYYY-MM-DD format)
</ParamField>

<ParamField query="end_date" type="string" required>
  End date (YYYY-MM-DD format)
</ParamField>

<ParamField query="timezone" type="string" required>
  IANA timezone string (e.g., "America/New\_York")
</ParamField>

<ParamField query="client_ids" type="string">
  Comma-separated client IDs
</ParamField>

<ParamField query="campaign_ids" type="string">
  Comma-separated campaign IDs
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://server.smartlead.ai/api/v1/analytics/day-wise-positive-reply-stats-by-sent-time?api_key=YOUR_KEY"
  ```

  ```python Python theme={null}
  import requests

  API_KEY = "YOUR_API_KEY"

  response = requests.get(
      "https://server.smartlead.ai/api/v1/analytics/day-wise-positive-reply-stats-by-sent-time",
      params={"api_key": API_KEY}
  )

  result = response.json()
  print(result)
  ```

  ```javascript JavaScript theme={null}
  const API_KEY = 'YOUR_API_KEY';

  const response = await fetch(
    `https://server.smartlead.ai/api/v1/analytics/day-wise-positive-reply-stats-by-sent-time?api_key=${API_KEY}`
  );

  const result = await response.json();
  console.log(result);
  ```
</RequestExample>

## Response Codes

<ResponseField name="200" type="Success">
  Request successful
</ResponseField>

<ResponseField name="400" type="Bad Request">
  Invalid request parameters or malformed request body
</ResponseField>

<ResponseField name="401" type="Unauthorized">
  Invalid or missing API key. Check your authentication.
</ResponseField>

<ResponseField name="404" type="Not Found">
  The requested resource (campaign, lead, email account, etc.) does not exist or you don't have access to it
</ResponseField>

<ResponseField name="422" type="Validation Error">
  Request validation failed. Check parameter types, required fields, and value constraints.
</ResponseField>

<ResponseField name="429" type="Rate Limit Exceeded">
  Too many requests. Please slow down and retry after the rate limit resets.
</ResponseField>

<ResponseField name="500" type="Internal Server Error">
  Server error occurred. Please try again or contact support if the issue persists.
</ResponseField>

<ResponseField name="503" type="Service Unavailable">
  API is temporarily unavailable or under maintenance. Please try again later.
</ResponseField>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "ok": true,
    "data": {
      "day_wise_stats": [
        {
          "date": "2024-01-15",
          "positive_replied": 5
        },
        {
          "date": "2024-01-16",
          "positive_replied": 7
        }
      ]
    }
  }
  ```

  ```json 401 - Unauthorized theme={null}
  {
    "message": "Invalid API Key"
  }
  ```

  ```json 404 - Not Found theme={null}
  {
    "error": "Resource not found"
  }
  ```

  ```json 422 - Validation Error theme={null}
  {
    "error": "Invalid parameters provided"
  }
  ```
</ResponseExample>

## How these metrics are calculated

<Note>
  Shared rules (inclusive date boundaries, send-date attribution, unique vs raw counts) are documented once in [How Analytics Metrics Are Calculated](/api-reference/analytics/how-metrics-are-calculated).
</Note>

| Field              | How it's calculated                                                                                                                                                                                                |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `positive_replied` | `COUNT(DISTINCT lead)` for leads tagged as **positive** (`sentiment_type = 'positive'`) that sent a genuine reply (replied, not ignored, not bounced), bucketed by the day their email was **sent** (`sent_time`). |

This is the **send-date** view of positive replies — use it to see which *sending* days produced positive replies. It differs from the [day-wise positive endpoint](/api-reference/analytics/day-wise-positive-reply) and the `overall-stats-v2` tile, which attribute positives to the **date the reply was received**; a reply that arrives days after the send lands on a different day across the two views.

`positive_replied` is a **distinct-lead** count. The lead category is mutable, so re-categorising a lead changes historical days. Dates are inclusive on both ends — `sent_time >= start 00:00:00 AND sent_time <= end 23:59:59` — and a single date returns that one full day.
