Skip to content
Open Prescient AI
API queries

Reference for the reportedMetrics query of the Prescient GraphQL API, with its arguments, its return type, and an example request.

QueryreportedMetrics(…): ReportedMetricQuery!

Get reported spend metrics for campaigns by date. Returns spend data per campaign/day. Results will be paginated, so implementations should handle making multiple calls using the after argument.

Each argument is optional unless the list marks it as required.

  • afterBigIntoptional

    The cursor to indicate where the pagination should begin. Value comes from the pageInfo>endCursor field in the previous response.

  • Filter by campaign ids. These correspond to the ids of your campaigns in their respective source channels.

  • End date for the reporting records. Defaults to today.

  • Filters out any records that have not been created or updated since this date. We recommend using this field in all implementations to avoid pulling large, unchanged data sets.

  • Start date for the reporting records. Defaults to 30 days ago.

The query returns ReportedMetricQuery, written as ReportedMetricQuery! in the schema. The type has these fields.

Send the query in the query field of the request body, and the variables in the variables field.

Query
query reportedMetrics(
$after: BigInt
$campaignIds: [String!]
$endDate: ISO8601Date
$processDate: ISO8601Date
$startDate: ISO8601Date
) {
reportedMetrics(
after: $after
campaignIds: $campaignIds
endDate: $endDate
processDate: $processDate
startDate: $startDate
) {
data {
campaignId
campaignName
channelName
processDate
reportedDate
spend
}
pageInfo {
endCursor
hasNextPage
}
}
}
Variables
{
"after": null,
"campaignIds": [
"1234567890"
],
"endDate": "2026-01-31",
"processDate": "2026-01-15",
"startDate": "2026-01-01"
}

The values in this response are examples. They are not real data.

Response
{
"data": {
"reportedMetrics": {
"data": [
{
"campaignId": "1234567890",
"campaignName": "Example campaign",
"channelName": "EXAMPLE_CHANNEL",
"processDate": "2026-01-15",
"reportedDate": "2026-01-14",
"spend": 320.75
}
],
"pageInfo": {
"endCursor": "5000",
"hasNextPage": true
}
}
}
}