The Courier REST API provides several endpoints that allow your application to send messages, request details about an individual message, and manage profile and preference information for each recipient in your audience.
If you're new to Courier, you can also follow one of our Getting Started with Courier Guides to send your first message.
The Courier REST API supports both token and basic authorization
Courier assigns you a "Courier Auth Token" when you Register your account.
This token should be passed as a
Bearer Token in an
Authorization header with each request. Remember, it is best not to store an authorization token in your source control but instead reference values stored in environment variables or some other configuration. However you handle your tokens, be sure to keep them private and secure.
curl --request POST \ --url https://api.trycourier.app/send \ --header 'Authorization: Bearer <token>' \
Basic Auth works by passing a username and password in an
atob() functions to Base64 encode and decode respectively.
A username of "email@example.com" and password of "examplepassword1234" are concatenated to "firstname.lastname@example.org:examplepassword1234". This concatenated string becomes "ZXhhbXBsZUBleGFtcGxlLmNvbTpleGFtcGxlcGFzc3dvcmQxMjM0" once it is Base64 encoded.
To authenticate with the Courier REST API, use the email associated with your account as the username and the "Courier Auth Token" as your password.
curl --request POST \ --url https://api.trycourier.app/send \ --header 'Authorization: Basic <Base64 encoded string>' \