static or live.
Endpoint summary
Audience response
contactCount counts active membership. linkedCampaignsCount counts non-deleted campaigns that reference the audience.
List audiences
GET /audience
Query parameters: page, limit, search, sortBy, and sortOrder. Search covers name and description; supported sort fields are name, createdAt, and updatedAt.
200 with the standard { data, meta } envelope.
Get an audience
GET /audience/:id
200 with the audience response. Returns 404 when the audience is not in the key’s organization.
List audience contacts
GET /audience/:id/contacts
This endpoint returns the same contact list items as GET /contact and therefore exposes contact PII.
200 with { data, meta }; 404 for an unknown audience.
Create a static audience
POST /audience
201 with the audience and zero initial contacts. Omitting type also creates a static audience.
Live-audience rule schema
A live audience requires a rule group. Groups useAND or OR. Maximum rule-tree depth is three, counting the root group and condition nodes. A root group containing a subgroup containing conditions reaches this limit; another subgroup would exceed it.
equals, not_equals, is_empty, is_not_empty, gt, gte, lt, lte, contains, and not_contains. Comparison operators are limited to compatible types; contains is for text-like fields. is_empty and is_not_empty take no value.
Preview live rules
POST /audience/preview
Preview creates nothing and returns the number of contacts matching now.
201 response:
Create a live audience
POST /audience
GET /audience/:id or GET /audience/:id/contacts to confirm membership. The create response currently reports contactCount: 0 even when the initial evaluation finds matching contacts.
Side effect: evaluates organization contacts and manages memberships automatically. When a live audience drives an active campaign, contacts that begin matching can be enrolled into real campaign activity.
Add contacts to a static audience
POST /audience/:id/add-contacts
201 response:
409 because its membership is rule-managed.
Remove contacts from a static audience
POST /audience/:id/remove-contacts
The request schema is the same { "contacts": [<uuid>] } array.
201 response:
Update an audience
PUT /audience/:id
Request fields: optional name, description, and rules. Rules apply only to a live audience and trigger full re-evaluation.
200 with the updated audience. Side effect: changing live rules can add and exit members and can affect enrollment in a running campaign.
Delete an audience
DELETE /audience/:id
200 with the deleted audience. Returns 409 when one or more non-deleted campaigns reference it. This is destructive; list or retrieve the audience and confirm linkedCampaignsCount before deletion.
Flows API
Create an automation and run it against a synthetic contact.
Pagination and request retries
Page-based lists usepage=1 and limit=20 by default, with a maximum limit of 100, unless the endpoint above specifies an exception. Follow the response’s pagination metadata. See pagination for the response envelope.
If a request returns 429, wait for Retry-After when supplied before retrying. For a mutation that times out, check the resource or run before repeating the request; repeating it can duplicate work. See errors for authentication and validation failures.