Skip to content

Refresh a member segment and this audience's composed metadata

POST
/v1/audiences/{id}/refresh
curl --request POST \
--url https://api.infiniteaudience.ai/v1/audiences/example/refresh \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "segment_id": "example", "hitl": false, "shard_count": 1, "compression": "none" }'

Refresh an existing filter or matched segment against current data. Requires ‘creator’ scope. Filter refresh is synchronous and invalidates its cached count. Matched refresh returns replacement upload URL(s); upload and complete identity processing before delivery. Matched duplicates return 409 SHARED_SOURCE_DATA so their shared artifact cannot be overwritten. Archived segments return 409 SEGMENT_ARCHIVED. Custom snapshots return 409 CUSTOM_REGENERATION_REQUIRED and require a new internal publication; their immutable lifetime is not extended. Retired subtypes return 400 UNKNOWN_SUBTYPE without work. No model workflow is launched. The audience is a composition wrapper; segment_id must identify one member. The successful refresh advances the audience version and expiry.

id
required
string

Audience document ID.

Media typeapplication/json
object
segment_id
required

Required. ID of the member segment (within this audience’s composition) to refresh. Rejected with 400 SEGMENT_ID_REQUIRED if omitted, or 400 SEGMENT_NOT_A_MEMBER if the segment is not a member of this audience. GET /v1/audiences/{id} to list this audience’s segments.

string
hitl

Matched uploads only. Stage the replacement file for mapping confirmation.

boolean
shard_count

(matched only) Set > 1 for same-format shards. Every CSV shard must include the same header, and all shards must share schema and compression. Returns upload_urls instead of upload_url.

integer
default: 1 >= 1 <= 50
compression

(matched only) Compression for this new upload. It does not inherit the previous upload. Send raw gzip bytes without Content-Encoding. gzip is not supported for avro-format segments — rejected with 400 UNSUPPORTED_INPUT_COMPRESSION.

string
default: none
Allowed values: none gzip

Audience refreshed. Inspect status to determine next steps. See next_step for a machine-readable hint.

Media typeapplication/json

Successful filter or matched refresh result. Custom snapshots return 409 CUSTOM_REGENERATION_REQUIRED; retired subtypes are rejected. No model workflow is launched.

object
audience_id
required
string
segment_id
required

The caller-chosen member segment that was refreshed (echoed back from the request body). An audience is a composition of N member segments with no primary one — this is always present, identifying which member segment’s refresh drove this response.

string
version
required

New snapshot version after the refresh.

integer
version_created_at
required
string format: date-time
expires_at
required

New 90-day hard expiry.

string format: date-time
status
required

Active = the refreshed segment’s subtype is filter, refreshed synchronously; pending = matched, awaiting replacement upload and identity processing.

string
Allowed values: active pending
subtype
required

Subtype of the refreshed segment.

string
Allowed values: filter matched
refreshed
required

True when the refreshed segment was re-derived; false only for the filter-subtype no-op path (segment already active, count already null, TTL already fresh) — this route always calls refreshSegmentCore without force, so that no-op path is reachable here exactly as it is on POST /v1/segments/{id}/refresh.

boolean
next_step
required

Human-readable hint for the calling agent on how to proceed (e.g. recount, upload to upload_url, or wait for the workflow).

string
upload_url

Presigned upload URL (24 h expiry). Present only for the matched subtype, when shard_count was 1 (the default) — absent when sharded, use upload_urls instead.

string
upload_urls

Presigned upload URLs (24 h expiry), one per shard, index-ordered. Present only for the matched subtype when shard_count > 1 was requested — upload_url is absent. Every CSV shard must include the same header row.

Array<string>
compression

Compression for this matched refresh upload.

string
Allowed values: none gzip
upload_expires_at

Expiry for upload_url/upload_urls. Present only for the matched subtype.

string format: date-time
Example
{
"audience_id": "aud_xyz123",
"segment_id": "seg_abc123",
"version": 2,
"version_created_at": "2026-06-30T14:00:00Z",
"expires_at": "2026-09-28T14:00:00Z",
"status": "active",
"subtype": "filter",
"refreshed": true,
"next_step": "Call recount_audience to refresh the record count before quoting or delivering."
}

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"
}

Resource state conflicts with the request. For upload analysis this includes FILE_NOT_YET_UPLOADED.

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
Example
{
"issues": [
{
"code": "INVALID_FILTER_SHAPE"
}
]
}

Unexpected server failure.

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
Example
{
"issues": [
{
"code": "INVALID_FILTER_SHAPE"
}
]
}