---
title: "Preview a CRM notification audience"
method: POST
path: "/api/notification-campaigns/preview"
tags: ["crm-notifications"]
---

# Preview a CRM notification audience

`POST /api/notification-campaigns/preview`

## Request

- Base URL: `https://api.corabea.it` (the document declares no server; this is the origin it was published from)
- URL: `https://api.corabea.it/api/notification-campaigns/preview`
- Auth: HTTP bearer

Counts the patients an audience holds now (commercial-communications opt-outs excluded) and how many of them have an active device to reach.

## Request body

- CRMNotificationAudiencePreviewRequest: Request to count how many patients an audience holds, and how many can be reached.
  - `patient_states` string[]: Stato paziente filters, the same values as the CRM emails.
  - `registration_reasons` string[]: Motivo iscrizione filters (users.registration_reason).
  - `filter_match` 'any' | 'all': How stato and motivo filters combine: 'any' (OR, default) or 'all' (AND).
  - `recipient_emails` string[]: Explicit recipient email addresses (e.g. an uploaded CSV); addresses with no account are skipped.
  - `user_ids` string[]: Explicit patient user ids (e.g. the filtered CRM patient list).

## Response `200`

Successful Response

- CRMNotificationAudiencePreviewResponse: Size of an audience as it would be resolved now.
  - `recipient_count` integer, required: Patients in the audience, commercial-communications opt-outs excluded (CSV: only the addresses that belong to an account).
  - `reachable_count` integer, required: Of those, the patients with at least one active device for push.

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-15** `f32c7ff0d5a0`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/corabea/apis/corabea-api/changes/api/notification-campaigns/preview/post.md)

---

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