Send a message.
curl --request POST \
--url https://omni-api.sendblue.com/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"to": "+14155550101"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({to: '+14155550101'})
};
fetch('https://omni-api.sendblue.com/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://omni-api.sendblue.com/messages"
payload = { "to": "+14155550101" }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"direction": "inbound",
"status": "scheduled",
"to": "+14155550100",
"from": "+14155550100",
"campaign_id": "<string>",
"body": "<string>",
"media_urls": [
"<string>"
],
"segments": 123,
"price": {
"amount_micro_usd": 7900,
"currency": "USD"
},
"error_code": 123,
"status_callback": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"sent_at": "2023-11-07T05:31:56Z",
"delivery_evidence": "verified",
"billing_status": "held",
"usage": {
"message_id": "<string>",
"direction": "outbound",
"service": "SMS",
"outcome": "<string>",
"reason": "<string>",
"carrier_status": "<string>",
"estimated_parts": 123,
"billed_parts": 123,
"maximum_hold": {
"amount": "4.00",
"amount_micro_usd": 4000000,
"currency": "USD"
},
"base_charge": {
"amount": "4.00",
"amount_micro_usd": 4000000,
"currency": "USD"
},
"surcharge_charged": {
"amount": "4.00",
"amount_micro_usd": 4000000,
"currency": "USD"
},
"total_charge": {
"amount": "4.00",
"amount_micro_usd": 4000000,
"currency": "USD"
},
"uncollected": {
"amount": "4.00",
"amount_micro_usd": 4000000,
"currency": "USD"
},
"inbox_message_id": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "Unknown field",
"details": {
"field": "colour"
}
}
}Send a message.
Name the sender with from, or let a campaign choose one of its numbers
with campaign_id. A scheduled message (send_at) needs campaign_id.
The price is held from the balance at acceptance.
Required permission: messages:send. Accepted credentials: a signed-in person, an API key, the account token.
POST
/
messages
Send a message.
curl --request POST \
--url https://omni-api.sendblue.com/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"to": "+14155550101"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({to: '+14155550101'})
};
fetch('https://omni-api.sendblue.com/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://omni-api.sendblue.com/messages"
payload = { "to": "+14155550101" }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"direction": "inbound",
"status": "scheduled",
"to": "+14155550100",
"from": "+14155550100",
"campaign_id": "<string>",
"body": "<string>",
"media_urls": [
"<string>"
],
"segments": 123,
"price": {
"amount_micro_usd": 7900,
"currency": "USD"
},
"error_code": 123,
"status_callback": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"sent_at": "2023-11-07T05:31:56Z",
"delivery_evidence": "verified",
"billing_status": "held",
"usage": {
"message_id": "<string>",
"direction": "outbound",
"service": "SMS",
"outcome": "<string>",
"reason": "<string>",
"carrier_status": "<string>",
"estimated_parts": 123,
"billed_parts": 123,
"maximum_hold": {
"amount": "4.00",
"amount_micro_usd": 4000000,
"currency": "USD"
},
"base_charge": {
"amount": "4.00",
"amount_micro_usd": 4000000,
"currency": "USD"
},
"surcharge_charged": {
"amount": "4.00",
"amount_micro_usd": 4000000,
"currency": "USD"
},
"total_charge": {
"amount": "4.00",
"amount_micro_usd": 4000000,
"currency": "USD"
},
"uncollected": {
"amount": "4.00",
"amount_micro_usd": 4000000,
"currency": "USD"
},
"inbox_message_id": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "Unknown field",
"details": {
"field": "colour"
}
}
}Authorizations
personbearerlegacyKeyId & legacyKeySecret
Headers
Body
application/json
Response
The message was accepted.
Evidence that an iMessage line sent the message. verified is the strongest evidence, read from the sending device's own record. reported means the device's authenticated report was corroborated by a second check. reported_unconfirmed means the report lacks that corroboration. The message status separately records recipient delivery.
Available options:
verified, unknown, reported, reported_unconfirmed