API docs
Get an API keySend messages from your own server.
Overview
- Base URL
- https://sms.rayenda.com.anjumanara.com/api/v1
- Format
- application/json
- Authentication
- Bearer API key
| Method | Address | What it does |
|---|---|---|
| POST | /api/v1/sms | Send one message. |
| POST | /api/v1/sms/bulk | Send the same text to many numbers. |
| GET | /api/v1/sms/{id} | See what became of a message. |
| GET | /api/v1/balance | See your credits. |
- Times are UTC, in ISO 8601:
2026-10-06T09:15:02Z. - Credits are written as a decimal string:
"0.35". - A request that is refused answers with an error; nothing is sent and nothing is charged.
Authentication
Send your API key with every request, in the Authorization header. Keys are made on the API keys page.
Authorization: Bearer rs_live_YOUR_KEY
- A key with a server IP works from that address only.
- A revoked key is refused at once and cannot be brought back.
Keep keys on your server. Never put one in a web page or a mobile app.
Send an SMS
POST/api/v1/sms
The message is checked, charged and answered as queued; it goes to the network right after. Sending the same request twice sends two messages.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| to | string | Yes | The number, with its country code: 8801712345678. See phone numbers. |
| message | string | Yes | The text, in any language, up to 10 parts. See parts and cost. |
| sender_id | string | No | One of your approved sender IDs, in capitals or not. With it the message is masking: it shows this name and costs the masking rate. Without it the message is non-masking. |
curl -X POST https://sms.rayenda.com.anjumanara.com/api/v1/sms \
-H "Authorization: Bearer rs_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "8801712345678",
"message": "Your code is 4821"
}'
$curl = curl_init('https://sms.rayenda.com.anjumanara.com/api/v1/sms');
curl_setopt_array($curl, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer rs_live_YOUR_KEY',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'to' => '8801712345678',
'message' => 'Your code is 4821',
]),
]);
$answer = json_decode(curl_exec($curl), true);
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
if ($status === 201) {
echo $answer['id']; // SMS-7KQ2M9XB4TRW
} else {
echo $answer['error']['code']; // insufficient_credits, invalid_number, …
}
const response = await fetch('https://sms.rayenda.com.anjumanara.com/api/v1/sms', {
method: 'POST',
headers: {
'Authorization': 'Bearer rs_live_YOUR_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
to: '8801712345678',
message: 'Your code is 4821',
}),
});
const answer = await response.json();
if (response.status === 201) {
console.log(answer.id); // SMS-7KQ2M9XB4TRW
} else {
console.log(answer.error.code); // insufficient_credits, invalid_number, …
}
{
"id": "SMS-7KQ2M9XB4TRW",
"status": "queued",
"to": "8801712345678",
"sender_id": null,
"message": "Your code is 4821",
"encoding": "gsm",
"parts": 1,
"cost": "0.35",
"refunded": false,
"error": null,
"created_at": "2026-10-06T09:15:02Z",
"sent_at": null,
"delivered_at": null,
"failed_at": null
}
Keep the id: it is how you ask for the message later. The fields are explained there.
Send to many
POST/api/v1/sms/bulk
The same text to up to 1,000 numbers in one request. Every number becomes a message with its own ID.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| to | list of strings | Yes | The numbers, each with its country code. At most 1,000. |
| message | string | Yes | The text every number gets. |
| sender_id | string | No | As in Send an SMS; it applies to all the numbers. |
- A number that cannot be sent to is left out and listed under
rejectedwith its reason. The others are sent. - When there are not enough credits for all of them, the whole request is refused with
insufficient_credits. - When no number can be sent to, the request is refused with
no_valid_numbers.
curl -X POST https://sms.rayenda.com.anjumanara.com/api/v1/sms/bulk \
-H "Authorization: Bearer rs_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": ["8801712345678", "8801812345678", "01912345678"],
"message": "We are open until 10 pm today.",
"sender_id": "MyShop"
}'
{
"count": 2,
"parts": 2,
"cost": "1.10",
"messages": [
{
"id": "SMS-4HXN8PQ2WK7D",
"to": "8801712345678",
"sender_id": "MyShop",
"status": "queued",
"parts": 1,
"cost": "0.55"
},
{
"id": "SMS-9TB3RZ6MCY5F",
"to": "8801812345678",
"sender_id": "MyShop",
"status": "queued",
"parts": 1,
"cost": "0.55"
}
],
"rejected": [
{
"to": "01912345678",
"code": "invalid_number",
"message": "The number is not a valid phone number. Write it with its country code, for example 8801712345678."
}
]
}
| Field | Description |
|---|---|
| count | Messages that were accepted. |
| parts | Parts of all of them together. |
| cost | Credits charged for the request. |
| messages | One entry for each accepted number, with the id to ask for it later. |
| rejected | The numbers that were left out: to as you wrote it, an error code and a message. Empty when all went through. |
Get a message
GET/api/v1/sms/{id}
What became of a message you sent, from the API or the panel. Delivery is not pushed to your server; ask with the ID.
curl https://sms.rayenda.com.anjumanara.com/api/v1/sms/SMS-7KQ2M9XB4TRW \
-H "Authorization: Bearer rs_live_YOUR_KEY"
{
"id": "SMS-7KQ2M9XB4TRW",
"status": "delivered",
"to": "8801712345678",
"sender_id": null,
"message": "Your code is 4821",
"encoding": "gsm",
"parts": 1,
"cost": "0.35",
"refunded": false,
"error": null,
"created_at": "2026-10-06T09:15:02Z",
"sent_at": "2026-10-06T09:15:03Z",
"delivered_at": "2026-10-06T09:15:06Z",
"failed_at": null
}
| Field | Type | Description |
|---|---|---|
| id | string | The ID of the message. |
| status | string | Where the message is now. See statuses. |
| to | string | The number, in digits only. |
| sender_id | string or null | The sender ID it went out under; null for a non-masking message. |
| message | string | The text. |
| encoding | string | gsm or unicode. |
| parts | integer | Parts the message was charged for. |
| cost | string | Credits charged. |
| refunded | boolean | True when the message failed and its cost was given back. |
| error | string or null | Why the message failed. |
| created_at | string | When the message was accepted. |
| sent_at | string or null | When the network took it. |
| delivered_at | string or null | When it arrived. |
| failed_at | string or null | When it failed. |
Balance
GET/api/v1/balance
curl https://sms.rayenda.com.anjumanara.com/api/v1/balance \
-H "Authorization: Bearer rs_live_YOUR_KEY"
{
"balance": "498.60",
"expires_at": "2027-04-06T09:15:02Z",
"package": "Standard"
}
| Field | Type | Description |
|---|---|---|
| balance | string | Credits you can spend now. |
| expires_at | string or null | Until when the credits are valid. |
| package | string or null | The package whose rates apply. |
Phone numbers
- Write every number with its country code, with or without the plus:
8801712345678or+8801712345678. Spaces, dashes and brackets are fine. - A local number such as
01712345678is refused withinvalid_number. The country is never guessed. - You can send to the countries that are switched on under Countries. An open country you have not switched on is refused with
country_not_enabled; a country we do not deliver to yet withcountry_not_available.
Parts and cost
A message is charged by the part. How much fits in a part depends on the characters in it.
| Encoding | Used for | One part | Longer messages |
|---|---|---|---|
| gsm | English letters, digits and common signs | 160 characters | 153 per part |
| unicode | Bangla, Arabic, emoji and everything else | 70 characters | 67 per part |
One character from outside the GSM alphabet makes the whole message unicode, and the limit drops from 160 to 70. An emoji does it, and so do the curly quotes (’ “ ”) and long dashes (–) that editors put in for you.
- In a GSM message
^ { } [ ] ~ | \ €count as two characters; in a unicode message an emoji counts as two. - A line break counts as one character.
- The longest message is 10 parts: 1,530 GSM or 670 unicode characters. A longer one is refused with
message_too_long. - The cost is the parts times the rate of the number's country on your package; masking and non-masking have their own rates. The answer carries it in
cost. - A message that fails gets its cost back, as long as your credits have not expired in the meantime;
refundedsays so.
Statuses
| Status | Meaning |
|---|---|
| queued | Accepted and charged, on its way to the network. |
| sending | Being handed to the network. |
| sent | The network took it; delivery is not confirmed yet. |
| delivered | It arrived on the phone. |
| failed | Not sent or not delivered. error has the reason. |
Errors
Every error has the same shape. Let your program check the code, it never changes; the message is for the person reading the log.
{
"error": {
"code": "insufficient_credits",
"message": "Not enough credits: this message costs 0.35."
}
}
| HTTP | Code | When |
|---|---|---|
| 401 | invalid_api_key | No key was sent, or there is no such key. |
| 401 | api_key_revoked | The key has been revoked. |
| 403 | ip_not_allowed | The key is tied to a server IP and the request came from another address. |
| 403 | account_suspended | The account is suspended. |
| 403 | account_not_verified | The account is not verified yet. |
| 429 | rate_limited | More than 600 requests in one minute with the same key. |
| 422 | invalid_request | A field is missing or of the wrong type, or the message is empty. |
| 403 | invalid_sender_id | The sender ID is not an approved one of your account. |
| 422 | message_too_long | The message needs more than 10 parts. |
| 422 | invalid_number | The number is not a valid phone number with its country code. |
| 422 | duplicate_number | Bulk only: the number is in the list more than once. |
| 403 | country_not_available | We do not deliver to this country yet. The open countries are listed on the pricing page. |
| 403 | country_not_enabled | The country is open, but not switched on for your account, or has no rate on your package. |
| 422 | unsubscribed | Bulk only: the number asked you to stop and is on your unsubscribed list in Contacts. A single message through Send an SMS still goes. |
| 422 | no_valid_numbers | Bulk only: none of the numbers can be sent to. |
| 402 | insufficient_credits | Not enough credits for the whole request. Nothing is sent, nothing is charged. |
| 404 | not_found | There is no message with this ID, or no such address. |
| 405 | method_not_allowed | The address does not take this method, a GET where a POST is needed for example. |
| 403 | forbidden | The request was refused for another reason; the message says why. |
| 500 | server_error | Something went wrong on our side. Try again in a moment; the message was not accepted. |
Rate limit
Each key may make 600 requests a minute. Beyond that the answer is 429 with rate_limited, and the Retry-After header says how many seconds to wait. To reach many numbers, use Send to many: it is one request.