Send a single email
curl --request POST \
--url https://smtp.sendmux.ai/api/v1/emails/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": {
"email": "user@example.com",
"name": "John Smith"
},
"to": {
"email": "user@example.com",
"name": "John Smith"
},
"subject": "Welcome to Sendmux",
"html_body": "<string>"
}
'import requests
url = "https://smtp.sendmux.ai/api/v1/emails/send"
payload = {
"from": {
"email": "user@example.com",
"name": "John Smith"
},
"to": {
"email": "user@example.com",
"name": "John Smith"
},
"subject": "Welcome to Sendmux",
"html_body": "<string>"
}
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({
from: {email: 'user@example.com', name: 'John Smith'},
to: {email: 'user@example.com', name: 'John Smith'},
subject: 'Welcome to Sendmux',
html_body: '<string>'
})
};
fetch('https://smtp.sendmux.ai/api/v1/emails/send', 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"
payload := strings.NewReader("{\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}")
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": {
"message_id": "eml_tz4a98xxat96iws9zmbrgj3a",
"status": "queued"
}
}{
"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"
}
}Emails
Send a single email
Queue a single email for delivery. Requires email.send permission.
POST
/
emails
/
send
Send a single email
curl --request POST \
--url https://smtp.sendmux.ai/api/v1/emails/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": {
"email": "user@example.com",
"name": "John Smith"
},
"to": {
"email": "user@example.com",
"name": "John Smith"
},
"subject": "Welcome to Sendmux",
"html_body": "<string>"
}
'import requests
url = "https://smtp.sendmux.ai/api/v1/emails/send"
payload = {
"from": {
"email": "user@example.com",
"name": "John Smith"
},
"to": {
"email": "user@example.com",
"name": "John Smith"
},
"subject": "Welcome to Sendmux",
"html_body": "<string>"
}
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({
from: {email: 'user@example.com', name: 'John Smith'},
to: {email: 'user@example.com', name: 'John Smith'},
subject: 'Welcome to Sendmux',
html_body: '<string>'
})
};
fetch('https://smtp.sendmux.ai/api/v1/emails/send', 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"
payload := strings.NewReader("{\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}")
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": {
"message_id": "eml_tz4a98xxat96iws9zmbrgj3a",
"status": "queued"
}
}{
"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.
Maximum string length:
255Body
application/json
Email subject line (max 998 chars, RFC 5322)
Required string length:
1 - 998Pattern:
^[^\r\n]*$Example:
"Welcome to Sendmux"
HTML email content (max 25MB)
Required string length:
1 - 26214400Plain text alternative (max 25MB)
Maximum string length:
26214400Envelope sender for VERP support
Maximum string length:
254File attachments (max 10). Use attachment_id refs for uploaded files.
Maximum array length:
10- Option 1
- Option 2
Hide child attributes
Hide child attributes
Filename with allowed extension
Required string length:
1 - 255Example:
"invoice.pdf"
Base64-encoded file content
Minimum string length:
1MIME type override
Example:
"application/pdf"
Available options:
base64 Response
Email queued successfully
Available options:
true Was this page helpful?
⌘I