API to send emails through campaigns: a campaign holds the template, subject and sender, and messages are sent to recipients with personalised data.
Here is the list of internal error codes, these errors only appear with an HTTP 500 status.
| Code | HTTP Status |
|---|---|
| EMA-1 | 500 |
| EMA-4 | 500 |
| EMA-10 | 500 |
| EMA-102 | 500 |
| EMA-103 | 500 |
| EMA-105 | 500 |
Here is the list of error codes
| Code | Description | HTTP Status |
|---|---|---|
| EMA-2 | Invalid route | 404 |
| EMA-3 | A parameter is missing or invalid in the request body (e.g., parameter sent as string instead of an integer) | 422 |
| EMA-5 | Missing token | 401 |
| EMA-6 | Invalid token signature | 400 |
| EMA-7 | Expired token | 400 |
| EMA-8 | Invalid token | 400 |
| EMA-9 | Unauthorized access to service (invalid token) | 403 |
| EMA-11 | Rate limit exceeded | 429 |
| EMA-12 | HTTP method not allowed for this route (e.g., POST instead of GET), see the Allow header |
405 |
| EMA-13 | Requested resource not found (e.g., unknown identifier) | 404 |
| EMA-101 | Failed to download the attachment | 422 |
| EMA-104 | Blocked campaign | 422 |
| EMA-106 | Invalid email address | 422 |
| EMA-107 | One or more provided message references are already used | 409 |
The API supports response localization based on the Accept-Language HTTP header.
Supported locales: en, fr. Defaults to en if the header is absent or contains an unsupported locale.
Every response (success or error) includes an x-request-id header containing a unique identifier for the request.
Please provide it when contacting support about a specific call.
All routes are subject to a rate limit (requests per minute). When the limit is exceeded, the API returns an HTTP 429 with error code EMA-11.
The response includes the following headers:
X-RateLimit-Limit: maximum number of requests allowed per minuteX-RateLimit-Remaining: number of requests remaining in the current windowRetry-After: seconds to wait before retryingGet API usages for a given period
| start_date required | string <date> Example: start_date=2024-01-01 |
| end_date required | string <date> Example: end_date=2024-01-31 |
| Accept-Language | string Example: fr Locale for response messages. Supported: |
{- "message": "The bearer token is missing",
- "code": "EMA-5"
}Delete a campaign.
| id required | integer Example: 123 Campaign identifier |
| Accept-Language | string Example: fr Locale for response messages. Supported: |
{- "message": "The bearer token is missing",
- "code": "EMA-5"
}Update an existing campaign. Only the provided fields are modified.
| id required | integer Example: 123 Campaign identifier |
| Accept-Language | string Example: fr Locale for response messages. Supported: |
Campaign fields to update
| template | string |
| subject | string |
| label | string |
| sender_email | string <email> |
| sender_name | string |
| reply_to | string <email> |
| callback_url | string or null <uri> |
| operator | string Enum: "CISS" "SENDGRID" |
{- "template": "<html><body>Hello {{ first_name }}</body></html>",
- "subject": "Special offer",
- "label": "May newsletter",
- "sender_email": "contact@example.com",
- "sender_name": "John Doe",
- "reply_to": "reply@example.com",
- "operator": "CISS"
}{ }Add one or more attachments to a campaign. They are sent with every message of the campaign.
| id required | integer Example: 123 Campaign identifier |
| Accept-Language | string Example: fr Locale for response messages. Supported: |
Attachments to add to the campaign
required | Array of objects |
{
}{- "campaign_id": 123
}Send one or more messages, each to its own recipient, using the template of the campaign. Each message can carry personalised data and optional attachments. Messages are sent asynchronously.
| id required | integer Example: 123 Campaign identifier |
| Accept-Language | string Example: fr Locale for response messages. Supported: |
Messages to send, with their recipient, personalised data and attachments (links)
required | Array of objects |
{- "messages": [
- {
- "reference": "0b6b9a0e-6f1c-4c2e-9d55-3f7c2f1a9b10",
- "recipient": "user@example.com",
- "data": {
- "first_name": "John"
}, - "subject": "Special offer",
- "sender_email": "contact@example.com",
- "sender_name": "John Doe",
}
]
}{- "campaign_id": 123,
- "references": [
- "0b6b9a0e-6f1c-4c2e-9d55-3f7c2f1a9b10"
]
}Check that an email address is well formatted and that its domain has a valid MX record.
| Accept-Language | string Example: fr Locale for response messages. Supported: |
Email address to validate
| email required | string <email> |
{- "email": "user@example.com"
}{- "message": "Valid email address."
}