# Count Campaigns Beta

> Count your campaigns in total and by status.

> Documentation index: https://www.foxreach.io/docs/llms.txt lists every page of these docs. Each page is also served as Markdown: add `.md` to its URL.

`GET` https://api.foxreach.io/api/v1/campaigns/count

> **Note:** **Beta.** This endpoint is new and may change.

Requires an API key with the `read` scope.

One grouped query, so the cost does not grow with the number of campaigns. `byStatus` always lists all four statuses, with `0` where none match.

**Request example**

```bash cURL
curl "https://api.foxreach.io/api/v1/campaigns/count" \
  -H "X-API-Key: otr_your_key"
```

```python Python
import requests

response = requests.get(
    "https://api.foxreach.io/api/v1/campaigns/count",
    headers={"X-API-Key": "otr_your_key"}
)
data = response.json()
```

```typescript TypeScript
const response = await fetch("https://api.foxreach.io/api/v1/campaigns/count", { method: "GET", headers: { "X-API-Key": "otr_your_key" } });
const data = await response.json();
```

**Response example**

```json
{
  "data": {
    "total": 12,
    "active": 3,
    "byStatus": {
      "draft": 4,
      "active": 3,
      "paused": 2,
      "completed": 3
    }
  }
}
```

## Errors

| Status | Description |
|--------|-------------|
| `401` | Missing, invalid, revoked or expired API key |
| `403` | API key does not have the required scope: `read` |

## Rate Limit

- **300 requests per minute, shared by every `read` call in your workspace.** Fixed 60-second window.
- Every response includes `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset` (unix epoch seconds) and `X-RateLimit-Bucket` (`read`).
- A `429` response includes a `Retry-After` header (seconds until the bucket resets).

For client-side patterns, see [Rate Limiting](https://www.foxreach.io/docs/rate-limiting).
