Audiences
Contact lists for marketing and segmentation (`publiq.audiences`).
The audiences resource represents contact lists used for marketing and segmentation: create an audience to group contacts and list your organization audiences.
Method reference
audiences.create
audiences.create(params) → Promise<Audience>Creates a new audience (contact list). The audience starts empty — add contacts to it after creation.
| Parameter | Type | Description |
|---|---|---|
nameRequired | string | The audience name (1 to 200 characters). |
Returns: The created audience — { object: "audience", id, name, ... }.
const audience = await publiq.audiences.create({
name: 'Newsletter subscribers',
});
console.log(audience.id, audience.name); // "aud_...", "Newsletter subscribers"audiences.list
audiences.list() → Promise<AudienceList>Lists all audiences in the organization. No parameters — there is no cursor pagination here, just the organization scope.
Returns: List envelope { object: "list", data: Audience[] } with the organization audiences.
const { data } = await publiq.audiences.list();
for (const audience of data) {
console.log(audience.id, audience.name);
}Examples show Node, Python and PHP. In Python methods are snake_case (e.g. cancel_run, from_spec) and take a dict; in PHP they are camelCase and take an associative array. Body keys are always camelCase (templateKey, firstName, scheduledAt) — API responses come back in snake_case.