Skip to main content
The Campaigns REST API is the server-side surface of the product. It covers transactional sends, template and channel look-ups, and admin operations on the notification feed. All endpoints share a single response envelope, a single error envelope, and a single authentication model.

Base URL

Regions: us, eu, in. Replace {appId} with your application ID. See Setup & Authentication for credentials and headers.

Response envelope

Success

Single-entity responses wrap the resource under data:
Paginated lists return an array under data and cursor metadata under meta:
Pagination is cursor-based. Pass affix, sentAt (or the configured sort field), and id from meta.next back into the next request to page forward.

Error envelope (canonical)

Every non-2xx response from the Campaigns service uses exactly this shape, wrapped under error:
FieldConvention
codeAlways ERR_-prefixed, SCREAMING_SNAKE. Domain codes (ERR_TEMPLATE_NOT_FOUND) and framework codes (ERR_VALIDATION, ERR_UNAUTHORIZED) share the prefix.
messageUser-facing, identifier-free, safe to render in a UI. Never carries IDs or PII.
devMessageDeveloper-facing. Carries identifiers and extra context for debugging. Defaults to message when omitted.
detailsStructured drill-down. Object for domain errors ({ "channelId": "feed-1" }); array of strings for validation failures (one per failed field).
sourceAlways "campaigns-service". Lets gateway-fronted callers attribute failures when multiple services share the gateway.
Unhandled internal errors fail closed; no stack trace or internal detail leaks:

Error code reference

Non-exhaustive. These are the codes a typical caller will encounter.
ClassCodes
DomainERR_TEMPLATE_NOT_FOUND, ERR_CHANNEL_NOT_FOUND, ERR_FEED_ITEM_NOT_FOUND
FrameworkERR_VALIDATION (400), ERR_UNAUTHORIZED (401), ERR_NOT_FOUND (404), ERR_CONFLICT (409), ERR_TOO_MANY_REQUESTS (429), ERR_BAD_REQUEST (4xx fallback), ERR_INTERNAL (500)

Variable resolution

Within template content, variables are referenced with {{variableKey}} syntax (for example Hi {{user_name}}, your order #{{order_id}} shipped) and resolved at send-time. For templated sends and campaign deliveries, three sources contribute to the final value substituted into channel content. Higher rows win:
PrioritySourceWhere it lives
1 (highest)Per-user variablesThe variables map on a transactional send request, or per-row from a campaign’s CSV import
2Campaign-level defaultsThe campaign’s config.variables
3Template variable-schema defaultsThe template’s variableSchema[].default field
If none of the three has a value, the token is left unresolved ({{key}}) in the rendered output.