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

# Domain-wise Health Metrics

> Get performance metrics aggregated by email domain for domain analysis

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

<ParamField query="full_data" type="string">
  Set to "true" to return full data set
</ParamField>

<ParamField query="limit" type="string">
  Max number of results to return
</ParamField>

<ParamField query="offset" type="string">
  Pagination offset
</ParamField>

## Rate Limit

<Warning>
  This endpoint has its **own dedicated rate limit of 10 requests per minute**, which is separate from your plan's overall API rate limit.
</Warning>

| Scope | Limit | Window |
| - | - | - |
| `GET /analytics/mailbox/domain-wise-health-metrics` | 10 requests | 60 seconds |

The limit is counted per SmartLead account (or per API key if you authenticate with a client key), and applies regardless of the `client_ids`, `campaign_ids` or date range you request — every call spends one of the 10.

This limit **stacks on top of** your plan-wide limit rather than replacing it. Requests here still count toward the account-wide quota described in the [Rate Limits guide](/guides/rate-limits), so staying under 10/min does not exempt you from that limit, and remaining plan-wide quota does not let you exceed 10/min here.

The window starts on your first request and resets 60 seconds later. Exceeding it returns `429 Too Many Requests` with a plain-text body:

```text 429 - Too Many Requests theme={null}
You have exceeded the 10 requests in 60 sec limit for this endpoint!
```

<Note>
  This 429 does not include `Retry-After` or `X-RateLimit-*` headers. Wait up to 60 seconds before retrying.
</Note>

<Tip>
  `full_data=true` is the expensive mode — it runs a separate bucketed unique-count query per domain, so a large account can make a single call costly. Request it only when you need the full breakdown, keep `start_date`/`end_date` as narrow as your use case allows, and cache the result rather than re-requesting it inside a polling loop.
</Tip>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://server.smartlead.ai/api/v1/analytics/mailbox/domain-wise-health-metrics?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/mailbox/domain-wise-health-metrics",
      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/mailbox/domain-wise-health-metrics?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">
  You exceeded this endpoint's dedicated limit of 10 requests per minute, or your plan-wide API rate limit. Wait up to 60 seconds and retry.
</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": {
      "domain_health_metrics": [
        {
          "domain": "example.com",
          "sent": 1000,
          "opened": 500,
          "replied": 60,
          "bounced": 10
        }
      ]
    }
  }
  ```

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

  ```text 429 - Too Many Requests theme={null}
  You have exceeded the 10 requests in 60 sec limit for this endpoint!
  ```
</ResponseExample>


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