Refresh a member segment and this audience's composed metadata
const url = 'https://api.infiniteaudience.ai/v1/audiences/example/refresh';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"segment_id":"example","hitl":false,"shard_count":1,"compression":"none"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Audience document ID.
Request Bodyrequired
Section titled “Request Bodyrequired”object
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.
Matched uploads only. Stage the replacement file for mapping confirmation.
(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.
(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.
Responses
Section titled “Responses”Audience refreshed. Inspect status to determine next steps. See next_step for a machine-readable hint.
Successful filter or matched refresh result. Custom snapshots return 409 CUSTOM_REGENERATION_REQUIRED; retired subtypes are rejected. No model workflow is launched.
object
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.
New snapshot version after the refresh.
New 90-day hard expiry.
Active = the refreshed segment’s subtype is filter, refreshed synchronously; pending = matched, awaiting replacement upload and identity processing.
Subtype of the refreshed segment.
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.
Human-readable hint for the calling agent on how to proceed (e.g. recount, upload to upload_url, or wait for the workflow).
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.
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.
Compression for this matched refresh upload.
Expiry for upload_url/upload_urls. Present only for the matched subtype.
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.
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.
Public action for correcting the request or retrying later.
object
JSON path to the invalid filter field or value.
Examples
{ "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).
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.
Public action for correcting the request or retrying later.
object
JSON path to the invalid filter field or value.
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.
Public action for correcting the request or retrying later.
object
JSON path to the invalid filter field or value.
Examples
{ "error": "SCOPE_REQUIRED", "message": "This endpoint requires the creator 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.
Public action for correcting the request or retrying later.
object
JSON path to the invalid filter field or value.
Examples
{ "error": "Audience not found"}Resource state conflicts with the request. For upload analysis this includes FILE_NOT_YET_UPLOADED.
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.
Public action for correcting the request or retrying later.
object
JSON path to the invalid filter field or value.
Example
{ "issues": [ { "code": "INVALID_FILTER_SHAPE" } ]}Unexpected server failure.
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.
Public action for correcting the request or retrying later.
object
JSON path to the invalid filter field or value.
Example
{ "issues": [ { "code": "INVALID_FILTER_SHAPE" } ]}