---
title: "Preview audience resolution"
method: POST
path: "/audiences/preview"
tags: ["audiences"]
---

# Preview audience resolution

`POST /audiences/preview`

## 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/preview`
- Auth: HTTP bearer

Resolves an {audiences, contacts, exclude…} selection without saving it and returns the count and a sample.

## Request body

- object
  - `include` object
  - `exclude` object
  - `contacts` string[]
  - `audiences` string[]
  - `sampleLimit` number: Sample size, default 20, max 100

## Response `200`

Resolution result

- object
  - `success` boolean, required
  - `selection` object, required
  - `count` number, required
  - `sample` object[], required
  - `directRecipientCount` number
  - `includedContactCount` number
  - `excludedContactCount` number
  - `audiences` object[]

## Other responses

- `400`: Invalid selection
- `401`: Missing or invalid API key
- `404`: Referenced audience not found

---

[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)
