Skip to content

Sending

Send an email

One request per email, with HTML, attachments, tags, and scheduling.

POST/emails
Request
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]"],
    "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" }
    ]
  }'
JSON

Body parameters

FieldTypeDescription
fromstringRequired. Name <address> or a bare address on a verified domain.
tostring or string[]Required. Recipient addresses.
subjectstringRequired. The subject line.
cc, bccstring or string[]Optional copies.
reply_tostring or string[]Optional. Where replies go.
htmlstringThe HTML body. Send html, text, or both.
textstringThe plain-text body.
headersobjectOptional custom headers, such as {"X-Entity-Ref-ID": "1042"}.
attachmentsarrayOptional files. See below.
tagsarrayOptional { name, value } pairs, returned in webhooks.
scheduled_atstringOptional. 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.

Request
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.

Request
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.