Campaigns and mail
Campaigns, flows, schedules, templates and the mail sending API.
Scopes for this area: campaigns:read, campaigns:write and campaigns:admin.
66 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 |
notify push
| Method | Route | What it does | Level | Command |
|---|---|---|---|---|
| GET | /notify/push/key | The public key a page passes to pushManager.subscribe as applicationServerKey. | read | rivier campaigns notify push key |
| POST | /notify/push/subscriptions | Keep a browser's push subscription under your own id for the person. Only the browsers' push services are accepted as endpoints. | write | rivier campaigns notify push subscribe |
| GET | /notify/push/subscriptions | A person's push subscriptions, with when each last took a push and whether it has ended. | read | rivier campaigns notify push list |
| DELETE | /notify/push/subscriptions/{id} | Forget a push subscription. | write | rivier campaigns notify push remove |
| POST | /notify/push/send | Push a notice to a person's browsers (or one subscription): title, body, an address to open, a tag that replaces an earlier notice. A subscription the push service says has ended is marked and raised as campaigns.push.expired. | write | rivier campaigns notify push send |
notify feed
| Method | Route | What it does | Level | Command |
|---|---|---|---|---|
| POST | /notify/feed | Put a notice in a person's in-app feed. | write | rivier campaigns notify feed add |
| GET | /notify/feed | A person's notices, newest first, with the unread count. | read | rivier campaigns notify feed list |
| POST | /notify/feed/read | Mark some or all of a person's notices read. | write | rivier campaigns notify feed read |
| DELETE | /notify/feed/{id} | Remove one notice from a feed. | write | rivier campaigns notify feed remove |
notify template
| Method | Route | What it does | Level | Command |
|---|---|---|---|---|
| GET | /notify/templates | The project's notification template sets, with their languages. | read | rivier campaigns notify template list |
| GET | /notify/templates/{name} | One template set: its fallback language and the words of each channel in each language. | read | rivier campaigns notify template get |
| PUT | /notify/templates/{name} | Create or replace a template set: one name, a fallback language, and per language the push and feed title and body, the mail subject and body, a text, and the approved WhatsApp template with the data keys that fill it. | write | rivier campaigns notify template put |
| DELETE | /notify/templates/{name} | Remove a template set. | write | rivier campaigns notify template remove |
| POST | /notify/templates/{name}/render | The words a template set gives in a language for some data: the asked language, then its base language, then the fallback; names with no value are listed. | read | rivier campaigns notify template render |
notify prefs
| Method | Route | What it does | Level | Command |
|---|---|---|---|---|
| GET | /notify/preferences/{userRef} | A person's notification choices: channel order, address, number, language, muted categories, and whether the feed is on. | read | rivier campaigns notify prefs get |
| PUT | /notify/preferences/{userRef} | Set a person's notification choices. | write | rivier campaigns notify prefs put |
notify
| Method | Route | What it does | Level | Command |
|---|---|---|---|---|
| POST | /notify/send | Tell a person something: it goes in their feed, then each channel in their order (push, email, text, WhatsApp) is tried until one carries it, falling back when one fails. A template set chooses the words in their language. The same idempotency key sends once. | write | rivier campaigns notify send |
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 groups them. | 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 settings
| Method | Route | What it does | Level | Command |
|---|---|---|---|---|
| GET | /mail/settings | The project's mail API settings: rate limit, tracking defaults, 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 only when the transport gate allows it. | write | rivier mail settings-update |