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

# Schedule a CRM notification

`POST /api/notification-campaigns`

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

Stores a push notification for a group of patients, sent at scheduled_at by the per-minute scheduler (a time already past sends it at the next run). Filter audiences are resolved when it goes out.

## Request body

- CRMScheduleNotificationRequest: Request to schedule a CRM push notification. A time in the past, or now, sends it at the next scheduler run (within a minute).
  - `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).
  - `scheduled_at` string, date-time, required: When to send the notification (timezone-aware).
  - `title` string, required: Notification title.
  - `body` string, required: Notification text.
  - `notes` string, nullable: Internal note on why the notification is sent; shown in the CRM only.

## Response `201`

Successful Response

- CRMNotificationCampaignDetail: A notification's full definition, to show it and prefill the edit form.
  - `id` string, required: Campaign UUID.
  - `status` string, required: scheduled | sending | sent | failed | cancelled.
  - `scheduled_at` string, date-time, nullable: When it is, or was, scheduled to go out.
  - `title` string, required: Notification title.
  - `body` string, required: Notification text.
  - `notes` string, nullable: Internal note; CRM-only.
  - `audience_type` string, required: 'filters', 'csv' or 'users'.
  - `audience_size` integer, nullable: Addresses (csv) or patients (users) in an explicit audience; null for filters.
  - `resolved_count` integer, nullable: Patients in the audience when it was sent.
  - `reached_count` integer, nullable: Patients reached on at least one device.
  - `unreached_count` integer, nullable: Patients not reached.
  - `sent_at` string, date-time, nullable: When the send finished.
  - `error` string, nullable: Failure reason, if the send failed.
  - `created_by_name` string, nullable: Who created it, when known.
  - `created_at` string, date-time, required: When it was created.
  - `patient_states` string[]: Stato filters (filters only).
  - `registration_reasons` string[]: Motivo filters (filters only).
  - `filter_match` 'any' | 'all': How stato/motivo filters combine.
  - `recipient_emails` string[]: Uploaded addresses (csv only).
  - `user_ids` string[]: Selected patient user ids (users only).

## 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/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)
