> For the complete documentation index, see [llms.txt](https://docs.shoplift.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.shoplift.ai/api-reference/public-api/create-custom-audience.md).

# Create custom audience

Creates a new custom audience scoped to the store. Audiences can be referenced by ID when creating or updating tests. Names are unique per store (exact match); a duplicate returns 400. A country rule's values must be ISO 3166-1 alpha-2 codes ("GB", not "United Kingdom" or "UK"); any other value returns 400 naming the code to use.

```json
{"openapi":"3.1.1","info":{"title":"Shoplift Public API","version":"1.0.0"},"tags":[{"name":"Public API"}],"servers":[{"url":"https://app.shoplift.ai"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"http","description":"All requests require `Authorization: Bearer sl_live_<your_api_key>`. Generate a key from the Shoplift admin's API Keys settings page.","scheme":"bearer"}},"schemas":{"CreateAudienceRequest":{"required":["name","rules"],"type":"object","properties":{"name":{"type":"string"},"rules":{"type":"array","items":{"$ref":"#/components/schemas/CustomAudienceRule"}}},"additionalProperties":false},"CustomAudienceRule":{"required":["dimension","operator","values"],"type":"object","properties":{"dimension":{"type":"string"},"operator":{"type":"string"},"values":{"type":"array","items":{"type":"string"}},"selector":{"type":["null","string"]}},"additionalProperties":false},"IdResponse":{"required":["id"],"type":"object","properties":{"id":{"type":"string","format":"uuid"}}},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}}}}},"paths":{"/api/public/v1/custom-audiences":{"post":{"tags":["Public API"],"summary":"Create custom audience","description":"Creates a new custom audience scoped to the store. Audiences can be referenced by ID when creating or updating tests. Names are unique per store (exact match); a duplicate returns 400. A country rule's values must be ISO 3166-1 alpha-2 codes (\"GB\", not \"United Kingdom\" or \"UK\"); any other value returns 400 naming the code to use.","operationId":"createCustomAudience","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAudienceRequest"}}},"required":true},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdResponse"}}}},"400":{"description":"Bad Request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"403":{"description":"Forbidden","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"429":{"description":"Too Many Requests","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```
