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

# Create an audience

`POST /audiences`

## Request

- Base URL: `https://api.mailly.site` (the document declares no server; this is the origin it was published from)
- URL: `https://api.mailly.site/audiences`
- Auth: HTTP bearer

type=static may include members (external contact IDs, up to 1000); type=dynamic requires filter.

## Request body

- object
  - `key` string: stable key
  - `name` string
  - `description` string
  - `type` 'static' | 'dynamic'
  - `filter` object: Filter for dynamic audiences
  - `members` string[]: External contact IDs (static only)

## Response `201`

Created

- object
  - `success` boolean, required
  - `audience` object, required
  - `memberCount` number, required

## Other responses

- `400`: Invalid parameters
- `401`: Missing or invalid API key
- `404`: Member contact not found
- `409`: Key already exists

---

[API](https://skmtc.dev/mailly/apis/mailly-api.md) · [All operations](https://skmtc.dev/mailly/apis/mailly-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mailly/apis/mailly-api/revisions/1ceb29637301?raw)
