Get a campaign
const url = 'https://dev-api.infiniteaudience.ai/v1/campaigns/example';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://dev-api.infiniteaudience.ai/v1/campaigns/example \ --header 'Authorization: Bearer <token>'Returns full campaign details including an expanded audiences array with resolved segment names and record counts for each linked audience.
Requires ‘discovery’ scope.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Campaign ID returned by POST /v1/campaigns.
Responses
Section titled “Responses”Campaign with expanded audience list.
A named workspace grouping related audiences and deliveries. There is no audience_ids[] field — audiences[] (below) is the only audience-linkage field the handler ever returns.
object
Unique campaign identifier.
Display name of the campaign.
Lifecycle state of the campaign.
Associated chat session IDs.
Audiences linked to this campaign — expanded on GET /v1/campaigns/{id}; empty array on list responses.
object
IDs of include-role segments in this audience.
IDs of exclude-role segments in this audience.
Expanded summaries of the include-role segments, in segment_ids order (best-effort — missing or deleted segment docs are skipped). The first entry is the primary segment; its subtype determines the audience’s subtype-specific behavior.
Lightweight summary of a constituent segment, expanded server-side from the audience’s composition. Returned on both list and single-GET audience responses. subtype is the segment’s own subtype — use the first entry of segments (the primary included segment) to derive subtype-specific presentation for the audience.
object
Segment document ID.
Segment display name.
Cached record count of the segment. Null if never counted.
Subtype of the constituent segment.
Matched subtype only. Count of records in the uploaded identity file. Null otherwise.
Matched subtype only. Count of records successfully matched. Null otherwise.
Expanded summaries of the exclude-role segments, same semantics as segments.
Lightweight summary of a constituent segment, expanded server-side from the audience’s composition. Returned on both list and single-GET audience responses. subtype is the segment’s own subtype — use the first entry of segments (the primary included segment) to derive subtype-specific presentation for the audience.
object
Segment document ID.
Segment display name.
Cached record count of the segment. Null if never counted.
Subtype of the constituent segment.
Matched subtype only. Count of records in the uploaded identity file. Null otherwise.
Matched subtype only. Count of records successfully matched. Null otherwise.
When this audience was linked to the campaign.
UID of the user who linked this audience to the campaign.
UID of the user who created the campaign.
UID of the user who last updated the campaign.
Example
{ "status": "active", "audiences": [ { "status": "active", "segments": [ { "subtype": "filter" } ], "excluded_segments": [ { "subtype": "filter" } ], "set_logic": "union" } ]}Missing or invalid Bearer token. Obtain one via POST /v1/auth/token. When a token was supplied but rejected, code distinguishes TOKEN_EXPIRED (the token’s lifetime has passed — request a new one via POST /v1/auth/token and retry) from TOKEN_INVALID (malformed or revoked — re-authenticate).
object
Stable machine-readable error code (e.g. INVALID_STATUS_TRANSITION, BILLING_INSUFFICIENT_BALANCE). Always present.
Human-readable explanation of the error.
Alternate machine-readable code — present on some endpoints as an alias for error for backward compatibility.
Opaque support/debug identifier when available.
Examples
{ "error": "Unauthorized: Missing or invalid Authorization header"}{ "error": "Unauthorized", "code": "TOKEN_EXPIRED", "message": "Your session has expired. Please sign in again."}Token is valid but lacks the required scope for this endpoint. Check the endpoint description for the required scope (discovery, purchase, or account).
object
Stable machine-readable error code (e.g. INVALID_STATUS_TRANSITION, BILLING_INSUFFICIENT_BALANCE). Always present.
Human-readable explanation of the error.
Alternate machine-readable code — present on some endpoints as an alias for error for backward compatibility.
Opaque support/debug identifier when available.
Examples
{ "error": "SCOPE_REQUIRED", "message": "This endpoint requires the purchase scope."}Resource not found or not accessible to the calling org.
object
Stable machine-readable error code (e.g. INVALID_STATUS_TRANSITION, BILLING_INSUFFICIENT_BALANCE). Always present.
Human-readable explanation of the error.
Alternate machine-readable code — present on some endpoints as an alias for error for backward compatibility.
Opaque support/debug identifier when available.
Examples
{ "error": "Audience not found"}