curl --request PUT \
--url https://smtp.sendmux.ai/api/v1/emails/attachment-uploads/{upload_id} \
--header 'Content-Length: <content-length>' \
--header 'Content-Type: application/octet-stream' \
--header 'X-Sendmux-Upload-Token: <x-sendmux-upload-token>' \
--data '"<string>"'import requests
url = "https://smtp.sendmux.ai/api/v1/emails/attachment-uploads/{upload_id}"
payload = "<string>"
headers = {
"X-Sendmux-Upload-Token": "<x-sendmux-upload-token>",
"Content-Length": "<content-length>",
"Content-Type": "application/octet-stream"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-Sendmux-Upload-Token': '<x-sendmux-upload-token>',
'Content-Length': '<content-length>',
'Content-Type': 'application/octet-stream'
},
body: JSON.stringify('<string>')
};
fetch('https://smtp.sendmux.ai/api/v1/emails/attachment-uploads/{upload_id}', 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/attachment-uploads/{upload_id}"
payload := strings.NewReader("\"<string>\"")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Sendmux-Upload-Token", "<x-sendmux-upload-token>")
req.Header.Add("Content-Length", "<content-length>")
req.Header.Add("Content-Type", "application/octet-stream")
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": {
"attachment_id": "att_tz4a98xxat96iws9zmbrgj3a",
"filename": "analysis.pdf",
"content_type": "application/pdf",
"size_bytes": 20480,
"expires_at": "2026-07-07T08:15:00.000Z"
}
}{
"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"
}
}Upload bytes to an attachment upload URL
Upload the exact binary bytes for a previously-created attachment upload URL. This operation uses the short-lived upload token header returned by POST /emails/attachment-uploads, not a Sendmux API key.
curl --request PUT \
--url https://smtp.sendmux.ai/api/v1/emails/attachment-uploads/{upload_id} \
--header 'Content-Length: <content-length>' \
--header 'Content-Type: application/octet-stream' \
--header 'X-Sendmux-Upload-Token: <x-sendmux-upload-token>' \
--data '"<string>"'import requests
url = "https://smtp.sendmux.ai/api/v1/emails/attachment-uploads/{upload_id}"
payload = "<string>"
headers = {
"X-Sendmux-Upload-Token": "<x-sendmux-upload-token>",
"Content-Length": "<content-length>",
"Content-Type": "application/octet-stream"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-Sendmux-Upload-Token': '<x-sendmux-upload-token>',
'Content-Length': '<content-length>',
'Content-Type': 'application/octet-stream'
},
body: JSON.stringify('<string>')
};
fetch('https://smtp.sendmux.ai/api/v1/emails/attachment-uploads/{upload_id}', 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/attachment-uploads/{upload_id}"
payload := strings.NewReader("\"<string>\"")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Sendmux-Upload-Token", "<x-sendmux-upload-token>")
req.Header.Add("Content-Length", "<content-length>")
req.Header.Add("Content-Type", "application/octet-stream")
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": {
"attachment_id": "att_tz4a98xxat96iws9zmbrgj3a",
"filename": "analysis.pdf",
"content_type": "application/pdf",
"size_bytes": 20480,
"expires_at": "2026-07-07T08:15:00.000Z"
}
}{
"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"
}
}Headers
Short-lived upload token returned by POST /emails/attachment-uploads.
Exact number of bytes in the binary request body.
x >= 1Path Parameters
Upload intent ID returned by POST /emails/attachment-uploads.
^upl_[a-z0-9]{24}$Body
The body is of type file.
Response
Attachment uploaded successfully
true Hide child attributes
Hide child attributes
Temporary attachment ID to use in email attachments[].
^att_[a-z0-9]{24}$"att_tz4a98xxat96iws9zmbrgj3a"
Stored attachment filename
"analysis.pdf"
Stored attachment MIME type
"application/pdf"
Stored attachment byte size
20480
ISO timestamp when this temporary attachment reference expires.
"2026-07-07T08:15:00.000Z"
Was this page helpful?