curl --request POST \
--url https://smtp.sendmux.ai/api/v1/emails/send/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{
"from": {
"email": "user@example.com",
"name": "John Smith"
},
"to": {
"email": "user@example.com",
"name": "John Smith"
},
"subject": "Welcome to Sendmux",
"html_body": "<string>",
"text_body": "<string>",
"return_path": "jsmith@example.com",
"cc": [
{
"email": "jsmith@example.com",
"name": "<string>"
}
],
"bcc": [
{
"email": "jsmith@example.com",
"name": "<string>"
}
],
"custom_headers": {},
"attachments": [
{
"filename": "invoice.pdf",
"content": "<string>",
"type": "application/pdf",
"encoding": "base64"
}
]
}
]
}
'import requests
url = "https://smtp.sendmux.ai/api/v1/emails/send/batch"
payload = { "messages": [
{
"from": {
"email": "user@example.com",
"name": "John Smith"
},
"to": {
"email": "user@example.com",
"name": "John Smith"
},
"subject": "Welcome to Sendmux",
"html_body": "<string>",
"text_body": "<string>",
"return_path": "jsmith@example.com",
"cc": [
{
"email": "jsmith@example.com",
"name": "<string>"
}
],
"bcc": [
{
"email": "jsmith@example.com",
"name": "<string>"
}
],
"custom_headers": {},
"attachments": [
{
"filename": "invoice.pdf",
"content": "<string>",
"type": "application/pdf",
"encoding": "base64"
}
]
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
messages: [
{
from: {email: 'user@example.com', name: 'John Smith'},
to: {email: 'user@example.com', name: 'John Smith'},
subject: 'Welcome to Sendmux',
html_body: '<string>',
text_body: '<string>',
return_path: 'jsmith@example.com',
cc: [{email: 'jsmith@example.com', name: '<string>'}],
bcc: [{email: 'jsmith@example.com', name: '<string>'}],
custom_headers: {},
attachments: [
{
filename: 'invoice.pdf',
content: '<string>',
type: 'application/pdf',
encoding: 'base64'
}
]
}
]
})
};
fetch('https://smtp.sendmux.ai/api/v1/emails/send/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://smtp.sendmux.ai/api/v1/emails/send/batch"
payload := strings.NewReader("{\n \"messages\": [\n {\n \"from\": {\n \"email\": \"user@example.com\",\n \"name\": \"John Smith\"\n },\n \"to\": {\n \"email\": \"user@example.com\",\n \"name\": \"John Smith\"\n },\n \"subject\": \"Welcome to Sendmux\",\n \"html_body\": \"<string>\",\n \"text_body\": \"<string>\",\n \"return_path\": \"jsmith@example.com\",\n \"cc\": [\n {\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\"\n }\n ],\n \"bcc\": [\n {\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\"\n }\n ],\n \"custom_headers\": {},\n \"attachments\": [\n {\n \"filename\": \"invoice.pdf\",\n \"content\": \"<string>\",\n \"type\": \"application/pdf\",\n \"encoding\": \"base64\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"ok": true,
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"data": {
"results": [
{
"index": 123,
"message_id": "<string>",
"error": {
"code": "validation_error",
"message": "<string>",
"retryable": true,
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "to.email",
"code": "invalid_string",
"message": "<string>"
}
]
}
}
],
"summary": {
"total": 123,
"queued": 123,
"failed": 123
}
}
}{
"ok": false,
"error": {
"code": "validation_error",
"message": "<string>",
"retryable": true,
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "to.email",
"code": "invalid_string",
"message": "<string>"
}
]
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}{
"ok": false,
"error": {
"code": "validation_error",
"message": "<string>",
"retryable": true,
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "to.email",
"code": "invalid_string",
"message": "<string>"
}
]
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}{
"ok": false,
"error": {
"code": "validation_error",
"message": "<string>",
"retryable": true,
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "to.email",
"code": "invalid_string",
"message": "<string>"
}
]
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}{
"ok": false,
"error": {
"code": "validation_error",
"message": "<string>",
"retryable": true,
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "to.email",
"code": "invalid_string",
"message": "<string>"
}
]
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}{
"ok": false,
"error": {
"code": "validation_error",
"message": "<string>",
"retryable": true,
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "to.email",
"code": "invalid_string",
"message": "<string>"
}
]
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}{
"ok": false,
"error": {
"code": "validation_error",
"message": "<string>",
"retryable": true,
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "to.email",
"code": "invalid_string",
"message": "<string>"
}
]
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}{
"ok": false,
"error": {
"code": "validation_error",
"message": "<string>",
"retryable": true,
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "to.email",
"code": "invalid_string",
"message": "<string>"
}
]
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}{
"ok": false,
"error": {
"code": "validation_error",
"message": "<string>",
"retryable": true,
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "to.email",
"code": "invalid_string",
"message": "<string>"
}
]
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}{
"ok": false,
"error": {
"code": "validation_error",
"message": "<string>",
"retryable": true,
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "to.email",
"code": "invalid_string",
"message": "<string>"
}
]
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}Send a batch of emails
Queue up to 100 emails for delivery in a single request. Uses partial success model — individual message failures do not fail the entire batch. Requires email.send permission.
curl --request POST \
--url https://smtp.sendmux.ai/api/v1/emails/send/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{
"from": {
"email": "user@example.com",
"name": "John Smith"
},
"to": {
"email": "user@example.com",
"name": "John Smith"
},
"subject": "Welcome to Sendmux",
"html_body": "<string>",
"text_body": "<string>",
"return_path": "jsmith@example.com",
"cc": [
{
"email": "jsmith@example.com",
"name": "<string>"
}
],
"bcc": [
{
"email": "jsmith@example.com",
"name": "<string>"
}
],
"custom_headers": {},
"attachments": [
{
"filename": "invoice.pdf",
"content": "<string>",
"type": "application/pdf",
"encoding": "base64"
}
]
}
]
}
'import requests
url = "https://smtp.sendmux.ai/api/v1/emails/send/batch"
payload = { "messages": [
{
"from": {
"email": "user@example.com",
"name": "John Smith"
},
"to": {
"email": "user@example.com",
"name": "John Smith"
},
"subject": "Welcome to Sendmux",
"html_body": "<string>",
"text_body": "<string>",
"return_path": "jsmith@example.com",
"cc": [
{
"email": "jsmith@example.com",
"name": "<string>"
}
],
"bcc": [
{
"email": "jsmith@example.com",
"name": "<string>"
}
],
"custom_headers": {},
"attachments": [
{
"filename": "invoice.pdf",
"content": "<string>",
"type": "application/pdf",
"encoding": "base64"
}
]
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
messages: [
{
from: {email: 'user@example.com', name: 'John Smith'},
to: {email: 'user@example.com', name: 'John Smith'},
subject: 'Welcome to Sendmux',
html_body: '<string>',
text_body: '<string>',
return_path: 'jsmith@example.com',
cc: [{email: 'jsmith@example.com', name: '<string>'}],
bcc: [{email: 'jsmith@example.com', name: '<string>'}],
custom_headers: {},
attachments: [
{
filename: 'invoice.pdf',
content: '<string>',
type: 'application/pdf',
encoding: 'base64'
}
]
}
]
})
};
fetch('https://smtp.sendmux.ai/api/v1/emails/send/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://smtp.sendmux.ai/api/v1/emails/send/batch"
payload := strings.NewReader("{\n \"messages\": [\n {\n \"from\": {\n \"email\": \"user@example.com\",\n \"name\": \"John Smith\"\n },\n \"to\": {\n \"email\": \"user@example.com\",\n \"name\": \"John Smith\"\n },\n \"subject\": \"Welcome to Sendmux\",\n \"html_body\": \"<string>\",\n \"text_body\": \"<string>\",\n \"return_path\": \"jsmith@example.com\",\n \"cc\": [\n {\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\"\n }\n ],\n \"bcc\": [\n {\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\"\n }\n ],\n \"custom_headers\": {},\n \"attachments\": [\n {\n \"filename\": \"invoice.pdf\",\n \"content\": \"<string>\",\n \"type\": \"application/pdf\",\n \"encoding\": \"base64\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"ok": true,
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"data": {
"results": [
{
"index": 123,
"message_id": "<string>",
"error": {
"code": "validation_error",
"message": "<string>",
"retryable": true,
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "to.email",
"code": "invalid_string",
"message": "<string>"
}
]
}
}
],
"summary": {
"total": 123,
"queued": 123,
"failed": 123
}
}
}{
"ok": false,
"error": {
"code": "validation_error",
"message": "<string>",
"retryable": true,
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "to.email",
"code": "invalid_string",
"message": "<string>"
}
]
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}{
"ok": false,
"error": {
"code": "validation_error",
"message": "<string>",
"retryable": true,
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "to.email",
"code": "invalid_string",
"message": "<string>"
}
]
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}{
"ok": false,
"error": {
"code": "validation_error",
"message": "<string>",
"retryable": true,
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "to.email",
"code": "invalid_string",
"message": "<string>"
}
]
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}{
"ok": false,
"error": {
"code": "validation_error",
"message": "<string>",
"retryable": true,
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "to.email",
"code": "invalid_string",
"message": "<string>"
}
]
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}{
"ok": false,
"error": {
"code": "validation_error",
"message": "<string>",
"retryable": true,
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "to.email",
"code": "invalid_string",
"message": "<string>"
}
]
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}{
"ok": false,
"error": {
"code": "validation_error",
"message": "<string>",
"retryable": true,
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "to.email",
"code": "invalid_string",
"message": "<string>"
}
]
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}{
"ok": false,
"error": {
"code": "validation_error",
"message": "<string>",
"retryable": true,
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "to.email",
"code": "invalid_string",
"message": "<string>"
}
]
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}{
"ok": false,
"error": {
"code": "validation_error",
"message": "<string>",
"retryable": true,
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "to.email",
"code": "invalid_string",
"message": "<string>"
}
]
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}{
"ok": false,
"error": {
"code": "validation_error",
"message": "<string>",
"retryable": true,
"param": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "to.email",
"code": "invalid_string",
"message": "<string>"
}
]
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}Authorizations
Sendmux API key (smx_...)
Headers
Optional client-generated key to make the request idempotent for 24 hours. Replays under the same key return the cached response; a reused key with a different body returns 409 idempotency_conflict.
255Body
Array of email messages to send (max 100)
1 - 100 elementsHide child attributes
Hide child attributes
Email subject line (max 998 chars, RFC 5322)
1 - 998^[^\r\n]*$"Welcome to Sendmux"
HTML email content (max 25MB)
1 - 26214400Plain text alternative (max 25MB)
26214400Envelope sender for VERP support
254File attachments (max 10). Use attachment_id refs for uploaded files.
10- Option 1
- Option 2
Hide child attributes
Hide child attributes
Filename with allowed extension
1 - 255"invoice.pdf"
Base64-encoded file content
1MIME type override
"application/pdf"
base64 Response
Batch processed (check individual results for per-message status)
true Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Position in the input array
Message ID (null if failed)
^eml_[a-z0-9]{24}$Result status
queued, failed Error details (only if failed)
Hide child attributes
Hide child attributes
Machine-readable error code
"validation_error"
Human-readable error description
True when the client may safely retry the same request. 429 and 5xx default true; 4xx default false.
Parameter that caused the error
Link to error documentation
Accumulated per-field issues (validation errors)
Was this page helpful?