Count cases

Note: This endpoint is in preview and is subject to change. If you have any feedback, contact Datadog support.

GET https://api.ap1.datadoghq.com/api/v2/cases/counthttps://api.ap2.datadoghq.com/api/v2/cases/counthttps://api.datadoghq.eu/api/v2/cases/counthttps://api.ddog-gov.com/api/v2/cases/counthttps://api.us2.ddog-gov.com/api/v2/cases/counthttps://api.datadoghq.com/api/v2/cases/counthttps://api.us3.datadoghq.com/api/v2/cases/counthttps://api.us5.datadoghq.com/api/v2/cases/count

Overview

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

OAuth apps require the cases_read authorization scope to access this endpoint.

Arguments

Query Strings

Name

Type

Description

query_filter

string

Filter query for cases.

group_bys

string

Comma-separated fields to group by.

limit

integer

Maximum facet values to return.

Response

OK

Response containing the total number of cases matching a query, optionally grouped by specified fields.

Expand All

Field

Type

Description

data [required]

object

Data object containing the count results, including per-field group breakdowns.

attributes [required]

object

Attributes for the count response, including the total count and optional facet breakdowns.

groups [required]

[object]

List of facet groups, one per field specified in group_bys.

group [required]

string

The name of the field being grouped on (for example, status or priority).

group_values [required]

[object]

Values within this group.

count [required]

int64

Count of cases for this value.

value [required]

string

The group value.

id [required]

string

Count response identifier.

type [required]

string

Count resource type.

{
  "data": {
    "attributes": {
      "groups": [
        {
          "group": "status",
          "group_values": [
            {
              "count": 42,
              "value": "OPEN"
            }
          ]
        }
      ]
    },
    "id": "count-result-001",
    "type": "count"
  }
}

Bad Request

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Unauthorized

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example

                  # Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.us2.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cases/count" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"