API Reference
Audiences & Lists
Audiences

Audiences API

Preview audience segment definitions before materializing them. The Audiences API lets you test a segment's reach and inspect sample records in real time — without creating a persistent audience in the CDP.

Base URL: https://api.experiture.ai/public/v1

Authentication: All endpoints require a bearer token with cdp:audiences:preview scope. See Authentication.


Overview

OperationEndpointModeUse Case
Preview audiencePOST /audiences/{audience_id}/previewSynchronousRun an audience definition and see match count + sample rows.

Preview runs against live data and executes the same query engine used for materialized audiences, so counts and sample rows are authoritative.


Preview an Audience

Execute an existing audience definition and return its current match count plus a sample of records. Useful for:

  • Validation — confirm a segment returns the expected cohort before activating it.
  • Campaign sizing — get an up-to-the-second reach estimate.
  • Debugging — inspect actual records that match (or don't match) a rule.
POST /audiences/{audience_id}/preview
Authorization: Bearer <token>
Content-Type: application/json

Path parameters

NameTypeDescription
audience_idstringID of the saved audience definition.

Request body

FieldTypeRequiredDescription
limitintegerNoMax sample records to return. Range 1 – 1000. Default 100.

Example request

curl -X POST https://api.experiture.ai/public/v1/audiences/aud_01HXYZ/preview \
  -H "Authorization: Bearer <your_access_token>" \
  -H "Content-Type: application/json" \
  -d '{ "limit": 50 }'

Response — 200 OK

{
  "success": true,
  "data": {
    "audienceId": "aud_01HXYZ",
    "matchCount": 18432,
    "isExact": true,
    "executionTimeMs": 412,
    "fieldsUsed": ["email", "tier", "last_order_at", "country"],
    "sampleRecords": [
      {
        "email": "jane@example.com",
        "tier": "gold",
        "country": "US",
        "last_order_at": "2026-04-20T12:00:00Z"
      }
    ]
  },
  "correlationId": "<uuid>"
}

Response Fields

FieldTypeDescription
audienceIdstringEcho of the path parameter.
matchCountintegerTotal rows matching the audience definition.
isExactbooleantrue if the count is exact; false if it is an approximation. Defaults to false.
executionTimeMsintegerServer-side query execution time.
fieldsUsedarrayColumns referenced by the audience rules. Useful for understanding dependencies.
sampleRecordsarrayUp to limit matching records (projected to fieldsUsed).

Errors

HTTP StatusCodeMeaning
400CDP_ETL.VALIDATION.REQUEST_INVALIDlimit out of range or body malformed.
401CDP_ETL.AUTH.UNAUTHORIZEDMissing or invalid bearer token.
403CDP_ETL.AUTH.FORBIDDENToken lacks read access to the audience.
404CDP_ETL.AUDIENCE.NOT_FOUNDNo audience exists with the given audience_id in this workspace.
422CDP_ETL.AUDIENCE.INVALIDThe audience definition references fields that no longer exist.
429CDP_ETL.RATE.LIMITEDSee Rate Limits.

Constraints

  • Execution budget: previews are capped at ~30 s server-side. Very complex audiences may time out — simplify or materialize.
  • Sample size: limit caps at 1,000. For full exports, materialize the audience and use an export job.
  • Read-your-writes: profile writes are reflected in preview within seconds of acceptance (no need to wait for batch merge).

See Also