---
title: "Create audience"
method: POST
path: "/v1/audiences"
tags: ["Audiences"]
---

# Create audience

`POST /v1/audiences`

Creates a new audience definition. `name` is required; `enabled`, `tags`, and `component_references` are optional. New audiences default to enabled. Tags must be 255 characters or fewer each; the resolved name must also be 255 characters or fewer. Returns the created audience.

## Request body

- AudienceCreateRequest — Body of a `POST /v1/audiences` request.
  - `component_ids` string[]
  - `component_references` ComponentReferenceRequest[]
    - `component_id` string
    - `socket_names` string[]
  - `enabled` union — Whether the audience evaluates at runtime. Defaults to `true` when omitted. Provide a literal boolean or a buildtime evaluatable that resolves to a boolean.
    - boolean — Static enabled
    - string — Handlebars expression with [AudienceBuildtimeContext](https://github.com/extole/extole-specification/blob/main/openapi/expression-context/com/extole/api/audience/AudienceBuildtimeContext.d.ts).
    - string — Javascript expression with [AudienceBuildtimeContext](https://github.com/extole/extole-specification/blob/main/openapi/expression-context/com/extole/api/audience/AudienceBuildtimeContext.d.ts).
  - `name` union, required — Display name for the audience. Provide a literal string (`provided@buildtime:My audience`) or any buildtime evaluatable that resolves to a string. Must be 255 characters or fewer once resolved.
    - string — Handlebars expression with [AudienceBuildtimeContext](https://github.com/extole/extole-specification/blob/main/openapi/expression-context/com/extole/api/audience/AudienceBuildtimeContext.d.ts).
    - string — Javascript expression with [AudienceBuildtimeContext](https://github.com/extole/extole-specification/blob/main/openapi/expression-context/com/extole/api/audience/AudienceBuildtimeContext.d.ts).
  - `tags` string[] — Free-form tags applied to the audience. Used to organise audiences in the dashboard and to filter them in API queries. Each tag must be 255 characters or fewer.

## Response `200`

Created audience.

- AudienceResponse — Stored audience definition. Fields `name` and `enabled` are unevaluated and appear in buildtime-evaluatable form.
  - `component_ids` string[], required
  - `component_references` ComponentReferenceResponse[], required
    - `component_id` string
    - `socket_names` string[]
  - `enabled` union, required — Whether the audience is currently evaluated at runtime.
    - boolean — Literal enabled
    - string — Handlebars expression with [AudienceBuildtimeContext](https://github.com/extole/extole-specification/blob/main/openapi/expression-context/com/extole/api/audience/AudienceBuildtimeContext.d.ts).
    - string — Javascript expression with [AudienceBuildtimeContext](https://github.com/extole/extole-specification/blob/main/openapi/expression-context/com/extole/api/audience/AudienceBuildtimeContext.d.ts).
  - `id` string, required — Stable Extole identifier for the audience.
  - `name` union, required — Display name for the audience, in the same buildtime-evaluatable form that was supplied on create or update.
    - string — Handlebars expression with [AudienceBuildtimeContext](https://github.com/extole/extole-specification/blob/main/openapi/expression-context/com/extole/api/audience/AudienceBuildtimeContext.d.ts).
    - string — Javascript expression with [AudienceBuildtimeContext](https://github.com/extole/extole-specification/blob/main/openapi/expression-context/com/extole/api/audience/AudienceBuildtimeContext.d.ts).
  - `tags` string[], required — Free-form tags applied to the audience.

## Other responses

- `400` — Bad request. The named examples below cover the validation errors that are specific to this operation. Other 400 causes include malformed JSON, an empty request body, and an invalid `Time-Zone` header - inspect the response `code` field for the specific error.
- `401` — Unauthorized
- `402` — Payment Required
- `403` — Forbidden
- `415` — Unsupported Media Type
- `429` — Too Many Requests

---

[API](https://skmtc.net/extole/apis/integration-api-server-to-extole.md) · [All operations](https://skmtc.net/extole/apis/integration-api-server-to-extole/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/extole/integration-api-server-to-extole/revisions/c16e62e66755/schema)
