Sending
Send an email
One request per email, with HTML, attachments, tags, and scheduling.
/emailscurl -X POST https://api.chebu.io/emails \
-H "Authorization: Bearer $CHEBU_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "Northwind <[email protected]>",
"to": ["[email protected]"],
"reply_to": "[email protected]",
"subject": "Your receipt #1042",
"html": "<p>Thanks for your order.</p>",
"text": "Thanks for your order.",
"tags": [
{ "name": "category", "value": "receipt" }
]
}'{
"id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c"
}Body parameters
| Field | Type | Description |
|---|---|---|
from | string | Required. Name <address> or a bare address on a verified domain. |
to | string or string[] | Required. Recipient addresses. |
subject | string | Required. The subject line. |
cc, bcc | string or string[] | Optional copies. |
reply_to | string or string[] | Optional. Where replies go. |
html | string | The HTML body. Send html, text, or both. |
text | string | The plain-text body. |
headers | object | Optional custom headers, such as {"X-Entity-Ref-ID": "1042"}. |
attachments | array | Optional files. See below. |
tags | array | Optional { name, value } pairs, returned in webhooks. |
scheduled_at | string | Optional. When to send, up to 30 days ahead. |
An email can have up to 50 recipients across to, cc, and bcc, and counts as one send however many it has.
Attachments
Each attachment has either content (the file, base64-encoded) or path (an https URL Chebu downloads), plus a filename. Set content_type to override the type guessed from the name. To show an image inline, give it a content_id and reference it as cid: in your HTML. Attachments can total up to 40 MB.
curl -X POST https://api.chebu.io/emails \
-H "Authorization: Bearer $CHEBU_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "Northwind <[email protected]>",
"to": ["[email protected]"],
"subject": "Invoice #1042",
"html": "<p>Your invoice is attached.</p><img src=\"cid:logo\">",
"attachments": [
{
"path": "https://northwind.studio/invoices/1042.pdf",
"filename": "invoice-1042.pdf"
},
{
"content": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=",
"filename": "logo.png",
"content_id": "logo"
}
]
}'Tags
Tags label an email for your own records, for example by type or customer. Names and values may contain letters, numbers, underscores, and dashes, up to 256 characters each. Tags come back on the email and in every webhook event.
Scheduling
Set scheduled_at to an ISO 8601 time such as 2026-10-01T09:00:00Z, or a phrase like in 1 hour. It can be up to 30 days ahead. Until it sends, you can reschedule or cancel it.
curl -X POST https://api.chebu.io/emails \
-H "Authorization: Bearer $CHEBU_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "Northwind <[email protected]>",
"to": ["[email protected]"],
"subject": "Your trial ends tomorrow",
"text": "Your Northwind trial ends tomorrow.",
"scheduled_at": "in 1 hour"
}'Errors
A bad field returns 422 validation_error with a message naming it. A from address on an unverified domain, too many recipients, or an unreadable attachment are the usual causes. See errors for the full list.