Upload one file for outgoing messages, retained for four hours.
curl --request POST \
--url https://omni-api.sendblue.com/media \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--header 'Idempotency-Key: <idempotency-key>' \
--form 'file=@example-file;type=image/png'const form = new FormData();
form.append('file', '<string>');
const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
options.body = form;
fetch('https://omni-api.sendblue.com/media', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://omni-api.sendblue.com/media"
files = { "file": ("example-file", open("example-file", "rb"), "image/png") }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, files=files, headers=headers)
print(response.text){
"id": "99456418-e03a-484c-b42e-94b998ead0a3",
"content_type": "image/png",
"size_bytes": 2391,
"message_id": null,
"url": "https://api.example.com/v1/UploadedMediaContent/86bd74f1-355a-44c6-ab01-5f42eb480331/file",
"created_at": "2026-11-23T12:00:00.000000Z",
"expires_at": "2026-11-23T16:00:00.000000Z"
}{
"error": {
"code": "invalid_request",
"message": "Unknown field",
"details": {
"field": "colour"
}
}
}Upload one file for outgoing messages, retained for four hours.
A file may contain 1 byte through 4 MiB. The declared MIME type and file signature must agree. Each account can retain 256 active uploads and 64 MiB. Repeating the key with the same type and bytes returns the same upload while live. Malformed forms return 400, expired or erased replays return 404, a different file on the same key returns 409, oversize files return 413, unsupported files return 415, and exhausted capacity returns 429.
Required permission: media:write. Accepted credentials: a signed-in person, an API key, the account token.
POST
/
media
Upload one file for outgoing messages, retained for four hours.
curl --request POST \
--url https://omni-api.sendblue.com/media \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--header 'Idempotency-Key: <idempotency-key>' \
--form 'file=@example-file;type=image/png'const form = new FormData();
form.append('file', '<string>');
const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
options.body = form;
fetch('https://omni-api.sendblue.com/media', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://omni-api.sendblue.com/media"
files = { "file": ("example-file", open("example-file", "rb"), "image/png") }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, files=files, headers=headers)
print(response.text){
"id": "99456418-e03a-484c-b42e-94b998ead0a3",
"content_type": "image/png",
"size_bytes": 2391,
"message_id": null,
"url": "https://api.example.com/v1/UploadedMediaContent/86bd74f1-355a-44c6-ab01-5f42eb480331/file",
"created_at": "2026-11-23T12:00:00.000000Z",
"expires_at": "2026-11-23T16:00:00.000000Z"
}{
"error": {
"code": "invalid_request",
"message": "Unknown field",
"details": {
"field": "colour"
}
}
}Authorizations
personbearerlegacyKeyId & legacyKeySecret
Headers
Response
The stored file.