Endpoint: v1/emails
Send a transactional email with optional template, attachments, and variables
API key with format "Bearer {your-api-key}"
Sender email address. Must be in one of these formats:
"Name" <[email protected]>Name <[email protected]>[email protected]100"Your Name <[email protected]>"
Recipient email addresses. Maximum 50 recipients allowed.
Email subject line
100"Welcome to Our Service!"
HTML content of the email. Required if template_id is not provided.
template_id"<p>Hello {{name}}!</p>"
ID of the email template. Required if html is not provided.
html"welcome-template"
Plain text version of the email. Maximum size 10MB.
"Hello {{name}}!"
CC recipient addresses. Maximum 50 recipients allowed.
BCC recipient addresses. Maximum 50 recipients allowed.
Reply-to addresses. Maximum 50 recipients allowed.
Template variables for personalization. Maximum 100 properties allowed.
Variables are referenced in templates using double curly braces: {{variable_name}}
Note: When using templates with variables (e.g., {{variable_name}}):
Each variable can be:
value: string, number, or nulldefault: string or number (used when value is null){
"date": "27 November",
"plan": {
"value": "Pro Plan",
"default": "Free Plan"
},
"company": { "value": null, "default": "our company" },
"title": {
"value": null,
"default": "valued customer"
}
}File attachments. You can attach files using either base64 encoded content or a URL path.
Limits:
filename (required)path OR content (one must be provided)content_type (optional, but highly recommended)
application/octet-streamTip: You can upload files through the "Assets" in the template page. These files will be served through our CDN, ensuring they are cached and optimized for delivery.
Example using base64 content:
{
"attachments": [{
"filename": "document.pdf",
"content": "base64EncodedString==",
"content_type": "application/pdf"
}]
}Example using URL path:
{
"attachments": [{
"filename": "document.pdf",
"path": "https://example.com/files/document.pdf",
"content_type": "application/pdf"
}]
}Example with multiple attachments:
{
"attachments": [
{
"filename": "document.pdf",
"content": "base64EncodedString==",
"content_type": "application/pdf"
},
{
"filename": "image.jpg",
"path": "https://example.com/files/image.jpg",
"content_type": "image/jpeg"
}
]
}Common errors:
"Too many attachments: 11. Max is 10""Total attachments size exceeds maximum of 40MB""attachments[0].filename is required""attachments[0] must have either path or content""attachments[0].path must be a valid URL""attachments[0].content must be a valid base64 encoded string"10Email successfully queued for sending
Unique identifier for the sent email
"0195c9e3-5067-741d-be87-a4f75ef93372"