Skip to content

Update a campaign

PATCH
/v1/campaigns/{id}
curl --request PATCH \
--url https://api.infiniteaudience.ai/v1/campaigns/example \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "description": "example", "status": "archived" }'

Rename a campaign, revise its brief, or change its status. Supported status values: archived (soft-delete) and active (restore from archived). Requires ‘creator’ scope.

id
required
string
Media typeapplication/json
object
name

New display name.

string
<= 120 characters
description

Campaign brief; send an empty string to clear it.

string
<= 1000 characters
status

archived — soft-deletes the campaign (excluded from list by default). active — restores a previously archived campaign.

string
Allowed values: archived active

Updated campaign.

Media typeapplication/json

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
id
required

Unique campaign identifier.

string
name
required

Display name of the campaign.

string
description
required

User-authored campaign brief, intended market, goals, and constraints.

string
<= 1000 characters
status
required

Lifecycle state of the campaign.

string
Allowed values: active archived
audiences
required

Audiences linked to this campaign — expanded on GET /v1/campaigns/{id}; empty array on list responses.

Array<object>
object
id
string
name
string
status
string
Allowed values: active archived expired
record_count
integer | null
segment_ids

IDs of include-role segments in this audience.

Array<string>
excluded_segment_ids

IDs of exclude-role segments in this audience.

Array<string>
segments

Constituent segments; audiences can combine multiple subtypes.

Array<object>

Constituent segment summary and saved filter definition. Audiences may combine multiple segment subtypes; there is no primary segment or audience subtype.

object
id
required

Segment document ID.

string
name
required

Segment display name.

string
record_count
required

Cached record count of the segment. Null if never counted.

integer | null
subtype
required

Subtype of the constituent segment.

string
Allowed values: filter matched similarity propensity
input_record_count
required

Matched subtype only. Count of records in the uploaded identity file. Null otherwise.

integer | null
match_count
required

Matched subtype only. Count of records successfully matched. Null otherwise.

integer | null
filter_groups
Array<object>

A group of Filter conditions. All filters within a single group are always ANDed together — there is no per-group intra-operator. The combinator attribute is an inter-group operator: it controls how this group is joined to the immediately preceding group in the array. The combinator on the first group (index 0) is always ignored.

Example — (city = "NYC" AND state = "NY") OR (state = "CA"):

  { "id": "g1", "filters": [{"field":"city","op":"=","value":"NYC"},
                            {"field":"state","op":"=","value":"NY"}],
    "combinator": "AND" },
  { "id": "g2", "filters": [{"field":"state","op":"=","value":"CA"}],
    "combinator": "OR" }
] ```
Group g1's `combinator` is irrelevant (it is the first group). Group g2's `combinator: "OR"` means the result is `(g1) OR (g2)`.
object
id
required

Stable identifier (UUID or NanoID). Used to track groups across edits.

string
filters
required

One or more filter conditions. All conditions in this array are combined with AND. Provide at least one filter per group.

Array<object>

A single filter condition for audience discovery or job execution

object
field
required

Canonical catalog field_name (e.g. age or state). ZIP5 also accepts zip, zip_code, or postal_code as input aliases; saved responses use zip5.

string
op
required

Comparison operator

string
Allowed values: = != < <= > >= IN NOT IN BETWEEN LIKE ARRAY_CONTAINS ARRAY_CONTAINS_ANY IS NULL IS NOT NULL
text_comparison

Optional STRING comparison mode for =, !=, IN, NOT IN, and LIKE, or ARRAY membership mode for ARRAY_CONTAINS and ARRAY_CONTAINS_ANY. Defaults to exact. Case-insensitive mode applies Unicode case folding to both the stored value and the supplied value.

string
Allowed values: exact case_insensitive
trim_whitespace

Optionally trim leading and trailing whitespace on both sides of a STRING or ARRAY comparison. Defaults to false; independent of text_comparison.

boolean
value
One of:
string
combinator
required

Inter-group operator. Joins this group to the previous group in the array. AND narrows the result; OR broadens it. Ignored on the first group (index 0) — that group has no predecessor to join.

string
Allowed values: AND OR
current_version
integer
record_limit
integer | null
excluded_segments

Expanded summaries of the exclude-role segments, same semantics as segments.

Array<object>

Constituent segment summary and saved filter definition. Audiences may combine multiple segment subtypes; there is no primary segment or audience subtype.

object
id
required

Segment document ID.

string
name
required

Segment display name.

string
record_count
required

Cached record count of the segment. Null if never counted.

integer | null
subtype
required

Subtype of the constituent segment.

string
Allowed values: filter matched similarity propensity
input_record_count
required

Matched subtype only. Count of records in the uploaded identity file. Null otherwise.

integer | null
match_count
required

Matched subtype only. Count of records successfully matched. Null otherwise.

integer | null
filter_groups
Array<object>

A group of Filter conditions. All filters within a single group are always ANDed together — there is no per-group intra-operator. The combinator attribute is an inter-group operator: it controls how this group is joined to the immediately preceding group in the array. The combinator on the first group (index 0) is always ignored.

Example — (city = "NYC" AND state = "NY") OR (state = "CA"):

  { "id": "g1", "filters": [{"field":"city","op":"=","value":"NYC"},
                            {"field":"state","op":"=","value":"NY"}],
    "combinator": "AND" },
  { "id": "g2", "filters": [{"field":"state","op":"=","value":"CA"}],
    "combinator": "OR" }
] ```
Group g1's `combinator` is irrelevant (it is the first group). Group g2's `combinator: "OR"` means the result is `(g1) OR (g2)`.
object
id
required

Stable identifier (UUID or NanoID). Used to track groups across edits.

string
filters
required

One or more filter conditions. All conditions in this array are combined with AND. Provide at least one filter per group.

Array<object>

A single filter condition for audience discovery or job execution

object
field
required

Canonical catalog field_name (e.g. age or state). ZIP5 also accepts zip, zip_code, or postal_code as input aliases; saved responses use zip5.

string
op
required

Comparison operator

string
Allowed values: = != < <= > >= IN NOT IN BETWEEN LIKE ARRAY_CONTAINS ARRAY_CONTAINS_ANY IS NULL IS NOT NULL
text_comparison

Optional STRING comparison mode for =, !=, IN, NOT IN, and LIKE, or ARRAY membership mode for ARRAY_CONTAINS and ARRAY_CONTAINS_ANY. Defaults to exact. Case-insensitive mode applies Unicode case folding to both the stored value and the supplied value.

string
Allowed values: exact case_insensitive
trim_whitespace

Optionally trim leading and trailing whitespace on both sides of a STRING or ARRAY comparison. Defaults to false; independent of text_comparison.

boolean
value
One of:
string
combinator
required

Inter-group operator. Joins this group to the previous group in the array. AND narrows the result; OR broadens it. Ignored on the first group (index 0) — that group has no predecessor to join.

string
Allowed values: AND OR
current_version
integer
record_limit
integer | null
set_logic
string
Allowed values: union intersection
snapshot_version
integer
parent_audience_id
string | null
linked_at

When this audience was linked to the campaign.

string | null format: date-time
created_at
required
string format: date-time
updated_at
required
string format: date-time
Example
{
"status": "active",
"audiences": [
{
"status": "active",
"segments": [
{
"subtype": "filter",
"filter_groups": [
{
"filters": [
{
"op": "=",
"text_comparison": "exact"
}
],
"combinator": "AND"
}
]
}
],
"excluded_segments": [
{
"subtype": "filter",
"filter_groups": [
{
"filters": [
{
"op": "=",
"text_comparison": "exact"
}
],
"combinator": "AND"
}
]
}
],
"set_logic": "union"
}
]
}

Invalid request — malformed body, missing required attribute, or failed validation. See error and message for details.

Media typeapplication/json
object
error
required

Stable machine-readable error code (e.g. INVALID_STATUS_TRANSITION, BILLING_INSUFFICIENT_BALANCE). Always present.

string
message

Human-readable explanation of the error.

string
code

Alternate machine-readable code — present on some endpoints as an alias for error for backward compatibility.

string
request_id

Opaque support/debug identifier when available.

string
next_step

Public action for correcting the request or retrying later.

string
issues
Array<object>
object
path
required

JSON path to the invalid filter field or value.

string
code
required
string
Allowed values: INVALID_FILTER_SHAPE UNKNOWN_FILTER_FIELD FIELD_NOT_FILTERABLE UNSUPPORTED_FILTER_OPERATOR UNSUPPORTED_TEXT_COMPARISON INVALID_FILTER_VALUE INVALID_ENUM_VALUE AMBIGUOUS_ENUM_VALUE
message
required
string
suggestions
Array<string>
key
additional properties
any
Examples
Examplevalidation_error
{
"error": "Bad Request",
"code": "MISSING_SEGMENTS",
"message": "segment_ids is required for filter audiences."
}

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).

Media typeapplication/json
object
error
required

Stable machine-readable error code (e.g. INVALID_STATUS_TRANSITION, BILLING_INSUFFICIENT_BALANCE). Always present.

string
message

Human-readable explanation of the error.

string
code

Alternate machine-readable code — present on some endpoints as an alias for error for backward compatibility.

string
request_id

Opaque support/debug identifier when available.

string
next_step

Public action for correcting the request or retrying later.

string
issues
Array<object>
object
path
required

JSON path to the invalid filter field or value.

string
code
required
string
Allowed values: INVALID_FILTER_SHAPE UNKNOWN_FILTER_FIELD FIELD_NOT_FILTERABLE UNSUPPORTED_FILTER_OPERATOR UNSUPPORTED_TEXT_COMPARISON INVALID_FILTER_VALUE INVALID_ENUM_VALUE AMBIGUOUS_ENUM_VALUE
message
required
string
suggestions
Array<string>
key
additional properties
any
Examples
{
"error": "Unauthorized: Missing or invalid Authorization header"
}

Token is valid but lacks the required scope for this endpoint. Check the endpoint description for the required scope (discovery, purchase, or account).

Media typeapplication/json
object
error
required

Stable machine-readable error code (e.g. INVALID_STATUS_TRANSITION, BILLING_INSUFFICIENT_BALANCE). Always present.

string
message

Human-readable explanation of the error.

string
code

Alternate machine-readable code — present on some endpoints as an alias for error for backward compatibility.

string
request_id

Opaque support/debug identifier when available.

string
next_step

Public action for correcting the request or retrying later.

string
issues
Array<object>
object
path
required

JSON path to the invalid filter field or value.

string
code
required
string
Allowed values: INVALID_FILTER_SHAPE UNKNOWN_FILTER_FIELD FIELD_NOT_FILTERABLE UNSUPPORTED_FILTER_OPERATOR UNSUPPORTED_TEXT_COMPARISON INVALID_FILTER_VALUE INVALID_ENUM_VALUE AMBIGUOUS_ENUM_VALUE
message
required
string
suggestions
Array<string>
key
additional properties
any
Examples
Examplemissing_scope
{
"error": "SCOPE_REQUIRED",
"message": "This endpoint requires the creator scope."
}

Resource not found or not accessible to the calling org.

Media typeapplication/json
object
error
required

Stable machine-readable error code (e.g. INVALID_STATUS_TRANSITION, BILLING_INSUFFICIENT_BALANCE). Always present.

string
message

Human-readable explanation of the error.

string
code

Alternate machine-readable code — present on some endpoints as an alias for error for backward compatibility.

string
request_id

Opaque support/debug identifier when available.

string
next_step

Public action for correcting the request or retrying later.

string
issues
Array<object>
object
path
required

JSON path to the invalid filter field or value.

string
code
required
string
Allowed values: INVALID_FILTER_SHAPE UNKNOWN_FILTER_FIELD FIELD_NOT_FILTERABLE UNSUPPORTED_FILTER_OPERATOR UNSUPPORTED_TEXT_COMPARISON INVALID_FILTER_VALUE INVALID_ENUM_VALUE AMBIGUOUS_ENUM_VALUE
message
required
string
suggestions
Array<string>
key
additional properties
any
Examples
Examplenot_found
{
"error": "Audience not found"
}