Skip to content
POST/v1/properties/{propertyId}/reports/campaigns

Returns the performance of each campaign, ad set, or ad of a property for a date range of up to 31 days. Each row combines ad platform metrics (spend, impressions) with the events that AnyTrack tracked.

Ask for metrics by name in metrics. Each row returns a nested metrics object, for example data[0].metrics.spend. The first page returns requested totals directly in summary, for example summary.spend. Dynamic names are literal keys, for example data[0].metrics[“events.Purchase”] and summary[“events.Purchase”]. Money metrics aggregate stored reporting values; the configured reporting currency belongs to the property.

MetricValueSource
spendAmount spent on the ads.Ad platform
impressionsNumber of times the ads were shown.Ad platform
reachSum of ad-platform reach across the requested dates; a person may be counted on multiple days.Ad platform
linkClicksNumber of clicks on the ad links.Ad platform
resultsResults that the ad platform attributes to the ads, for the campaign objective.Ad platform
resultValuesValue of the results that the ad platform attributes to the ads.Ad platform
sessionsNumber of sessions that AnyTrack tracked.AnyTrack
clientsApproximate number of distinct property-scoped client IDs (browsers).AnyTrack
eventValuesSum of the values of the conversion events.AnyTrack
events.<EventName>Number of events with this name, for example events.Purchase.AnyTrack
frequencyimpressions ÷ reach.Calculated
cpm1,000 × spend ÷ impressions.Calculated
cpcspend ÷ linkClicks.Calculated
ctrlinkClicks ÷ impressions, as a ratio: 0.02 is 2%.Calculated
roaseventValues ÷ spend.Calculated
cpe.<EventName>spend ÷ the number of events with this name.Calculated

A calculated metric is null when its divisor is zero, negative, or unavailable, or another required input is unavailable. Unavailable ad platform metrics are also null. AnyTrack gets spend, impressions, reach, link clicks, and results from Meta Ads, Google Ads, TikTok Ads, ChatGPT Ads, and Microsoft Ads. Taboola and Outbrain campaigns have no ad platform metrics.

This endpoint needs IDs that other endpoints return:

  1. Call List the account properties. Copy the id of the property: it is the propertyId.
  2. Call this endpoint with these IDs.

bearerAuth: API key created in the dashboard (atk_…). Send it in the Authorization: Bearer YOUR_API_KEY header.

propertyIdstringrequired
ID of the property. Get it from listProperties (id).
application/jsonrequired
fromstring · daterequired
First day of the report, included, in the property time zone. The range covers at most 31 days.
Format YYYY-MM-DD, e.g. 2026-01-31
tostring · daterequired
Last day of the report, included, in the property time zone. to must be on or after from.
Format YYYY-MM-DD, e.g. 2026-01-31
attributionstring
Attribution model. last-ad-click gives the credit to the last ad click before the conversion. first-ad-click gives the credit to the first ad click.
Allowed values last-ad-click first-ad-clickDefault last-ad-click
groupBystring
Level of each row: campaign, adset (ad set), or ad.
Allowed values campaign adset adDefault campaign
metricsarray of string
Metrics to return in each row and in summary. Use the metric names in the Metrics section, events.<EventName>, or cpe.<EventName>. AnyTrack removes duplicate names.
Min items 1Max items 20Item max length 80
conversionEventsarray of string
Events that count as conversions for eventValues and roas. Defaults to the property conversion events, or Purchase if none are configured. Other named event metrics are independent of this selection.
Min items 1Max items 20Item min length 1Item max length 64
filtersobject
Filters for the rows. A row must match every filter that you send. A row matches a filter when it matches one of its values.
Show 6 child attributes
channelarray of string
Channels to include. Use the channel values of the report rows. With this filter, rows that have spend but no tracked event are not included.
Min items 1Max items 50Item min length 1Item max length 256
platformarray of string
Platforms to include. With this filter, rows that have spend but no tracked event are not included.
Min items 1Max items 50Item min length 1Item max length 256
adNetworkarray of string
Ad networks to include. Use the adNetwork values of the report rows.
Min items 1Max items 50Item min length 1Item max length 256
campaignIdsarray of string
IDs of the campaigns to include. Use the id of rows grouped by campaign.
Min items 1Max items 50Item min length 1Item max length 256
adsetIdsarray of string
IDs of the ad sets to include. Use the id of rows grouped by adset.
Min items 1Max items 50Item min length 1Item max length 256
adIdsarray of string
IDs of the ads to include. Use the id of rows grouped by ad.
Min items 1Max items 50Item min length 1Item max length 256
sortobject
Sort order of the rows.
Show 2 child attributes
metricstringrequired
Metric to sort by. Use one of the fixed metric names. You cannot sort by events.<EventName> or cpe.<EventName>.
Allowed values spend impressions reach frequency linkClicks sessions clients eventValues results resultValues cpm cpc ctr roas
directionstring
desc: highest value first. asc: lowest value first.
Allowed values asc descDefault desc
limitinteger
Number of items on each page.
Default 50Min 1Max 100
cursorstring
The nextCursor from the previous page. Keep the property and query fields unchanged. limit may change where supported. Pages are not snapshot-consistent.
Min length 1Max length 2048

Every response field is present unless it shows optional. A type that ends in | null can be null.

application/json
dataarray of object
Rows of the report on this page. Each row is a campaign, an ad set, or an ad.
Show 7 child attributes
idstring
ID of the campaign, ad set, or ad. Send it in filters.campaignIds, filters.adsetIds, or filters.adIds to filter a report.
typestring
Level of the row. It is the same as the groupBy value of the request.
Allowed values campaign adset ad
namestring | null
Name of the campaign, ad set, or ad.
channelstring | null
Channel of the traffic. Send these values in filters.channel.
adNetworkstring | null
Ad network of the row. Send these values in filters.adNetwork.
statusstring | null
Delivery status on the ad platform. null when the ad platform does not give a status.
Allowed values active paused terminated
metricsmap of (number | null)
Values of the requested metrics, keyed by metric name (including literal keys such as events.Purchase). A value is null when its inputs are unavailable or its divisor is not positive. See the operation Metrics section for formulas.
nextCursorstring | null
Cursor of the next page. Send it as cursor with the same query to get the next page. null on the last page.
reportobject
Settings that AnyTrack used for the report.
Show 8 child attributes
propertyIdstring
ID of the property.
fromstring
First day of the report, as in the request.
tostring
Last day of the report, as in the request.
timezonestring
Time zone of the report. It is the time zone of the property.
currencystring
Configured reporting currency of the property. For individual conversions, use the currency returned on each event for its value.
attributionstring
Attribution model of the report.
Allowed values last-ad-click first-ad-click
groupBystring
Level of the rows.
Allowed values campaign adset ad
conversionEventsarray of string
Events that counted as conversions.
summarymap of (number | null) | null
Requested metrics for the whole query, keyed directly by metric name (for example summary.spend or summary[“events.Purchase”]). Returned on the first page when available; later pages return null. Do not add summary values to page rows.

Every error returns the error object.

StatusDescription and action
400invalid_request, invalid_cursor: A parameter or a body field is not valid, or the cursor belongs to a different query. Correct the request. error.details, when present, names invalid fields. Do not reuse a cursor with a different query.
401unauthenticated: Missing, invalid or deleted API key. Send a valid key in Authorization: Bearer. MCP uses an OAuth access token, which may also expire or be revoked.
403api_access_unavailable: API access is disabled for this account. Contact AnyTrack support. OAuth requests also require the anytrack:read scope (insufficient_scope).
404not_found: An ID does not exist, or it belongs to a different account. The API gives the same error for both. Check the IDs. Get them again from the list endpoints.
413payload_too_large: The request body is larger than 16 KB. Send a smaller request body.
429rate_limited: The account sent more than 60 requests in one minute. Wait for the number of seconds in the Retry-After header, then retry.
500response_too_large, internal_error: The response is larger than 1 MB, or the API has an internal error. For response_too_large, ask for fewer rows or metrics. For internal_error, contact AnyTrack support with the requestId.
503service_unavailable: The service is not available for a short time. Retry later, and wait longer after each failed retry.
504upstream_timeout: A downstream request timed out (the report client timeout is 65 seconds). Narrow the date range, then retry with backoff.

Command template. Replace the path placeholders. Put the request body in request-body.json, as in the schema above. Add the query parameters that you need. This is not a recorded request or response.

Terminal window
curl --request POST 'https://api.anytrack.io/v1/properties/{propertyId}/reports/campaigns' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data @request-body.json

Download the OpenAPI contract.