Send a message
The channels list holds the channels to send on, in order. Each entry is self-contained: the channel, the sender profile it goes out from, the recipient and the content.
One entry sends on one channel and that is the whole request. Several entries are tried in order - the message goes out on the first, and moves to the next only if that one does not deliver within its failover_after. There is no failover flag; the number of entries is what decides it.
The request is all-or-nothing: if any entry is invalid or cannot be sent, the whole request is rejected and nothing goes out.
Your API key as Authorization: Bearer <key>. The Bearer prefix is case-sensitive.
Your key can additionally be restricted to the addresses you send from. Give us the list as individual addresses or CIDR blocks - 203.0.113.4, 198.51.100.0/24, 2001:db8::/32 - and a request from anywhere else is rejected with IP_NOT_ALLOWED. IPv4 and IPv6 are listed separately: an IPv4 range does not cover you if you reach us over IPv6, so if you use both, send us both. Leave the restriction empty and we accept your key from any address.
Accepted for delivery. This is a 202, not a 200, on purpose: we have queued the message, not delivered it. The outcome arrives later in the delivery report.
Id for this message. One id covers every channel it is tried on, and it comes back as message_id in the delivery report. Store it - it is what we need for any support question about the message.
Indicative price for the first channel tried, in your account currency. null when no price could be resolved. This is only an estimate: a failover may deliver on a different, differently-priced channel, and the delivery report's cost is what was actually charged - the two may differ.
Something in the request is wrong. errors names each offending field. Fix the request before retrying - repeating it unchanged will fail the same way.
Your API key was not accepted. This status means only that - every other kind of rejection has its own status, so a 401 is always worth checking your key over.
Not enough balance to send. Top up and retry.
Your key is fine, but this send is not allowed. Retrying will not help - the code says what to fix, and most of these need us to change something on your account.
Something named in the request does not exist - the channel, the sender profile, or the URL itself.
Right URL, wrong method. This endpoint is POST only.
The request body is larger than we accept. A send is a small JSON document - content plus a short list of failover channels, with media sent by URL rather than inline - so this normally means something unintended was posted.
The body must be JSON, sent with Content-Type: application/json. A form or plain-text body is not accepted.
The request was understood but cannot be sent as it stands. Retrying it unchanged will not help.
You are sending faster than the rate agreed for your API key. The limit is a per-second one, so it clears almost immediately - wait out the Retry-After and send again. Nothing was sent, so the request is safe to repeat as-is.
Something went wrong on our side. Safe to retry.
No delivery route to that number at the moment. This one is temporary and on our side, so the same request may well succeed later.
POST /v1/messages HTTP/1.1
Host: channels.bind.hr
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 157
{
"channels": [
{
"channel": "viber",
"profile_id": "8f1c1b0e-4f6a-4b7e-9a2d-2c3b4d5e6f70",
"to": "385951234567",
"content": {
"text": "Your order #4182 has shipped."
}
}
]
}{
"request_id": "0f2b7a3c-8e4d-4a51-9f3b-1d6c7e8a9b01",
"cost": 0.015
}Last updated

