---
title: "Count cases"
method: GET
path: "/api/v2/cases/count"
tags: ["Case Management"]
---

# Count cases

`GET /api/v2/cases/count`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/cases/count`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token` scopes: `cases_read`

Returns case counts, optionally grouped by one or more fields (for example, status, priority). Supports a query filter to narrow the scope.

## Query parameters

- `query_filter` string
- `group_bys` string
- `limit` integer

## Response `200`

OK

- CaseCountResponse: Response containing the total number of cases matching a query, optionally grouped by specified fields.
  - `data` CaseCountResponseData, required: Data object containing the count results, including per-field group breakdowns.
    - `attributes` CaseCountResponseAttributes, required: Attributes for the count response, including the total count and optional facet breakdowns.
      - `groups` CaseCountGroup[], required: List of facet groups, one per field specified in `group_bys`.
        - `group` string, required: The name of the field being grouped on (for example, `status` or `priority`).
        - `group_values` CaseCountGroupValue[], required: Values within this group.
          - `count` integer, required: Count of cases for this value.
          - `value` string, required: The group value.
    - `id` string, required: Count response identifier.
    - `type` string, required: Count resource type.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/da68bf029e4c?raw)
