Skip to content

Send an email

POST
/v1/Accounts/{auth_id}/SendEmail
curl --request POST \
--url https://api.siprtc.io/v1/Accounts/AC000000000000000000/SendEmail \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "attachments": [ { "content": "JVBERi0xLjcK", "content_type": "application/pdf", "file_id": "invoice-1001", "name": "invoice-1001.pdf", "url": "https://files.example.com/invoice-1001.pdf" } ], "bcc": [ "archive@example.com" ], "cc": [ "manager@example.com" ], "email": "customer@example.net", "emailBody": "", "email_type": "send", "from": "support@example.com", "headers": { "X-Campaign": "november" }, "html_body": "<p>Hello, your invoice is attached.</p>", "idempotency_key": "", "message_id": "<CAF0000000000000000000000000@mail.example.com>", "reply_to": "replies@example.com", "status_callback": "https://example.com/email/status", "subject": "Your invoice", "template_id": "", "text_body": "Hello, your invoice is attached.", "thread": { "in_reply_to": "<CAF0000000000000000000000000@mail.example.com>", "references": [ "<CAF0000000000000000000000000@mail.example.com>" ] }, "to": [ "customer@example.net" ], "vars": {} }'

Queues an email for sending through one of your account’s email mailboxes. from must be the SMTP user (address) of an email mailbox configured on your account: the email is sent through that mailbox’s SMTP server with its credentials (port 465 uses TLS, other ports STARTTLS when offered). SIPRTC does not verify sending domains; deliverability depends on the mailbox’s provider. Recipients: to (or email for a single address) must hold at least one address containing “@”; entries without “@” and duplicates are dropped, also from cc and bcc, which may be arrays or one comma/semicolon-separated string. Body: html_body (alias emailBody) or text_body; when HTML is given it is the only body part. A body is required unless attachments or template_id are given (and except for replies without a subject). Up to 5 attachments, each at most 10 MB, given as base64 content or as a url fetched at send time; audio/*, disk images and .exe, .bat, .sh, .apk and .msi files are refused. Replies: set email_type to reply or reply_all (or just give message_id) with the Message-ID of an email in one of your email conversations; from and message_id are then required. The reply gets In-Reply-To/References headers and a “Re: “ subject (the conversation’s subject when subject is empty). thread.in_reply_to/thread.references set the same headers on any email. After sending, the email is recorded in your conversations: a reply is added to the matching conversation and its agents are notified; a new email starts a conversation whose id is the email’s sid. The call only validates and queues: it answers 202 with status = queued and the email’s sid. Mailbox lookup, attachment checks and SMTP delivery happen afterwards; their failures are not reported back (there is no public status endpoint, and status_callback is currently not called). Sending is not retried. Emails are not charged. template_id, vars and idempotency_key are accepted but not used. multipart/form-data is also accepted (form fields email or to, from, subject, emailBody/html_body/body, cc, bcc, files in file or files, each read up to 10 MB); a multipart request is answered 200 with an empty JSON object instead of the 202 body.

auth_id
required
string

Your account’s Auth ID (20 upper-case letters and digits).

Example

AC000000000000000000

Email to send.

Media type application/json
object
attachments

Files to attach; at most 5 per email in total.

Array<object>
object
content

File content, standard base64 (at most 10 MB decoded).

string

Example

JVBERi0xLjcK
content_type

MIME type; default application/octet-stream. audio/* and application/x-apple-diskimage are refused.

string

Example

application/pdf
file_id

Your own reference for the file; not used for sending.

string

Example

invoice-1001
name

File name shown to the recipient; default “attachment”.

string

Example

invoice-1001.pdf
url

HTTP(S) URL the file is downloaded from when the email is sent (30 s timeout, at most 10 MB).

string

Example

https://files.example.com/invoice-1001.pdf
bcc

Bcc recipients: an array, or one string with addresses separated by commas or semicolons. Delivered but not shown in the headers.

Array<string>

Example

[
"archive@example.com"
]
cc

Cc recipients: an array, or one string with addresses separated by commas or semicolons.

Array<string>

Example

[
"manager@example.com"
]
email

Single recipient; used only when to is empty.

string

Example

customer@example.net
emailBody

Alias of html_body.

string

Example

email_type

How to send: “send” (default, a new email), “reply”, “reply_all” or “forward”. Any other non-empty value is treated as “reply”. Also accepted as emailType.

string
Allowed values: send reply reply_all forward

Example

send
from

Required. Sender address. It must be the SMTP user of an email mailbox configured on your account; the email is sent through that mailbox’s SMTP server.

string

Example

support@example.com
headers

Extra header lines added to the message as given (name: value); empty values are skipped.

object
key
additional properties
string

Example

{
"X-Campaign": "november"
}
html_body

HTML body. When set it is the only body part sent (text_body is then not included).

string

Example

<p>Hello, your invoice is attached.</p>
idempotency_key

Accepted but not used: repeating a request sends the email again.

string

Example

message_id

Message-ID of an email in one of your email conversations. Required for replies; when given without email_type the email is sent as a reply. Also accepted as messageID.

string

Example

<CAF0000000000000000000000000@mail.example.com>
reply_to

Reply-To header.

string

Example

replies@example.com
status_callback

Accepted but not used: no request is made to this URL.

string

Example

https://example.com/email/status
subject

Subject; an empty subject is sent as “No Subject” (“Re: …” when thread.in_reply_to is set).

string

Example

Your invoice
template_id

Accepted but no template is applied. When set, the body requirement is waived and the email is sent with whatever body is given (possibly none).

string

Example

text_body

Plain-text body, sent when there is no HTML body.

string

Example

Hello, your invoice is attached.
thread

Threading headers.

object
in_reply_to

Message-ID of the email being answered; sent as In-Reply-To, and the subject gets a “Re: “ prefix.

string

Example

<CAF0000000000000000000000000@mail.example.com>
references

Message-IDs sent space-separated as References; defaults to in_reply_to.

Array<string>

Example

[
"<CAF0000000000000000000000000@mail.example.com>"
]
to

Recipients. At least one address containing “@” is required (here or in email); entries without “@” and duplicates are dropped.

Array<string>

Example

[
"customer@example.net"
]
vars

Accepted but not used.

object
key
additional properties
any

Email accepted and queued.

Media type application/json
object
account_sid

Auth ID of the account the email is sent for.

string
api_version

Always “v1”.

string
bcc

Bcc recipients after clean-up.

Array<string>
cc

Cc recipients after clean-up.

Array<string>
direction

Always “outbound-api”.

string
from

Sender address as given.

string
mailBox

Mailbox label; “default”.

string
price_unit

Always “USD”; emails are not charged.

string
provider

Always “smtp”: the email goes out through your mailbox’s SMTP server.

string
queue_time

When the email was queued, RFC 1123 in UTC.

string
reply_to

Reply-To address as given.

string
sid

Identifier of the queued email (a UUID).

string
status

Always “queued”: the email is waiting to be sent.

string
subject

Subject as given (an empty subject is sent as “No Subject”).

string
subresource_uris

Paths of related resources. Not served on the public API.

object
attachments

Attachments path (not served).

string
events

Events path (not served).

string
to

Recipients after clean-up (entries without “@” and duplicates removed).

Array<string>
type

How the email is sent: “new”, “reply”, “reply_all” or “forward”.

string
uri

Path of the email resource. Not served on the public API.

string

Example

{
"account_sid": "AC000000000000000000",
"api_version": "v1",
"bcc": [
"archive@example.com"
],
"cc": [
"manager@example.com"
],
"direction": "outbound-api",
"from": "support@example.com",
"mailBox": "default",
"price_unit": "USD",
"provider": "smtp",
"queue_time": "Thu, 26 Nov 2026 10:15:00 UTC",
"reply_to": "replies@example.com",
"sid": "3f2b8c1e-6d4a-4f0b-9c7e-1a2b3c4d5e6f",
"status": "queued",
"subject": "Your invoice",
"subresource_uris": {
"attachments": "/v1/Accounts/AC000000000000000000/Emails/3f2b8c1e-6d4a-4f0b-9c7e-1a2b3c4d5e6f/Attachments",
"events": "/v1/Accounts/AC000000000000000000/Emails/3f2b8c1e-6d4a-4f0b-9c7e-1a2b3c4d5e6f/Events"
},
"to": [
"customer@example.net"
],
"type": "new",
"uri": "/v1/Accounts/AC000000000000000000/Emails/3f2b8c1e-6d4a-4f0b-9c7e-1a2b3c4d5e6f"
}

Invalid request. error is one of ‘invalid json body’ (not JSON, or to is not an array), ‘email is required’ (no usable recipient), ‘email body is required when template_id is not provided’, ‘from is required for reply emails’, ‘message_id is required for reply emails’. For some forward requests field validation answers instead with {“code”:“INVALID_REQUEST”,“message”:“One or more parameters are invalid”,“details”:{“”:“”}}.

Media type application/json
object
error

Human-readable reason.

string

Example

{
"error": "email is required"
}

Missing or wrong credentials, or credentials that may not act for {auth_id}. Body: ‘Authentication failed’.

Media type application/json
string

Example generated

example

The email could not be recorded (message ‘failed to persist email request’).

Media type application/json
object
message

Human-readable reason.

string
status

Always “failed”.

string

Example

{
"message": "email queue temporarily unavailable",
"status": "failed"
}

The send queue is unavailable (message ‘email queue temporarily unavailable’); retry later.

Media type application/json
object
message

Human-readable reason.

string
status

Always “failed”.

string

Example

{
"message": "email queue temporarily unavailable",
"status": "failed"
}