Skip to main content
Courier is one REST API: send messages, build journeys, manage templates and brands, and read delivery logs. Anything you can do in the console, you can do through the API. Every endpoint is listed in the sidebar, starting with POST /send. The conventions below apply to all of them.
  • New to Courier? Send your first notification with the Quickstart.
  • Building with Claude Code, Codex, or Cursor? Connect Courier over MCP or the CLI. Start with AI onboarding.
  • Prefer a GUI? Explore every endpoint in the Postman collection.

Client libraries

Server SDKs wrap this API with typed methods, retries, and idempotency helpers. Prefer them over raw HTTP. Each page carries the install command and the current version.

Node.js

Python

Ruby

Go

Java

PHP

C# / .NET

Client SDKs embed prebuilt UI instead of calling this API directly: an in-app notification center and a preference center. See all SDKs for the nine client platforms.

Authentication

Pass your API key as a bearer token in the Authorization header:
Requests without a valid key return 401 Unauthorized. Keys are scoped to one environment, such as Test or Production, so a Test key only reads and writes Test data. Create and rotate keys in Platform → API Keys.
Your API key is a secret. Use it only in server-side code, never in a browser, mobile app, or committed source. To authenticate a client for Inbox or preferences, issue a short-lived user token.

Requests and responses

  • All requests and responses use JSON. Send Content-Type: application/json on requests with a body.
  • Message timestamps are Unix epoch milliseconds (int64). Broadcasts and journey runs return ISO 8601 strings, so check each endpoint’s schema before you parse a date.
  • Send responses return a requestId. Use it to look up a message or trace delivery in Message Logs.

Payload limits

Request bodies cap at 6 MB, except the tenant and digest endpoints (/tenants/* and /digests/*), which cap at 1 MB. Larger requests return 413 Payload Too Large. Base64 content, such as inline attachments, inflates size by roughly 33%. A 6 MB payload holds about 4.5 MB of raw attachment data. For anything larger, host the file and pass a URL.

Idempotency

Send an idempotency key to retry safely without sending duplicates. Use a unique value, such as a UUID, per logical request, and reuse it when you retry. Server SDKs take it as a parameter and set the Idempotency-Key header for you.
Courier caches the first response for that key, including its status code and any error, and replays it on retries. The request runs only once. A key is scoped to the endpoint it was sent to. The stored key is the value plus the request path, so the same key sent to two endpoints is two independent keys. Generate one per call you want deduplicated, not one per logical operation spanning several calls. Idempotency applies to POST only. Sending the header on any other method is accepted and does nothing, because the other methods are already idempotent by definition. Endpoints that support it declare Idempotency-Key among their parameters. They include POST /send, POST /journeys/{templateId}/invoke, POST /profiles/{user_id}, and POST /users/{user_id}/preferences.

Retry a request safely

A retry with the same key gets the stored response, so only a request that never stored one runs again. Retry with the same key after:
  • A connection error or a timeout. The request may never have reached Courier.
  • 409 Conflict. Courier holds a key for 60 seconds while its first request runs, or after that request stopped without answering. A retry inside that window gets 409 with a Retry-After header, so wait that long first.
  • 429 Too Many Requests. On an endpoint with a rate limit, a 429 is answered before the request runs, so Courier stores nothing, but the key stays held for the same 60 seconds.
Don’t retry any other 4xx or 5xx with the same key. Courier stored that answer and returns it again for the key’s lifetime. Fix the cause, then send with a new key. Start a job queue’s retries at 60 seconds. Server SDKs already retry connection errors, 408, 409, 429, and 5xx twice, and they wait out Retry-After. A call made while a person waits can block for up to two minutes, so set the SDK’s max retries to 0 there and retry from a queue.

How long a response is replayed

Courier replays a response for 25 hours by default. To change that, send x-idempotency-expiration with the number of seconds to keep the key, such as 604800 for one week. The maximum is one year (31536000). Send seconds, not a date. A value Courier can’t parse returns 400 Expiration is not a valid date.

Pagination

List endpoints use cursor-based pagination. Every response includes a paging object with a more boolean and a cursor:
When paging.more is true, pass paging.cursor back as the cursor query parameter to fetch the next page:
The data array field name varies by endpoint. GET /messages returns results, while GET /lists and GET /audiences return items. Check the endpoint’s own schema before you parse it.

Errors

Courier uses standard HTTP status codes. 2xx is success, 4xx is a problem with your request, and 5xx is a Courier-side error. Error responses include a JSON body with a human-readable message and a machine-readable type:

Message statuses

A 202 from POST /send means Courier accepted the request, not that the message was delivered. Track the outcome with GET /messages/{message_id}, which returns one of these statuses: ENQUEUED, ROUTED, SENT, DELIVERED, OPENED, CLICKED, DELAYED, DIGESTED, THROTTLED, FILTERED, CANCELED, SIMULATED, and three failure states:
  • UNROUTABLE: no channel could be resolved (missing provider, or no channel data on the profile)
  • UNDELIVERABLE: the provider rejected the recipient (invalid address or blocked domain)
  • UNMAPPED: the referenced template couldn’t be found
Failed messages also carry a reason, such as BOUNCED, NO_PROVIDERS, OPT_IN_REQUIRED, or UNSUBSCRIBED.

Rate limits

POST /send is not rate-limited by request count, so you can send at volume. Instead, the send limits you configure per user, topic, or tenant govern message volume. Four management endpoints are limited per workspace: Endpoints not listed here aren’t request-count limited today. Responses from the lists, user preferences, and resend endpoints carry X-RateLimit-Limit, the requests allowed in the window, and X-RateLimit-Remaining, the requests you have left. Exceeding a limit returns 429 Too Many Requests.

FAQ

Anything you can do in the Courier console. Send notifications across email, SMS, push, chat, and in-app, and manage user profiles, preferences, lists, templates, brands, and tenants.
Requests go to https://api.courier.com over HTTPS, or to https://api.eu.courier.com for notifications you send through the EU datacenter.
Pass your API key as a bearer token in the Authorization header: Authorization: Bearer YOUR_COURIER_API_KEY. Keys are scoped per environment (such as Test or Production) and used only in server-side code.
Courier maintains official server SDKs for Node.js, Python, Ruby, Go, Java, PHP, and C# / .NET, plus client SDKs for React, Vue, Angular, Web Components, JavaScript, React Native, iOS, Android, and Flutter. Any language can call the REST API directly.
POST /send isn’t limited by request count. Four management endpoints are limited per workspace, and Rate limits lists each limit. Exceeding a limit returns 429 Too Many Requests.
Set an Idempotency-Key header with a unique value. Courier replays the original response for 25 hours, so a retried request runs only once.