# Query Dispatches

> Count dispatches to destinations by destination, event, status, and reason through the Ours Privacy Platform API.

Source: https://docs.oursprivacy.com/docs/platform-api/query-dispatches

Use Query Dispatches to see how events reach your destinations. The breakdown counts dispatches over a date range, grouped by destination, destination type, status, failure or block reason, event name, source, or identifier, per hour or per day. For example, you can see each destination's sent, failed, and blocked counts for the last week, or how many `Lead` events reached each destination per day.

The `input` and `breakdown` objects are JSON-encoded in the query string. Facet values list the exact reasons and event names a breakdown can filter by, and property suggestions list the payload fields your destinations receive. Responses contain counts and field paths, never payload values or visitor identifiers.

## GET /rest/v1/query-dispatches/breakdown

Count dispatches to destinations, grouped by up to two of destination, destination type, status, reason, event name, source, or identifier, optionally per hour or day. Use it for dispatch health over a window (filter `destinationIds`, group by `STATUS` and `REASON`), dispatches per event and day (filter `eventNames`, `timeGrain: DAY`), or identifier coverage per destination. To diagnose delivery problems, group by `STATUS` and `REASON` rather than filtering to `FAILED`, since `NOT_SENT` also covers destination settings to fix. JSON-encode `input` and `breakdown` in the query string. Returns counts only, never dispatch payloads or visitor identifiers. A destination or source ID this account does not own returns 404. Requires the API-key scope `report:view-dispatch`. Requires API-key scope or current OAuth user permission: report:view-dispatch

Request URL: `GET https://app.oursprivacy.com/rest/v1/query-dispatches/breakdown`

Authentication: apiKey or oauth2.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `input` | query | string | Yes | Which dispatches to count. JSON-encode input in the REST query string. Which dispatches to count. JSON-encode input in the REST query string. |
| `breakdown` | query | string | Yes | How to group the counts. JSON-encode breakdown in the REST query string. How to group the counts. JSON-encode breakdown in the REST query string. |

### Responses

- `200`: Dispatch counts grouped by the requested dimensions
- `400`: Invalid filters, dimensions, or date range.
- `401`: Unauthorized — missing, invalid, or expired API key or OAuth access token
- `403`: Forbidden — credential does not have the required current Ours permission
- `404`: A destination or source ID was not found.
- `500`: Internal Server Error

#### `200` response body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `rows` | object[] | Yes | Largest groups first, up to the group limit in capabilities. |
| `rows[].bucket` | string \| null (date-time) | Yes | Start of the time bucket; null without a time grain. |
| `rows[].keys` | object[] | Yes | One key per requested dimension, in request order. |
| `rows[].keys[].dimension` | string | Yes | Dimension to group by. IDENTIFIER makes one group per identifier a dispatch carried, so a dispatch counts once in each. One of: `"DESTINATION"`, `"DESTINATION_TYPE"`, `"STATUS"`, `"REASON"`, `"EVENT_NAME"`, `"SOURCE"`, `"IDENTIFIER"`. |
| `rows[].keys[].value` | string \| null | Yes | Group value, such as a destination ID or event name; null when absent. |
| `rows[].keys[].label` | string \| null | Yes | Display name for the value, such as the destination name, when one exists. |
| `rows[].dispatches` | number | Yes | Dispatches in this group. Under an IDENTIFIER key, those carrying it. |
| `rows[].baseDispatches` | number | Yes | Dispatches matching the keys other than IDENTIFIER: the denominator for identifier coverage. |
| `rows[].identifierCounts` | object[] | Yes | Per-identifier counts when breakdown.identifiers was set. |
| `rows[].identifierCounts[].identifier` | string | Yes | Identifier a destination can match on. CLICK_ID is the destination platform's own click ID, such as ttclid or msclkid. One of: `"EMAIL"`, `"PHONE"`, `"EXTERNAL_ID"`, `"FBC"`, `"FBP"`, `"GCLID"`, `"GBRAID"`, `"WBRAID"`, `"CLICK_ID"`, `"IP_ADDRESS"`, `"USER_AGENT"`. |
| `rows[].identifierCounts[].count` | number | Yes | Dispatches in the row that carried the identifier. |
| `rows[].identifierCounts[].applicableDispatches` | number | Yes | Dispatches in the row to destination types that use the identifier: the denominator for its coverage. |
| `totalDispatches` | number | Yes | All dispatches matching input. |
| `truncated` | boolean | Yes | True when groups beyond the group limit were folded into otherDispatches. |
| `otherDispatches` | number | Yes | Dispatches in groups past the limit. Zero when grouped by IDENTIFIER, since a dispatch can count in several groups. |

Full schema: [OpenAPI specification](https://docs.oursprivacy.com/openapi-platform.json).

## GET /rest/v1/query-dispatches/capabilities

Return the Query Dispatches query version, date-range limits, and breakdown limits. Requires the API-key scope `report:view-dispatch`. Requires API-key scope or current OAuth user permission: report:view-dispatch

Request URL: `GET https://app.oursprivacy.com/rest/v1/query-dispatches/capabilities`

Authentication: apiKey or oauth2.

### Responses

- `200`: Query Dispatches limits
- `400`: Bad Request
- `401`: Unauthorized — missing, invalid, or expired API key or OAuth access token
- `403`: Forbidden — credential does not have the required current Ours permission
- `404`: Not Found
- `500`: Internal Server Error

#### `200` response body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `version` | integer | Yes | Query format version to send as input.version. |
| `defaultDateRangeDays` | integer | Yes | Days covered when property suggestions omit from. |
| `maxDateRangeDays` | integer | Yes | Longest from-to range, in days. |
| `maxHourlyDateRangeDays` | integer | Yes | Longest range, in days, for an HOUR time grain. |
| `maxBreakdownDimensions` | integer | Yes | Most dimensions in one breakdown. |
| `maxBreakdownGroups` | integer | Yes | Most groups returned before the rest fold into otherDispatches. |

Full schema: [OpenAPI specification](https://docs.oursprivacy.com/openapi-platform.json).

## GET /rest/v1/query-dispatches/facet-values

List the values seen for one dispatch dimension in a date range, with dispatch counts, such as the failure reasons or event names to filter a breakdown by. Counts include test events; set `includeTestEvents` on the breakdown to match them. JSON-encode `input` in the query string. A destination ID this account does not own returns 404. Requires the API-key scope `report:view-dispatch`. Requires API-key scope or current OAuth user permission: report:view-dispatch

Request URL: `GET https://app.oursprivacy.com/rest/v1/query-dispatches/facet-values`

Authentication: apiKey or oauth2.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `input` | query | string | Yes | Which values to list. JSON-encode input in the REST query string. Which values to list. JSON-encode input in the REST query string. |

### Responses

- `200`: Observed values for one dispatch dimension
- `400`: Invalid dimension or date range.
- `401`: Unauthorized — missing, invalid, or expired API key or OAuth access token
- `403`: Forbidden — credential does not have the required current Ours permission
- `404`: A destination ID was not found.
- `500`: Internal Server Error

#### `200` response body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `values` | object[] | Yes | Most frequent values first, up to 100. |
| `values[].value` | string | Yes | Value to use in a breakdown filter. |
| `values[].label` | string \| null | Yes | Display name for the value, when one exists. |
| `values[].count` | number | Yes | Dispatches with this value in the range, test events included. |
| `from` | string (date-time) | Yes | Start of the counted range. |
| `to` | string (date-time) | Yes | Exclusive end of the counted range. |

Full schema: [OpenAPI specification](https://docs.oursprivacy.com/openapi-platform.json).

## GET /rest/v1/query-dispatches/property-suggestions

Suggest the payload field paths and value types sent to destinations, from a sample of recent dispatches, to check which mapped fields a destination receives. Returns paths and types only, never values. JSON-encode the optional `input` in the query string. A destination ID this account does not own returns 404. Requires the API-key scope `report:view-dispatch`. Requires API-key scope or current OAuth user permission: report:view-dispatch

Request URL: `GET https://app.oursprivacy.com/rest/v1/query-dispatches/property-suggestions`

Authentication: apiKey or oauth2.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `input` | query | string | No | Which dispatches to sample. JSON-encode input in the REST query string. Which dispatches to sample. JSON-encode input in the REST query string. |

### Responses

- `200`: Payload field paths sent to destinations
- `400`: Invalid filters or date range.
- `401`: Unauthorized — missing, invalid, or expired API key or OAuth access token
- `403`: Forbidden — credential does not have the required current Ours permission
- `404`: A destination ID was not found.
- `500`: Internal Server Error

#### `200` response body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `entities` | object[] | Yes | Payload field paths and types seen in a sample of recent dispatches; no values. |
| `entities[].property` | string | Yes | Always `dispatch.payload`: the payload sent to the destination. |
| `entities[].path` | string[] | Yes | Payload path segments, outermost first. A `0` segment is the first array item. |
| `entities[].type` | string | Yes | Value type observed at this path. One of: `"string"`, `"number"`, `"boolean"`. |
| `entities[].supportsBreakdown` | boolean | Yes | False when the path identifies a person, such as an email field. |
| `sampled` | boolean | Yes | True when the paths come from a sample, so rare paths may be missing. |
| `from` | string (date-time) | Yes | Start of the sampled range. |
| `to` | string (date-time) | Yes | Exclusive end of the sampled range. |

Full schema: [OpenAPI specification](https://docs.oursprivacy.com/openapi-platform.json).

## Next Steps

- [Destinations API](https://docs.oursprivacy.com/docs/platform-api/destinations)
- [Query Events API](https://docs.oursprivacy.com/docs/platform-api/query-events)
- [MCP server](https://docs.oursprivacy.com/docs/platform-mcp)
