API reference

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

MethodRouteWhat it doesLevelCommand
GET/crm/templatesEmail templates.readrivier campaigns template list
POST/crm/templatesSave an email template.writerivier campaigns template create

campaign

MethodRouteWhat it doesLevelCommand
GET/crm/campaignsCampaigns and newsletters.readrivier campaigns campaign list
POST/crm/campaignsCreate a campaign as a draft.writerivier campaigns campaign create
GET/crm/campaigns/{id}One campaign.readrivier campaigns campaign get
PATCH/crm/campaigns/{id}Change a campaign. Any change takes an approval away.writerivier campaigns campaign update
POST/crm/campaigns/{id}/draft-copyHave a model write the copy for a brief; it lands as an AI-written draft for review.writerivier campaigns campaign draft
GET/crm/campaigns/{id}/checkEverything that must be true before a send: identity, footer, content, audience, rule packs.readrivier campaigns campaign check
GET/crm/campaigns/{id}/previewThe message as one real recipient would receive it.readrivier campaigns campaign preview
POST/crm/campaigns/{id}/testSend a test to one of the project's own addresses.writerivier campaigns campaign test
POST/crm/campaigns/{id}/submitSubmit a draft for review.writerivier campaigns campaign submit
POST/crm/campaigns/{id}/sendSend now, or at a time. Needs a person's approval of this version unless the autonomy settings allow it for an audience this small.writerivier campaigns campaign send
POST/crm/campaigns/{id}/controlPause, resume or cancel.writerivier campaigns campaign control
GET/crm/campaigns/{id}/reportDelivered, bounced, complained, unsubscribed, clicked, by version of the message and by run.readrivier campaigns campaign report

approval

MethodRouteWhat it doesLevelCommand
POST/crm/approvals/campaigns/{id}A person approves exactly this version of a campaign.adminrivier campaigns approval approve
POST/crm/approvals/campaigns/{id}/declineA person sends a campaign back with the reason.adminrivier campaigns approval decline
POST/crm/approvals/flows/{id}A person approves a flow.adminrivier campaigns approval flow
POST/crm/approvals/sequences/{id}A person approves a sequence.adminrivier campaigns approval sequence
GET/crm/approvals/outreachOutreach messages waiting for a person to approve, with the wording the team member wrote.readrivier campaigns approval outreach list
POST/crm/approvals/outreach/{id}/approveA person approves an outreach message, optionally with their own subject and wording.adminrivier campaigns approval outreach approve
POST/crm/approvals/outreach/{id}/rejectA person turns an outreach message down with the reason; the person leaves the sequence.adminrivier campaigns approval outreach reject

flow

MethodRouteWhat it doesLevelCommand
GET/crm/flowsTriggered flows.readrivier campaigns flow list
POST/crm/flowsCreate a flow: a trigger and steps (wait, email, tag, condition).writerivier campaigns flow create
GET/crm/flows/{id}One flow.readrivier campaigns flow get
PUT/crm/flows/{id}Change a flow. A running flow is paused and needs approving again.writerivier campaigns flow update
POST/crm/flows/{id}/activateSwitch a flow on. It then sends by itself, so a person has approved it.writerivier campaigns flow activate
POST/crm/flows/{id}/pausePause a flow; people already in it wait.writerivier campaigns flow pause
GET/crm/flows/{id}/enrollmentsWho is in a flow and where.readrivier campaigns flow enrollments

sequence

MethodRouteWhat it doesLevelCommand
GET/crm/sequencesOutreach sequences: a short series of messages to prospects, written by a team member and approved by a person.readrivier campaigns sequence list
POST/crm/sequencesCreate 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.writerivier campaigns sequence create
GET/crm/sequences/{id}One sequence.readrivier campaigns sequence get
PUT/crm/sequences/{id}Change a sequence. A running sequence is paused and needs approving again.writerivier campaigns sequence update
POST/crm/sequences/{id}/activateSwitch a sequence on. A person has approved it first; each message then waits for approval unless the sequence sends by rule.writerivier campaigns sequence activate
POST/crm/sequences/{id}/pausePause a sequence; people already in it wait.writerivier campaigns sequence pause
POST/crm/sequences/{id}/enrollAdd 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.writerivier campaigns sequence enroll
GET/crm/sequences/{id}/enrollmentsWho is in a sequence, where each person is, and why a person left it.readrivier campaigns sequence enrollments
GET/crm/sequences/{id}/resultsResults of a sequence: sent, delivered, opened, clicked, replied, booked, bounced, unsubscribed, complained.readrivier campaigns sequence results

schedule

MethodRouteWhat it doesLevelCommand
GET/workspace/schedulesRecurring actions.readrivier campaigns schedule list
POST/workspace/schedulesRun an action on a cadence.writerivier campaigns schedule create
PATCH/workspace/schedules/{id}Pause, resume or change a schedule.writerivier campaigns schedule update
DELETE/workspace/schedules/{id}Delete a schedule.writerivier campaigns schedule delete

mail send

MethodRouteWhat it doesLevelCommand
POST/mail/sendSend 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.writerivier mail send

mail batch send

MethodRouteWhat it doesLevelCommand
POST/mail/send/batchSend 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.writerivier mail send-batch

mail message

MethodRouteWhat it doesLevelCommand
GET/mail/messagesMessages sent through the mail API, newest first, with their state. Filter by state, address, batch or tag.readrivier 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.readrivier mail message
POST/mail/messages/{id}/cancelCancel a scheduled or queued message before it leaves.writerivier mail cancel
POST/mail/messages/{id}/resendSend a failed message again. When the earlier outcome is unknown (the connection ended mid-send) you must confirm it was not delivered.writerivier mail resend

mail batch

MethodRouteWhat it doesLevelCommand
POST/mail/batches/{id}/cancelCancel every message of a batch that has not left yet.writerivier mail cancel-batch

mail template

MethodRouteWhat it doesLevelCommand
GET/mail/templatesThe email template library: the project's own templates and its organization's shared ones.readrivier mail templates
GET/mail/templates/{id}One template with its versions, the variables it reads and its test data.readrivier mail template
POST/mail/templatesCreate an email template. Variables {{name}} and {{name|fallback}}, conditionals {{#if}} {{else}}, loops {{#each}} and partials {{> name}}; values are escaped for HTML.writerivier mail template-create
PUT/mail/templates/{id}Change a template. This saves a new version; earlier versions stay and can be restored.writerivier mail template-update
DELETE/mail/templates/{id}Archive a template. Messages already queued keep their content.writerivier mail template-archive
POST/mail/templates/{id}/restoreMake an earlier version current again, as a new version.writerivier mail template-restore

mail preview

MethodRouteWhat it doesLevelCommand
POST/mail/templates/previewRender 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.readrivier mail preview

mail group

MethodRouteWhat it doesLevelCommand
GET/mail/groupsUnsubscribe groups: what a recipient can opt out of without leaving everything.readrivier mail groups
POST/mail/groupsCreate or change an unsubscribe group. The group is the consent purpose email.<id>, so the preference page and one-click unsubscribe already honour it.writerivier mail group-save
DELETE/mail/groups/{id}Remove an unsubscribe group (not the project's default).writerivier mail group-remove

mail settings

MethodRouteWhat it doesLevelCommand
GET/mail/settingsThe project's mail API settings: rate limit, tracking defaults, default group, transport choice and retention.readrivier mail settings
PUT/mail/settingsChange 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.writerivier mail settings-update

mail validation

MethodRouteWhat it doesLevelCommand
POST/mail/validateCheck one address or up to 100: syntax, a mail server for the domain, throwaway providers, role mailboxes and common typos. Nothing is sent.readrivier mail validate

mail smtp

MethodRouteWhat it doesLevelCommand
GET/mail/smtpHow to send through SMTP: whether the relay is on, the host and ports, and the project's credentials (never their secrets).readrivier mail smtp

mail smtp credential

MethodRouteWhat it doesLevelCommand
POST/mail/smtp/credentialsCreate an SMTP credential. The secret is shown once, in this answer only.adminrivier mail smtp-create
DELETE/mail/smtp/credentials/{id}Revoke an SMTP credential.adminrivier mail smtp-revoke

mail route

MethodRouteWhat it doesLevelCommand
GET/mail/inbound/routesInbound routes: which domains and addresses deliver received mail to the project's webhooks.readrivier mail routes
POST/mail/inbound/routesReceive mail for a domain or address of the project as parsed JSON on its webhook endpoints (event mail.inbound).adminrivier mail route-create
DELETE/mail/inbound/routes/{id}Stop receiving mail on a route.adminrivier mail route-remove

mail inbound

MethodRouteWhat it doesLevelCommand
GET/mail/inbound/messagesMessages received through inbound routes, with the state of their webhook delivery.readrivier mail inbound
POST/mail/inbound/ingestHand 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.adminrivier mail ingest
POST/mail/inbound/messages/{id}/replayDeliver a received message to the webhook endpoints again.adminrivier mail inbound-replay