Note : This endpoint is in preview and is subject to change.
If you have any feedback, contact Datadog support .
POST https://api.ap1.datadoghq.com/api/v2/cases/aggregate https://api.ap2.datadoghq.com/api/v2/cases/aggregate https://api.datadoghq.eu/api/v2/cases/aggregate https://api.ddog-gov.com/api/v2/cases/aggregate https://api.us2.ddog-gov.com/api/v2/cases/aggregate https://api.datadoghq.com/api/v2/cases/aggregate https://api.us3.datadoghq.com/api/v2/cases/aggregate https://api.us5.datadoghq.com/api/v2/cases/aggregate
Overview Performs an aggregation query over cases, grouping results by specified fields and returning counts per group along with a total. Useful for dashboards and analytics.
OAuth apps require the cases_read authorization scope to access this endpoint.
Request Body Data (required) Case aggregate request payload.
Expand All
Data object wrapping the aggregation query type and attributes.
Attributes for the aggregation request, including the search query and grouping configuration.
Configuration for grouping aggregated results by one or more case fields.
Maximum number of groups to return.
A search query to filter which cases are included in the aggregation. Uses the same syntax as the Case Management search bar.
JSON:API resource type for case aggregation requests.
Allowed enum values: aggregate
{
"data" : {
"attributes" : {
"group_by" : {
"groups" : [
"status"
],
"limit" : 14
},
"query_filter" : "service:case-api"
},
"type" : "aggregate"
}
} Response OK
Response containing aggregated case counts grouped by the requested fields.
Expand All
Data object containing the aggregation results, including total count and per-group breakdowns.
Attributes of the aggregation result, including the total count across all groups and the per-group breakdowns.
The value of the field being grouped on (for example, OPEN when grouping by status).
The count of cases in this group.
Total count of aggregated cases.
Aggregate response identifier.
{
"data" : {
"attributes" : {
"groups" : [
{
"group" : "OPEN" ,
"value" : [
42
]
}
],
"total" : 100
},
"id" : "agg-result-001" ,
"type" : "aggregate"
}
} Bad Request
{
"errors" : [
"Bad Request"
]
} Unauthorized
{
"errors" : [
"Bad Request"
]
} Forbidden
{
"errors" : [
"Bad Request"
]
} Not Found
{
"errors" : [
"Bad Request"
]
} Too many requests
{
"errors" : [
"Bad Request"
]
} Code Example Copy
## default
#
# Curl command curl -X POST "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/aggregate " \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY} " \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY} " \
-d @- << EOF
{
"data": {
"attributes": {
"group_by": {
"groups": [
"status"
],
"limit": 14
},
"query_filter": "service:case-api"
},
"type": "aggregate"
}
}
EOF