Documentation Index
Fetch the complete documentation index at: https://docs.interchange.io/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Some v2 endpoints can’t return a final result synchronously — typically because they fan out to a slow upstream (a sales agent that takes minutes to confirm a media buy, an audience platform that hashes and matches CRM data, a creative agent rendering a large asset). For those operations, the API returns a task ID immediately with HTTP202 Accepted. The task tracks the async work; you poll it (or receive a webhook) until it reaches a terminal state.
A task has:
- A stable UUID
taskId - A
taskTypedescribing the operation kind (audience_sync,media_buy_create,creative_sync) - A
statusthat progresses through AdCP states:submitted→working→completed(orfailed, orinput-required) - A
resourceIdpopulated on completion that points at the resource the task created or updated - An
errorobject populated on failure - A
responsepayload with the full downstream response - A
retryAfterSecondshint that tells you how often to poll
All endpoints below are mounted under
https://api.interchange.io/api/v2/buyer/.Prerequisites
- A Scope3 API key (see Authentication)
- A response from an endpoint that returned a task ID (e.g. an audience sync)
Step 1: Recognize when a task is returned
Async endpoints return HTTP202 Accepted with a taskId in the response body. For example, syncing an audience:
taskId is a UUID. Capture it and poll the task endpoint until the operation is done.
Step 2: Poll for status
Status values
| Status | Meaning | What to do |
|---|---|---|
submitted | Task accepted, not yet picked up | Wait retryAfterSeconds and poll again |
working | Downstream system is processing | Wait retryAfterSeconds and poll again |
input-required | The downstream needs additional input from you | Inspect response / error.suggestion and resubmit the originating call with corrections |
completed | Done — resourceId and response populated | Stop polling; read the result |
failed | Permanent failure — error populated | Stop polling; read the error and decide whether to retry |
Step 3: Handle outcomes
completed
Read resourceId to find the entity the task created or updated, and response for the full downstream payload.
failed
Inspect the AdCP-compatible error object:
error.recovery classifies the failure for agent retry logic:
| Recovery | Meaning |
|---|---|
transient | Retry the original call after a backoff — the upstream is temporarily unavailable |
correctable | Fix the input per error.field / error.suggestion, then retry |
terminal | No automatic retry will help — surface to a human operator |
error.retryAfter is set, wait at least that many seconds before retrying the original operation.
working / submitted — backing off
The response carries retryAfterSeconds as a hint; treat it as a floor. If the operation doesn’t complete within your timeout, surface the task ID to the caller so they can poll later — tasks are durable and outlive the originating request.
Best practices
- Prefer webhooks — register a
pushNotificationConfigon the originating call where the endpoint supports it (e.g. the audience sync endpoint accepts one). The webhook fires on every status transition; polling is only the fallback. - Honour
retryAfterSeconds— it’s set per task type and reflects how fast the downstream actually changes state. Polling more aggressively wastes quota and won’t make the task complete sooner. - Cap polling duration — if a task hasn’t reached a terminal state within an order of magnitude of the typical completion time for its
taskType, escalate to operator review rather than spinning forever. - Tasks are scoped to your customer —
GET /tasks/:taskIdreturns404if the task doesn’t belong to the authenticated customer. Treat the task ID as opaque and don’t share it across tenants. - Persist the
taskId— store it next to the originating request so a later process (or a human operator) can resolve the outcome even if the originating client died. - Idempotency — the underlying AdCP operations are idempotent on the originating call’s idempotency key; if a task
failedwithrecovery: transient, you can safely retry the original call with the same idempotency key.
Endpoint reference
| Method | Path | Purpose |
|---|---|---|
GET | /tasks/:taskId | Fetch the current status of an async task |
taskId (UUID).
Response: { data: TaskOutput } where TaskOutput includes taskId, taskType, status, resourceType, resourceId, error, response, metadata, retryAfterSeconds, createdAt, updatedAt.
Status enum: submitted, working, completed, failed, input-required.
Task type enum: audience_sync, media_buy_create, creative_sync.
See the OpenAPI spec for the full schema: API Reference.
Related
- Notifications — webhook-based delivery of the same task lifecycle events; preferred over polling
- Rate limits —
Retry-Aftersemantics on the originating call - Errors — error codes that appear in the task
errorobject