curl --request POST \
--url https://avraapi.com/api/v1/sms/send \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--header 'X-API-SECRET: <api-key>' \
--data '
{
"send_method": "single",
"to": "RECIPIENT_NUMBER",
"message": "Text message"
}
'{
"success": true,
"request_id": "1af26040-c878-472f-88bd-6c5158905637",
"data": {
"send_method": "single",
"message_count": 1,
"credits_charged": 2000,
"provider_response": {
"status": "success",
"id": "4726abaf7ab34f31378"
}
}
}Send an SMS
Send one SMS, the same SMS to a bulk list, or different SMS messages to multiple recipients.
curl --request POST \
--url https://avraapi.com/api/v1/sms/send \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--header 'X-API-SECRET: <api-key>' \
--data '
{
"send_method": "single",
"to": "RECIPIENT_NUMBER",
"message": "Text message"
}
'{
"success": true,
"request_id": "1af26040-c878-472f-88bd-6c5158905637",
"data": {
"send_method": "single",
"message_count": 1,
"credits_charged": 2000,
"provider_response": {
"status": "success",
"id": "4726abaf7ab34f31378"
}
}
}X-Confirm-Send only after reviewing every recipient and message.API endpoint
https://avraapi.com/api/v1/sms/send
Request fields
| Field | Required | Rules |
|---|---|---|
send_method | Yes | One of single, bulk_same, or bulk_different. |
to | For single | One QuickSend-compatible Sri Lankan number: local 07XXXXXXXX or E.164 +947XXXXXXXX. |
message | For single and bulk_same | Message text. Input is capped at 4,096 characters and each recipient message may use at most three SMS units. |
recipients | For bulk_same | Array of 1–10,000 QuickSend-compatible Sri Lankan numbers. |
check_cost | No; bulk_same only | Boolean. With true, QuickSend returns campaign cost information instead of sending the bulk campaign. |
msg_list | For bulk_different | Array of 1–20 objects. Every object needs to and msg. |
msg_list[].to | For bulk_different | One QuickSend-compatible Sri Lankan number. |
msg_list[].msg | For bulk_different | Message text for that recipient, with the same three-unit maximum. |
single only. bulk_same and bulk_different require a Manual (BYOK) QuickSend integration. check_cost is forwarded only for bulk_same; setting it for bulk_different does not turn that request into a cost estimate and the messages are still sent.
SMS units and character limits
AvraAPI calculatesmessage_count from SMS units, not simply from the number of API requests. For predictable message sizing and billing, use 153 GSM-7 characters per SMS unit or 67 Unicode (UCS-2) characters per SMS unit. Each individual recipient message is limited to a maximum of 3 SMS units. Therefore, a single request can return a maximum message_count of 3; a bulk response reports the total units across all recipients and can be higher.
For example, a two-recipient bulk_same campaign with a one-unit message returns message_count: 2. A long or Unicode single message can return a message_count greater than one.
Result fields
| Field | Type | Notes |
|---|---|---|
send_method | string | The accepted AvraAPI send method. |
message_count | integer | Total calculated SMS units across the request. |
credits_charged | integer | AvraAPI credits charged for this request. Manual (BYOK) sends return 0; QuickSend may charge the connected provider account separately. |
provider_response | object | Raw QuickSend acceptance or cost-estimate response. Its fields vary by QuickSend operation. |
Single SMS
Request example
curl --request POST "https://avraapi.com/api/v1/sms/send" \
--header "X-API-KEY: YOUR_PROJECT_CLIENT_ID" \
--header "X-API-SECRET: YOUR_PROJECT_CLIENT_SECRET" \
--header "X-ENV: development" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data '{"send_method":"single","to":"RECIPIENT_NUMBER","message":"Text message"}'
Response example
{
"success": true,
"request_id": "1af26040-c878-472f-88bd-6c5158905637",
"data": {
"send_method": "single",
"message_count": 1,
"credits_charged": 2000,
"provider_response": {
"status": "success",
"id": "4726abaf7ab34f31378"
}
}
}
Bulk SMS with the same message
Request example
curl --request POST "https://avraapi.com/api/v1/sms/send" \
--header "X-API-KEY: YOUR_PROJECT_CLIENT_ID" \
--header "X-API-SECRET: YOUR_PROJECT_CLIENT_SECRET" \
--header "X-ENV: development" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data '{"send_method":"bulk_same","recipients":["FIRST_RECIPIENT_NUMBER","SECOND_RECIPIENT_NUMBER"],"message":"Text message","check_cost":true}'
Response example
{
"success": true,
"request_id": "2ddf0451-ab4d-47d6-877a-8d167d25d680",
"data": {
"send_method": "bulk_same",
"message_count": 2,
"credits_charged": 0,
"provider_response": {
"status": "success",
"id": "4726abaf95f01e62378"
}
}
}
Bulk SMS cost check
Request example
curl --request POST "https://avraapi.com/api/v1/sms/send" \
--header "X-API-KEY: YOUR_PROJECT_CLIENT_ID" \
--header "X-API-SECRET: YOUR_PROJECT_CLIENT_SECRET" \
--header "X-ENV: development" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data '{"send_method":"bulk_same","recipients":["FIRST_RECIPIENT_NUMBER","SECOND_RECIPIENT_NUMBER"],"message":"Text message","check_cost":true}'
Response example
{
"success": true,
"request_id": "d5ca2bbb-9cab-42ef-932a-62ef61470447",
"data": {
"send_method": "bulk_same",
"message_count": 2,
"credits_charged": 0,
"provider_response": {
"status": "success",
"campaign_data": {
"campaign_method": "Same Message To Bulk",
"campaign_type": "Transactional",
"sender_id": "APIX SENDER",
"campaign_total_cost": "1.12 LKR (0.56×2)",
"campaign_total_numbers": "2 Numbers",
"sms_msg_data": [
{
"msg": "BULK TRANSACTION TEST",
"unicode": "NO",
"msg_size": "1 SMS",
"per_sms_cost": "0.56 LKR",
"msg_cost": "0.56 LKR (1×0.56)"
}
]
}
}
}
}
Bulk SMS with different messages
Request example
curl --request POST "https://avraapi.com/api/v1/sms/send" \
--header "X-API-KEY: YOUR_PROJECT_CLIENT_ID" \
--header "X-API-SECRET: YOUR_PROJECT_CLIENT_SECRET" \
--header "X-ENV: development" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data '{"send_method":"bulk_different","msg_list":[{"to":"FIRST_RECIPIENT_NUMBER","msg":"First text message"},{"to":"SECOND_RECIPIENT_NUMBER","msg":"Second text message"}]}'
Response example
{
"success": true,
"request_id": "5bf45f1d-e0ee-4293-8a47-f033d1fb0c4a",
"data": {
"send_method": "bulk_different",
"message_count": 2,
"credits_charged": 0,
"provider_response": {
"status": "success",
"id": "4726abafafabbb0a378"
}
}
}
Error codes
| HTTP | error.code | When it happens | What to do |
|---|---|---|---|
401 | unauthorized | Credentials are missing, invalid, inactive, or do not match the selected environment. | Check your backend secret configuration and X-ENV. |
402 | insufficient_funds | A Managed SMS send requires AvraAPI credits that are unavailable. | Top up the AvraAPI wallet or reduce the message units before sending again. |
403 | forbidden | A Managed integration attempted bulk_same or bulk_different, or a trial destination restriction rejected the recipient. | Use single for Managed SMS, or configure Manual (BYOK) QuickSend for bulk sending. Check any trial recipient restriction before retrying. |
428 | send_confirmation_required | A Documentation Playground send did not explicitly acknowledge the real delivery action. | Review every recipient and message, then set X-Confirm-Send to true. This does not make an uncertain send safe to retry. |
422 | validation_failed | The request body does not satisfy the selected send-method fields. The response includes field details. | Correct the body and submit a new request. |
422 | provider_selection_failed | No active QuickSend SMS integration can be selected for the project environment. | Configure or enable the QuickSend integration for the selected environment. |
422 | http_error | The active integration is incomplete, the message exceeds three SMS units, or the SMS configuration cannot be used. | Correct the configuration or request; do not repeat an uncertain send. |
429 | rate_limit_exceeded | The configured request limit was reached. | Respect Retry-After when present; do not retry in a tight loop. |
500 | internal_error | The request could not complete unexpectedly. | Investigate with the request ID before deciding whether to submit a new send. |
502 | http_error | QuickSend rejected the request, returned an unexpected response, or its configured credentials failed. | Correct the request or integration. Do not repeat the same send until you know it was not accepted. |
503 | http_error | QuickSend was temporarily unreachable. | Treat delivery as uncertain; check your provider records before any manual retry. |
503 | project_paused | The project is paused. | Reactivate the project before retrying. |
request_id or X-APIX-Request-ID response header with your support record. It is the safest way for AvraAPI support to trace a request.Playground resources
The generated reference below lists this endpoint’s API standard details: request fields, authorizations, and response schema. The complete integration guide, request and response examples, and endpoint-specific error handling are above.Authorizations
Your Development project's Client ID. Enter your own value in the Documentation Playground.
Your Development project's Client Secret. Mintlify does not proxy these requests; the browser sends them directly to AvraAPI. Never enter a Production secret in the Documentation Playground.
Headers
Selects the Development credential environment. The Documentation Playground exposes Development values only; normal backend integrations may use their documented Production credentials outside this tool.
dev, development Requests a JSON response where the selected operation supports JSON.
"application/json"
Optional privacy override. Turn this on to request that AvraAPI suppress request-payload storage in observability logs for this request.
true
Documentation Playground safeguard for real SMS delivery. Turn this on only after reviewing every recipient and message. It is required for documentation-origin SMS send requests and does not make a timed-out send safe to retry.
true
Body
- Single SMS
- Bulk SMS
- Bulk Different
Fixed to single for this form.
single Local Sri Lankan 07XXXXXXXX or E.164 +947XXXXXXXX number. Replace this with the recipient number before sending.
20"RECIPIENT_NUMBER"
Message text. The released service limits each recipient message to three SMS units.
4096"Text message"
Was this page helpful?
