---
title: "Analytics | Status Code"
description: "API Documentation"
url: "https://www.contentstack.com/docs/developers/apis/analytics-api/status-code"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-06-02"
---

# Analytics | Status Code

### Status Code

**GET** `/analytics/v2/http-statuses?from={YYYY-MM-DD}&to={YYYY-MM-DD}&duration={duration}&orgUid={organization_uid}&services={["cdn","cma"]}`

The Status Code request will show the count for the number of API requests made for each HTTP status code. For example, 200, 201, 400, 404, and so on. You can use the httpStatusCode parameter to get the count for a specific status code instead of all status codes.

Here’s how your response body would look like when you pass the jobId in the [Retrieve Data](/docs/developers/apis/analytics-api#retrieve-data) endpoint.

```
{
    "data": [
        {
            "count": 63,
            "type": "cma",
            "status": "200",
            "date": "2024-02-05"
        },
        {
            "count": 1,
            "type": "cma",
            "status": "422",
            "date": "2024-03-05"
        },
        {
            "count": 14,
            "type": "cma",
            "status": "200",
            "date": "2024-03-21"
        },
        {
            "count": 10,
            "type": "cma",
            "status": "200",
            "date": "2024-02-15"
        }
    ],
    "meta": {
        "from": "2024-01-31",
        "to": "2024-03-31",
        "duration": "day",
        "orgUid": "blt**************87",
        "services": "[\"cdn\",\"cma\"]"
    },
    "uid": "0f****46-5ee9-4f38-9146-1f********8"
}
```

The response body provides detailed statistics on the number of API requests executed for each HTTP status code over a specified period. Here’s a breakdown of the key elements:

*   count: The total number of API requests that resulted in the corresponding HTTP status code.
*   type: The service type (e.g., "cma") that made the requests.
*   status: The HTTP status code (e.g., "200" for success, "422" for client error).
*   date: The date on which the requests were executed.

This information helps you monitor the frequency of specific HTTP status codes and track the performance and errors of your API requests.

#### Query Parameters

- **from** (required)
  Specify the start date for the required data. Use the following date format: YYYY-MM-DD. It cannot be in the future.
- **to** (required)
  Enter the end date for the required data. The date format should be: YYYY-MM-DD. It must be on or after the from date and cannot be in the future.
- **duration** (optional)
  Determines the granularity of the data. Accepted values are sec, minute, hour, day, week, month, year, and historic; any other value returns a 400 error. If you omit duration, the response is not broken down by date.
- **orgUid** (required)
  Enter the UID of your Organization.
- **services** (required)
  Specify the array of services for which you want statistics, such as: \["cma", "ui", "cdn", "graphql", "images", "assets", "automations", "launch", "cs-assets"\]. Pass either a JSON array of service names, for example \["cdn","cma"\], or a single service name on its own, for example automations. A comma-separated list is not supported and returns no data.
- **httpStatusCode** (optional)
  Enter an HTTP status code to filter the response.
- **apiKey** (optional)
  Enter your stack API key to get data for that specific stack.
- **space_uid** (optional)
  Enter a space UID to filter the response to that space, or all to include every space. The value is not case-sensitive. Only available when services is set to cs-assets on its own — passing it alongside any other service returns a 400 error.
- **subService** (optional)
  Enter all, delivery-api, or management-api to filter the response to one part of the cs-assets service. The value is not case-sensitive; any other value returns a 400 error. Defaults to all. Like space\_uid, it can only be used when services is set to cs-assets on its own.

#### Headers

- **authtoken** (required)
  Enter your authtoken.
  Default: `your_authtoken`

#### Sample Response

```json
{
    "jobId": "job_7******a-c**f-4**9-9**0-c**********6",
    "paginated": false
}
```