> ## 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.

# Lead to Reply Time

> Measure average time from first email sent to first reply received

## Query Parameters

**api\_key** `string` *required*

Your SmartLead API key

**start\_date** `string` *required*

Start date (YYYY-MM-DD format)

**end\_date** `string` *required*

End date (YYYY-MM-DD format)

**timezone** `string`

IANA timezone string (e.g., "America/New\_York")

**client\_ids** `string`

Comma-separated client IDs

**campaign\_ids** `string`

Comma-separated campaign IDs

```bash cURL theme={null}
curl "https://server.smartlead.ai/api/v1/analytics/campaign/lead-to-reply-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/campaign/lead-to-reply-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/campaign/lead-to-reply-time?api_key=${API_KEY}`
);

const result = await response.json();
console.log(result);
```

## Response Codes

**200** `Success`

Request successful

**400** `Bad Request`

Invalid request parameters or malformed request body

**401** `Unauthorized`

Invalid or missing API key. Check your authentication.

**404** `Not Found`

The requested resource (campaign, lead, email account, etc.) does not exist or you don't have access to it

**422** `Validation Error`

Request validation failed. Check parameter types, required fields, and value constraints.

**429** `Rate Limit Exceeded`

Too many requests. Please slow down and retry after the rate limit resets.

**500** `Internal Server Error`

Server error occurred. Please try again or contact support if the issue persists.

**503** `Service Unavailable`

API is temporarily unavailable or under maintenance. Please try again later.

```json 200 - Success theme={null}
{
  "ok": true,
  "data": {
    "lead_to_reply_time": [
      {
        "time_range": "0-1h",
        "count": 15
      },
      {
        "time_range": "1-6h",
        "count": 25
      },
      {
        "time_range": "6-24h",
        "count": 18
      }
    ]
  }
}
```

```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"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.