Get audiences
GET /api/v1/public/audiences
Retrieve audiences for an account, optionally filtered by website or state. When ruleId is provided, returns a single audience by ID.
Filtering
- Filter by
websiteIdto scope results to a specific website - Filter by
stateto retrieve live or stopped audiences (default:live) - Use
ruleIdto fetch a single specific audience by its ID - returns{ audience }instead of{ audiences }
Notes
- All timestamp fields are in Unix timestamp format (milliseconds)
- Rules are stored as JSON strings and need to be parsed
- Priority (
prio) determines execution order when multiple audiences could apply - The
variantsarray contains the different variations being tested
Parameters
Section titled “ Parameters ”Header Parameters
Section titled “Header Parameters ”Your API key from account settings.
The email address of your user.
The ID of your account. You can find this in the account settings.
The ID of the workspace you want to use.
Query Parameters
Section titled “Query Parameters ”Fetch a single audience by its ID. When provided, the response shape is { audience } instead of { audiences }.
Filter by audience state. Defaults to live (all non-stopped audiences). Use stopped to retrieve stopped audiences.
Responses
Section titled “ Responses ”Successful response with list of audiences.
object
object
The account ID that owns this audience.
The website this audience belongs to.
Unique identifier for this audience.
Display name of the audience.
Current state of the audience.
JSON string containing the targeting rule expression.
Unit for the duration field.
Unix timestamp (ms) when the audience was created.
Unix timestamp (ms) when the audience was last updated.
Whether the audience is disabled. Disabled audiences are excluded from evaluation.
Whether this audience can be modified.
Tags used to categorise and filter audiences.
Example
{ "audiences": [ { "accountId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "websiteId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "ruleId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "name": "Homepage hero optimization", "state": "live", "prio": 100, "rule": "{\"and\":[{\"field\":\"url\",\"operator\":\"equals\",\"value\":\"/\"}]}", "startDate": 1640995200000, "createdDate": 1640995200000, "updatedDate": 1641081600000, "webPagePath": "/", "exclusive": false, "isComponent": false, "variants": [ { "id": "control", "name": "Control", "weight": 50 }, { "id": "variation-1", "name": "New hero design", "weight": 50 } ] } ]}Bad request - invalid parameters.
Unauthorized - invalid API key.
Forbidden - insufficient permissions.