curl --request POST \
--url https://{dsn}/api/v1/{account_id}/emails/send \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"to": [
{
"email": "ana@example.com",
"display_name": "Ana Lee"
}
],
"subject": "Your order",
"html": "<p>Hi Ana, your order has shipped.</p>",
"plain_text": "Hi Ana, your order has shipped."
}
'{
"object": "EmailSent",
"account_id": "<string>",
"message_id": "<string>",
"provider_id": "<string>",
"tracking_id": "<string>"
}{
"status": 400,
"type": "errors/invalid_parameters",
"title": "Invalid parameters",
"detail": "limit must be between 1 and 250"
}{
"status": 401,
"type": "errors/invalid_credentials",
"title": "Invalid credentials",
"detail": "the mail provider rejected the credentials: invalid_grant"
}{
"status": 404,
"type": "errors/not_found",
"title": "Not found",
"detail": "email email_94a0d77db739407e932c3b97fef44aac not found"
}{
"status": 422,
"type": "errors/provider_rejected",
"title": "Rejected by the provider",
"detail": "Message too large"
}{
"status": 502,
"type": "errors/provider_error",
"title": "Mail provider error",
"detail": "timed out talking to imap.example.com"
}Emails
Send an email
Sends an email from the account, or a reply with reply_to_message_id. The Sent copy
arrives with the next sync (email.new, origin: "api").
reply_to_message_idis the email you answer: its Message-ID (from itsheaders), or itsemail_…id. The reply keeps the conversation (In-Reply-To, References,Re:subject) and goes back to the sender when you give no recipients.reply_tois the Reply-To header, not the email you answer.- Files: base64 in JSON, or
multipart/form-datawithattachmentsfiles (better above ~1 MB). In a form, write recipients asto[0][email],to[0][display_name].
There’s no forward call: to forward, send a new email with the original’s content and files.
POST
/
{account_id}
/
emails
/
send
curl --request POST \
--url https://{dsn}/api/v1/{account_id}/emails/send \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"to": [
{
"email": "ana@example.com",
"display_name": "Ana Lee"
}
],
"subject": "Your order",
"html": "<p>Hi Ana, your order has shipped.</p>",
"plain_text": "Hi Ana, your order has shipped."
}
'{
"object": "EmailSent",
"account_id": "<string>",
"message_id": "<string>",
"provider_id": "<string>",
"tracking_id": "<string>"
}{
"status": 400,
"type": "errors/invalid_parameters",
"title": "Invalid parameters",
"detail": "limit must be between 1 and 250"
}{
"status": 401,
"type": "errors/invalid_credentials",
"title": "Invalid credentials",
"detail": "the mail provider rejected the credentials: invalid_grant"
}{
"status": 404,
"type": "errors/not_found",
"title": "Not found",
"detail": "email email_94a0d77db739407e932c3b97fef44aac not found"
}{
"status": 422,
"type": "errors/provider_rejected",
"title": "Rejected by the provider",
"detail": "Message too large"
}{
"status": 502,
"type": "errors/provider_error",
"title": "Mail provider error",
"detail": "timed out talking to imap.example.com"
}Body
application/jsonmultipart/form-data