Campaigns and mail
Campaigns, flows, schedules, templates and the mail sending API.
Scopes for this area: campaigns:read, campaigns:write and campaigns:admin.
70 operations
template
| Method | Route | What it does | Level | Command |
|---|---|---|---|---|
| GET | /crm/templates | Email templates. | read | rivier campaigns template list |
| POST | /crm/templates | Save an email template. | write | rivier campaigns template create |
campaign
| Method | Route | What it does | Level | Command |
|---|---|---|---|---|
| GET | /crm/campaigns | Campaigns and newsletters. | read | rivier campaigns campaign list |
| POST | /crm/campaigns | Create a campaign as a draft. | write | rivier campaigns campaign create |
| GET | /crm/campaigns/{id} | One campaign. | read | rivier campaigns campaign get |
| PATCH | /crm/campaigns/{id} | Change a campaign. Any change takes an approval away. | write | rivier campaigns campaign update |
| POST | /crm/campaigns/{id}/draft-copy | Have a model write the copy for a brief; it lands as an AI-written draft for review. | write | rivier campaigns campaign draft |
| GET | /crm/campaigns/{id}/check | Everything that must be true before a send: identity, footer, content, audience, rule packs. | read | rivier campaigns campaign check |
| GET | /crm/campaigns/{id}/preview | The message as one real recipient would receive it. | read | rivier campaigns campaign preview |
| POST | /crm/campaigns/{id}/test | Send a test to one of the project's own addresses. | write | rivier campaigns campaign test |
| POST | /crm/campaigns/{id}/submit | Submit a draft for review. | write | rivier campaigns campaign submit |
| POST | /crm/campaigns/{id}/send | Send now, or at a time. Needs a person's approval of this version unless the autonomy settings allow it for an audience this small. | write | rivier campaigns campaign send |
| POST | /crm/campaigns/{id}/control | Pause, resume or cancel. | write | rivier campaigns campaign control |
| GET | /crm/campaigns/{id}/report | Delivered, bounced, complained, unsubscribed, clicked, by version of the message and by run. | read | rivier campaigns campaign report |
approval
| Method | Route | What it does | Level | Command |
|---|---|---|---|---|
| POST | /crm/approvals/campaigns/{id} | A person approves exactly this version of a campaign. | admin | rivier campaigns approval approve |
| POST | /crm/approvals/campaigns/{id}/decline | A person sends a campaign back with the reason. | admin | rivier campaigns approval decline |
| POST | /crm/approvals/flows/{id} | A person approves a flow. | admin | rivier campaigns approval flow |
| POST | /crm/approvals/sequences/{id} | A person approves a sequence. | admin | rivier campaigns approval sequence |
| GET | /crm/approvals/outreach | Outreach messages waiting for a person to approve, with the wording the team member wrote. | read | rivier campaigns approval outreach list |
| POST | /crm/approvals/outreach/{id}/approve | A person approves an outreach message, optionally with their own subject and wording. | admin | rivier campaigns approval outreach approve |
| POST | /crm/approvals/outreach/{id}/reject | A person turns an outreach message down with the reason; the person leaves the sequence. | admin | rivier campaigns approval outreach reject |
flow
| Method | Route | What it does | Level | Command |
|---|---|---|---|---|
| GET | /crm/flows | Triggered flows. | read | rivier campaigns flow list |
| POST | /crm/flows | Create a flow: a trigger and steps (wait, email, tag, condition). | write | rivier campaigns flow create |
| GET | /crm/flows/{id} | One flow. | read | rivier campaigns flow get |
| PUT | /crm/flows/{id} | Change a flow. A running flow is paused and needs approving again. | write | rivier campaigns flow update |
| POST | /crm/flows/{id}/activate | Switch a flow on. It then sends by itself, so a person has approved it. | write | rivier campaigns flow activate |
| POST | /crm/flows/{id}/pause | Pause a flow; people already in it wait. | write | rivier campaigns flow pause |
| GET | /crm/flows/{id}/enrollments | Who is in a flow and where. | read | rivier campaigns flow enrollments |
sequence
| Method | Route | What it does | Level | Command |
|---|---|---|---|---|
| GET | /crm/sequences | Outreach sequences: a short series of messages to prospects, written by a team member and approved by a person. | read | rivier campaigns sequence list |
| POST | /crm/sequences | Create a sequence: who it is for, a team member, and steps (email, text, WhatsApp, call) with the days to wait before each. The team member writes each message from the step's brief. | write | rivier campaigns sequence create |
| GET | /crm/sequences/{id} | One sequence. | read | rivier campaigns sequence get |
| PUT | /crm/sequences/{id} | Change a sequence. A running sequence is paused and needs approving again. | write | rivier campaigns sequence update |
| POST | /crm/sequences/{id}/activate | Switch a sequence on. A person has approved it first; each message then waits for approval unless the sequence sends by rule. | write | rivier campaigns sequence activate |
| POST | /crm/sequences/{id}/pause | Pause a sequence; people already in it wait. | write | rivier campaigns sequence pause |
| POST | /crm/sequences/{id}/enroll | Add prospects to a sequence. Anyone who is suppressed, erased, without an address for the first step, or without a recorded basis for being written to is skipped, with the reason. | write | rivier campaigns sequence enroll |
| GET | /crm/sequences/{id}/enrollments | Who is in a sequence, where each person is, and why a person left it. | read | rivier campaigns sequence enrollments |
| GET | /crm/sequences/{id}/results | Results of a sequence: sent, delivered, opened, clicked, replied, booked, bounced, unsubscribed, complained. | read | rivier campaigns sequence results |
schedule
| Method | Route | What it does | Level | Command |
|---|---|---|---|---|
| GET | /workspace/schedules | Recurring actions. | read | rivier campaigns schedule list |
| POST | /workspace/schedules | Run an action on a cadence. | write | rivier campaigns schedule create |
| PATCH | /workspace/schedules/{id} | Pause, resume or change a schedule. | write | rivier campaigns schedule update |
| DELETE | /workspace/schedules/{id} | Delete a schedule. | write | rivier campaigns schedule delete |
mail send
| Method | Route | What it does | Level | Command |
|---|---|---|---|---|
| POST | /mail/send | Send a transactional email (one message per recipient). Use an Idempotency-Key (header or idempotencyKey) so a retry sends once; sandbox: true checks and renders without sending. Refuses suppressed addresses with a structured error. Mail goes out through the project's chosen transport once consent, quiet rules, test mode and the plan's limit allow it. | write | rivier mail send |
mail batch send
| Method | Route | What it does | Level | Command |
|---|---|---|---|---|
| POST | /mail/send/batch | Send up to 500 different messages in one request. Each item is accepted or rejected on its own; the answer has one result per item and a batchId that cancels the whole batch while it waits. | write | rivier mail send-batch |
mail message
| Method | Route | What it does | Level | Command |
|---|---|---|---|---|
| GET | /mail/messages | Messages sent through the mail API, newest first, with their state. Filter by state, address, batch or tag. | read | rivier mail messages |
| GET | /mail/messages/{id} | One message with its content and the timeline of what happened to it (queued, sent, delivered, bounced, opened, clicked) and the transport that carried it, with the reason when it was not the one asked for. | read | rivier mail message |
| POST | /mail/messages/{id}/cancel | Cancel a scheduled or queued message before it leaves. | write | rivier mail cancel |
| POST | /mail/messages/{id}/resend | Send a failed message again. When the earlier outcome is unknown (the connection ended mid-send) you must confirm it was not delivered. | write | rivier mail resend |
mail batch
| Method | Route | What it does | Level | Command |
|---|---|---|---|---|
| POST | /mail/batches/{id}/cancel | Cancel every message of a batch that has not left yet. | write | rivier mail cancel-batch |
mail template
| Method | Route | What it does | Level | Command |
|---|---|---|---|---|
| GET | /mail/templates | The email template library: the project's own templates and its organization's shared ones. | read | rivier mail templates |
| GET | /mail/templates/{id} | One template with its versions, the variables it reads and its test data. | read | rivier mail template |
| POST | /mail/templates | Create an email template. Variables {{name}} and {{name|fallback}}, conditionals {{#if}} {{else}}, loops {{#each}} and partials {{> name}}; values are escaped for HTML. | write | rivier mail template-create |
| PUT | /mail/templates/{id} | Change a template. This saves a new version; earlier versions stay and can be restored. | write | rivier mail template-update |
| DELETE | /mail/templates/{id} | Archive a template. Messages already queued keep their content. | write | rivier mail template-archive |
| POST | /mail/templates/{id}/restore | Make an earlier version current again, as a new version. | write | rivier mail template-restore |
mail preview
| Method | Route | What it does | Level | Command |
|---|---|---|---|---|
| POST | /mail/templates/preview | Render a template (or inline content) with data exactly as a send would, and list the variables it asked for that the data did not carry. Sends and stores nothing. | read | rivier mail preview |
mail group
| Method | Route | What it does | Level | Command |
|---|---|---|---|---|
| GET | /mail/groups | Unsubscribe groups: what a recipient can opt out of without leaving everything. | read | rivier mail groups |
| POST | /mail/groups | Create or change an unsubscribe group. The group is the consent purpose email.<id>, so the preference page and one-click unsubscribe already honour it. | write | rivier mail group-save |
| DELETE | /mail/groups/{id} | Remove an unsubscribe group (not the project's default). | write | rivier mail group-remove |
mail settings
| Method | Route | What it does | Level | Command |
|---|---|---|---|---|
| GET | /mail/settings | The project's mail API settings: rate limit, tracking defaults, default group, transport choice and retention. | read | rivier mail settings |
| PUT | /mail/settings | Change the project's mail API settings. Choosing the own MTA does not switch it on: it is used for a domain only after the deliverability checks pass. | write | rivier mail settings-update |
mail validation
| Method | Route | What it does | Level | Command |
|---|---|---|---|---|
| POST | /mail/validate | Check one address or up to 100: syntax, a mail server for the domain, throwaway providers, role mailboxes and common typos. Nothing is sent. | read | rivier mail validate |
mail smtp
| Method | Route | What it does | Level | Command |
|---|---|---|---|---|
| GET | /mail/smtp | How to send through SMTP: whether the relay is on, the host and ports, and the project's credentials (never their secrets). | read | rivier mail smtp |
mail smtp credential
| Method | Route | What it does | Level | Command |
|---|---|---|---|---|
| POST | /mail/smtp/credentials | Create an SMTP credential. The secret is shown once, in this answer only. | admin | rivier mail smtp-create |
| DELETE | /mail/smtp/credentials/{id} | Revoke an SMTP credential. | admin | rivier mail smtp-revoke |
mail route
| Method | Route | What it does | Level | Command |
|---|---|---|---|---|
| GET | /mail/inbound/routes | Inbound routes: which domains and addresses deliver received mail to the project's webhooks. | read | rivier mail routes |
| POST | /mail/inbound/routes | Receive mail for a domain or address of the project as parsed JSON on its webhook endpoints (event mail.inbound). | admin | rivier mail route-create |
| DELETE | /mail/inbound/routes/{id} | Stop receiving mail on a route. | admin | rivier mail route-remove |
mail inbound
| Method | Route | What it does | Level | Command |
|---|---|---|---|---|
| GET | /mail/inbound/messages | Messages received through inbound routes, with the state of their webhook delivery. | read | rivier mail inbound |
| POST | /mail/inbound/ingest | Hand a received message to the parser (the mail platform does this for each message it receives for a routed domain). Send JSON with the raw message, or the message itself as message/rfc822. | admin | rivier mail ingest |
| POST | /mail/inbound/messages/{id}/replay | Deliver a received message to the webhook endpoints again. | admin | rivier mail inbound-replay |