Skip to content

Sending a message

Sending a message

To send a message, make a POST request with a JSON payload to:

https://webapi.inboxroad.com/api/v1/messages

Authenticate with your API token — see v1 authentication.

Terminal window
curl -X POST 'https://webapi.inboxroad.com/api/v1/messages' \
-H 'X-API-Key: <your_token>' \
-H 'Content-Type: application/json' \
-d '{
"from_email": "sender@example.com",
"from_name": "Example Sender",
"to_email": "recipient@example.com",
"to_name": "Example Recipient",
"subject": "Hello from Inboxroad",
"text": "Plain-text body",
"html": "<h1>HTML body</h1>"
}'

Request fields

Field nameTypeRequiredDescription
from_emailstringYesValid email address the message is sent from.
from_namestringNoDisplay name for the sender. Backslash (\) characters are not allowed.
to_emailstringYesValid recipient email address.
to_namestringNoDisplay name for the recipient. Backslash (\) characters are not allowed.
reply_to_emailstringNoReply-To address. Defaults to from_email if omitted.
reply_to_namestringNoDisplay name for the Reply-To address. Backslash (\) characters are not allowed.
subjectstringNoSubject line of the message.
textstringCond.Plain-text body. Required if html is empty.
htmlstringCond.HTML body. Required if text is empty.
headersobjectNoExtra email headers as a JSON object. Reserved headers are ignored (see below).
attachmentsarrayNoList of attachment objects (see below).

Reserved headers

The following headers are managed by Inboxroad and are silently stripped if you include them in headers:

Delivered-To, Return-Path, Content-Type, Subject, From, To, Reply-To, Message-ID.

Attachment object

Field nameTypeRequiredDescription
filenamestringYesFile name including extension.
mime_typestringYesMIME type of the file, e.g. application/pdf.
file_datastringYesBase64-encoded file contents. A data:...;base64, prefix is also accepted.

Example request

{
"from_email": "sender@example.com",
"from_name": "Example Sender",
"to_email": "recipient@example.com",
"to_name": "Example Recipient",
"reply_to_email": "reply@example.com",
"reply_to_name": "Example Reply",
"subject": "Hello from Inboxroad",
"text": "Plain-text body",
"html": "<h1>HTML body</h1>",
"headers": {
"X-Custom-Header": "value"
},
"attachments": [
{
"filename": "invoice.pdf",
"mime_type": "application/pdf",
"file_data": "JVBERi0xLjQKJ..."
}
]
}

Response

On success the API returns 200 with the generated Message-ID, which you can use to correlate later bounce and complaint events.

{
"message_id": "<20260521094500.abc123@inboxroad.com>"
}

Examples

Terminal window
curl -X POST 'https://webapi.inboxroad.com/api/v1/messages' \
-H 'X-API-Key: <your_token>' \
-H 'Content-Type: application/json' \
-d '{
"from_email": "sender@example.com",
"from_name": "Example Sender",
"to_email": "recipient@example.com",
"subject": "Hello from Inboxroad",
"text": "Plain-text body",
"html": "<h1>HTML body</h1>"
}'

For interactive testing, visit the interactive API explorer.