Skip to content

Send a message

Send a message

Send a POST request to:

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

The request body must be sent as JSON.

Authentication is required. See Authentication.

Example request

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.
attachmentsarrayNoList of attachment objects. See Attachment object.

Reserved headers

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

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

Attachment object

Use the attachments field to include one or more files with your message.

Each attachment object must contain the following fields:

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.

Full JSON example

{
"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

When the message is sent successfully, the API returns 200 with the generated Message-ID.

You can use this Message-ID to match the message with later bounce and complaint events.

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

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