Endpoints
turboSMTP provides two send endpoints. Choose based on your data-residency requirements.Request headers
Send these three headers with every/mail/send request.
Request body
The request body must be a JSON object. Thefrom and to fields are required; all other fields are optional.
string
required
The sender’s email address. Use a verified sender domain so your messages can authenticate as your domain. You can include a display name:
"Your Company <hello@your-company.com>".string
required
One or more recipient email addresses. Separate multiple addresses with commas. Example:
"alice@example.com,bob@example.com"string
The subject line of the email. The API specification sets a maximum of 700 characters.
string
The plain-text body of the email. Include this field to ensure compatibility with email clients that do not render HTML.
string
The HTML body of the email. You can provide both
content and html_content in the same request; email clients that support HTML will render html_content and fall back to content.string
One or more CC (carbon copy) email addresses, comma-separated.
string
One or more BCC (blind carbon copy) email addresses, comma-separated. BCC recipients are hidden from all other recipients.
object
Additional SMTP headers to include in the message, expressed as a JSON object. Example:
{"Reply-To": "support@example.com", "X-Mailer": "MyApp/1.0"}string
A custom identifier included in event webhook data when provided. Use a UUID to correlate events with your application.
string
A top-level campaign identifier used to group messages. Use this exact capitalization. Filter by it in analytics; the
X-Campaign-Id header on the delivered message is internal and does not carry this value.array
An array of attachment objects. Each object must include
name (filename), type (MIME type), and content (Base64-encoded file data). Add optional content_id for inline images. The total size of the email including all attachments must be under 24 MB. See Attachments for full details and examples.string
Accepted by the request schema, but
/mail/send does not use it. A request that carries only mime_raw is delivered with an empty body, and the raw message’s headers and subject are discarded; when content or html_content is present, those are sent instead. To send a pre-built MIME message, use the SMTP relay.Example request
The following cURL command sends a basic email with both a plain-text and an HTML body.Send an email
200 with the following body:
Success response
mid field is the turboSMTP message ID, which you can use to look up delivery status in the dashboard or via the analytics API.
Response codes
An error response body looks like this:
Error response
Next steps
Code Examples
Copy-paste examples for cURL, Python, Node.js, PHP, Ruby, Go, Java, and C#.
Attachments
Learn how to attach PDFs, images, and other files using Base64 encoding.