crm-email

Edit a scheduled CRM email campaign

Admin-only endpoint. Fully replaces a still-scheduled campaign's definition.

patch/api/campaigns/{campaign_id}

Path parameters

campaign_idstring uuid required

Campaign UUID

Campaign UUID

Request body

scheduled_atstring date-time required

When to send the campaign (timezone-aware).

subjectstring required

Email subject.

notesstring nullable

Internal note on why the campaign is being sent; shown in the CRM only, never emailed.

email_htmlstring nullable

Composed HTML body (image placeholders already replaced by URLs).

template_pathstring nullable

Storage path of the uploaded template under public/email/templates/.

placeholder_imagesobject

Map of placeholder name -> image public URL used to compose email_html.

patient_statesstring[]

Stato paziente filters. Combined with registration_reasons per filter_match at send time.

patient_filtersstring[]

Deprecated alias of patient_states (kept for the current frontend payload).

registration_reasonsstring[]

Motivo iscrizione filters. Combined with patient_states per filter_match at send time.

filter_match'any' | 'all'

How stato and motivo filters combine at send time: 'any' (OR, default) unions them; 'all' (AND) keeps only patients matching both a selected stato and motivo.

recipient_emailsstring[]

Explicit recipient email addresses (e.g. from an uploaded CSV). When present the campaign audience is this list. Capped at 50000 addresses.

Response

Successful Response

idstring required

Campaign UUID.

statusstring required

scheduled | sending | sent | failed | cancelled.

scheduled_atstring date-time nullable

When the campaign is/was scheduled to send.

subjectstring required

Email subject.

notesstring nullable

Internal note on why the campaign was sent; CRM-only.

email_htmlstring nullable

Composed HTML body (placeholders already replaced by URLs).

template_pathstring nullable

Storage path of the uploaded template, if any.

placeholder_imagesobject

Map of placeholder name -> image public URL used to compose email_html.

audience_typestring required

'filters' or 'csv'.

patient_statesstring[]

Stato paziente filters (empty for a csv audience).

registration_reasonsstring[]

Motivo iscrizione filters (empty for a csv audience).

filter_match'any' | 'all'

How stato/motivo filters combine ('any' or 'all').

recipient_emailsstring[]

Explicit recipient emails (only for a csv audience).

created_atstring date-time required

When the campaign was created.

Changes

No recorded changes to this endpoint across all 1 revision of this API.