AnyTrack API v1 Reference
Read-only API for your AnyTrack data: properties, campaign, event, and conversion reports, integrations, ad connections, pixels, and webhooks.
The AnyTrack API gives read-only access to the data in your AnyTrack account. Use the API to send your AnyTrack data to your own tools, for example a data warehouse, a dashboard, or a script.
What you can do with the API
Section titled “What you can do with the API”- List your properties, and get the reporting settings of each property.
- Get the campaign report, the events report, and the conversions report of a property. Export the campaign report as a CSV file.
- Get the full record of one conversion event.
- List your integrations, and read the requests that each integration receives. Use these logs to troubleshoot a postback or a webhook.
- List the ad platform connections, the pixels and ad destinations, and the webhooks of a property.
The API cannot change your data. To use the API, create an API key. See API Keys.
Contract version 1.0.0. Generated from the production specification at KB build time. Download this build’s OpenAPI snapshot.
How the API is organized
Section titled “How the API is organized”propertyId- ReportsCampaigns, events, and conversions
- Conversion events
conversionId - Ad platform connections
connectionId - Pixels and ad destinations
destinationId - Outgoing webhooks
webhookId
integrationId- Integration logsRequests that the integration received
The resources also link to each other:
- An integration has a
propertyIdwhen it belongs to a property. - A conversion event has an
integrationIdwhen an integration sent it. - A connection has
destinationIds: the destinations that use the connection.
Get the IDs you need
Section titled “Get the IDs you need”Most endpoints need IDs that other endpoints return. The Before you call section of each endpoint gives the calls in order. For example, to get one ad platform connection:
- Call List the account properties. Copy the
idof the property. - Call List the ad platform connections of a property with this
propertyId. Copy theidof the connection. - Call Get an ad platform connection with the
propertyIdand theconnectionId.
How to read this reference
Section titled “How to read this reference”- required on a request field or parameter: send it in every request.
- optional on a response field: the field can be absent from the response. Every other response field is always present.
- A type that ends in
| nullcan have the valuenull. - Show child attributes opens the fields of an object.
Pagination
Section titled “Pagination”The property list, the reports, and the integration logs return one page at a time. Each page has data and nextCursor.
- Send the first request without
cursor. - If
nextCursoris notnull, send the same request again withcursorset to the value ofnextCursor. - Stop when
nextCursorisnull.
A page has 50 items by default. Set limit to a value from 1 to 100. Integration logs have 20 items on each page. A cursor works only with the query that made it. With a different query, the API returns 400 with the code invalid_cursor.
Pages are not a snapshot. If the data changes while you read the pages, an item can move to a different page. For a consistent result, start again from the first page. The lists of integrations, connections, destinations, and webhooks have no pages: one response contains all the items.
Dates, time zones, and currency
Section titled “Dates, time zones, and currency”fromandtoare calendar dates in the formatYYYY-MM-DD. The range includes both days. A report covers at most 31 days.- Reports use the time zone and the currency of the property. The
reportobject of each report response gives both. You cannot change them in the request. - Integration logs use dates in UTC.
- Timestamps, such as
timeandcreatedAt, use the ISO 8601 format in UTC. - Events can take a few minutes to show in reports, and AnyTrack syncs ad spend on a schedule. The data of the current day is not complete.
Limits
Section titled “Limits”| Limit | Value |
|---|---|
| Requests | 60 per minute for each account. All the API keys of the account share this limit. |
| Report range | 31 days |
| Page size | 1 to 100 items, 50 by default |
| Request body | 16 KB |
| Response | 1 MB |
| Report query time | 65 seconds |
Rate limits
Section titled “Rate limits”Each account can send 60 requests per minute. A response within the limit has the headers X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset. Above the limit, the API returns 429 with the code rate_limited and a Retry-After header.
AnyTrack will set the rate limit by plan. The limit of each plan is not available yet.
Errors
Section titled “Errors”Every error response contains one error object. Every response has an X-Request-Id header.
{ "error": { "code": "invalid_request", "message": "Invalid request", "requestId": "req_5f0c1a2b3c4d5e6f7a8b9c0d", "retryable": false, "details": [{ "path": "to", "message": "Date range cannot exceed 31 days" }] }}Retry a request only when error.retryable is true. A request body that is not valid JSON gets a 400 response without the error object.
| Status | Description and action |
|---|---|
400 | invalid_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. |
401 | unauthenticated: 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. |
403 | api_access_unavailable: API access is disabled for this account. Contact AnyTrack support. OAuth requests also require the anytrack:read scope (insufficient_scope). |
404 | not_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. |
413 | payload_too_large: The request body is larger than 16 KB. Send a smaller request body. |
429 | rate_limited: The account sent more than 60 requests in one minute. Wait for the number of seconds in the Retry-After header, then retry. |
500 | response_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. |
503 | service_unavailable: The service is not available for a short time. Retry later, and wait longer after each failed retry. |
504 | upstream_timeout: A downstream request timed out (the report client timeout is 65 seconds). Narrow the date range, then retry with backoff. |
Error object
Section titled “Error object”errorobjectShow 5 child attributes
codestringinvalid_request invalid_cursor unauthenticated insufficient_scope api_access_unavailable not_found payload_too_large rate_limited response_too_large upstream_timeout service_unavailable internal_errormessagestringrequestIdstringretryablebooleantrue when a retry of the same request can succeed. Retry only when this value is true.detailsarray of objectoptionalShow 2 child attributes
pathstringmessagestringmessagestringoptionalerror.message instead.codestringoptionalerror.code instead.issuesarray of objectoptionalerror.details instead.Show 1 child attribute
messagestringAuthentication
Section titled “Authentication”bearerAuth: API key created in the dashboard (atk_…). Send it in the Authorization: Bearer YOUR_API_KEY header.
Operations
Section titled “Operations”Connections
Section titled “Connections”A connection is an ad platform account authorized for a property. AnyTrack uses it to sync spend and campaign data.
Conversions
Section titled “Conversions”A conversion is one tracked event, such as a Purchase or a Lead. Find events with the conversions report, then get one event with its id.
Destinations
Section titled “Destinations”A destination is a pixel or an ad platform that receives conversions from a property.
Integrations
Section titled “Integrations”An integration is a source of events, such as a store, a form, or an affiliate network. Integrations belong to the account, and each one can also belong to one property.
Properties
Section titled “Properties”A property is a website or funnel that AnyTrack tracks. Every report, conversion, connection, destination, and webhook belongs to one property.
Reports
Section titled “Reports”Reports return the data of a property for up to 31 days, in the time zone and currency of the property.
Webhooks
Section titled “Webhooks”An outgoing webhook sends the events of a property to a URL.