Send one SMS (deprecated)
POST/v1/messages
Deprecated: use POST /v1/sms/messages, which takes the same body and gives the same responses. Every response carries the Deprecation and Sunset headers, which give the removal date, and a Link header to the migration guide.
- Scope
messages:send
Request
Every request needs an API key in the Authorization header, and the key needs the scope the endpoint names.
Parameters
Idempotency-Keyheaderstring1 to 64 characters from A-Z, a-z, 0-9,
_and-. Repeating a request with the same key and body within 24 hours returns the stored success response without acting again; the same key with a different body is refused with 409.- Matches ^[A-Za-z0-9_-]{1,64}$
Body
tostringRequiredThe recipient, in any common Nigerian or international format, such as
08031234567or+2348031234567.- At most 256 characters
fromstringRequiredThe sender ID: 3 to 11 letters, digits, spaces, hyphens or periods. It must be one of yours that can be used now.
- 3 to 11 characters
- Matches ^[A-Za-z0-9 .-]+$
bodystringRequiredThe message text, sent exactly as given. Placeholders such as
{{name}}are not filled in; send a batch to personalise.client_referencestringor nullYour own reference: 1 to 64 printable ASCII characters. You can filter messages by it.
- 1 to 64 characters
- Matches ^[\x20-\x7e]+$
send_atstring (date-time)or nullSchedule the send for this time, between 1 minute and 90 days from now. Omit it to send now.
{ "to": "08031234567", "from": "ACME", "body": "Your ACME code is 482913. It expires in 5 minutes.", "client_reference": "order-78123"}Responses
202 Accepted
ReturnsMessageEnvelope
The message.
Headers
Cache-ControlstringRequiredResponses are never cached.
DeprecationstringRequiredThis endpoint is deprecated. A request refused before it reaches the endpoint (413, 415) has none.
Idempotent-ReplayedstringPresent when this is the stored response of an earlier request with the same Idempotency-Key.
LinkstringRequiredThe migration guide, as
<url>; rel="deprecation". A request refused before it reaches the endpoint (413, 415) has none.LocationstringRequiredThe new message's URL,
/v1/messages/{id}.RateLimit-LimitintegerRequests per second your account may sustain.
RateLimit-RemainingintegerWhole requests left in your account's bucket.
RateLimit-ResetintegerSeconds until the bucket is full again.
SunsetstringRequiredThe HTTP-date after which this endpoint may be removed. A request refused before it reaches the endpoint (413, 415) has none.
X-Request-IdstringRequiredThis request's ID, also given as
request_idin error bodies. Quote it to support.
{ "data": { "id": "msg_01M3KR6CEGVQVV5PV6Q9J1G6SP", "object": "message", "amount": null, "body": "Your ACME code is 482913. It expires in 5 minutes.", "campaign_id": null, "channel": "sms", "client_reference": "order-78123", "completed_at": null, "created_at": "2026-09-28T10:15:30.000Z", "currency": "NGN", "direction": "outbound", "encoding": "gsm7", "error": null, "from": "ACME", "held_amount": "3.5000", "mode": "live", "scheduled_at": null, "segments": 1, "sent_at": null, "source": "api", "status": "queued", "to": "+2348031234567", "unit_price": null, "updated_at": "2026-09-28T10:15:30.000Z" }}Errors
Each code links to its page. Branch on the code, never on the title or detail.
- 401 Unauthorized
- 402 Payment Required
- 403 Forbidden
- 409 Conflict
- 413 Content Too Large
- 415 Unsupported Media Type
- 422 Unprocessable Content
- 429 Too Many Requests
- 500 Internal Server Error
- 503 Service Unavailable
{ "type": "https://docs.messaging.500calls.com/errors/validation_error", "title": "Validation error", "status": 422, "code": "validation_error", "detail": "No recipient could be accepted. No message was created.", "request_id": "req_01M3KR6CQ26S90NG2V790GVFTX", "errors": [ { "field": "to", "code": "invalid_recipient", "message": "Not a valid mobile number." } ]}Code samples
Each sample reads your key from the API_KEY_500CALLS environment variable.
curl -X POST 'https://api.messaging.500calls.com/v1/messages' \ -H "Authorization: Bearer $API_KEY_500CALLS" \ -H 'Content-Type: application/json' \ -H 'Idempotency-Key: order-78123-otp' \ -d '{ "to": "08031234567", "from": "ACME", "body": "Your ACME code is 482913. It expires in 5 minutes.", "client_reference": "order-78123"}'import osimport requestsresponse = requests.post( "https://api.messaging.500calls.com/v1/messages", headers={ "Authorization": f"Bearer {os.environ['API_KEY_500CALLS']}", "Idempotency-Key": "order-78123-otp", }, json={ "to": "08031234567", "from": "ACME", "body": "Your ACME code is 482913. It expires in 5 minutes.", "client_reference": "order-78123", }, timeout=30,)print(response.status_code, response.json())const response = await fetch("https://api.messaging.500calls.com/v1/messages", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY_500CALLS}`, "Content-Type": "application/json", "Idempotency-Key": "order-78123-otp", }, body: JSON.stringify({ "to": "08031234567", "from": "ACME", "body": "Your ACME code is 482913. It expires in 5 minutes.", "client_reference": "order-78123" }),});console.log(response.status, await response.json());<?php$curl = curl_init('https://api.messaging.500calls.com/v1/messages');curl_setopt_array($curl, [ CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_HTTPHEADER => [ 'Authorization: Bearer ' . getenv('API_KEY_500CALLS'), 'Content-Type: application/json', 'Idempotency-Key: order-78123-otp', ], CURLOPT_POSTFIELDS => json_encode([ 'to' => '08031234567', 'from' => 'ACME', 'body' => 'Your ACME code is 482913. It expires in 5 minutes.', 'client_reference' => 'order-78123', ]), CURLOPT_RETURNTRANSFER => true,]);$body = curl_exec($curl);$status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE);echo $status, PHP_EOL, $body, PHP_EOL;