Overview
To align with industry standards, Awaaz.De uses REST APIs with simple and flexible architecture leading to easier implementation and integration. Partners need to integrate two APIs:- Login API: JWT-based authentication that allows partners to make a login request once and send multiple message requests using the same token. Partners only need to request login when the token expires. JWT access tokens are valid for 1 hour.
- Message API: Used to schedule automated voice call messages to customers.
Demo Code
Awaaz.De’s API integration demo code is available on GitHub and explains how to authenticate via the Login API, obtain a token, and send automated voice calls using the Message API. Demo code is available in:Login API
- Contact our team to set up your account.
- After account creation, you’ll receive key details like the tenant name, which you’ll need to include in every API request.
Endpoint
Request Body
Request Parameters
Success Response
Status Code:200 OK
Error Response
Status Code:401 Unauthorized
Message API
Endpoint
Authentication
Include the JWT token obtained from the Login API in the request headers:Request Body
Note: Request data should be customized based on your template and language requirements.
Request Parameters
Following parameters are part of data field:
Additional parameters like
day_of_month, installment_amount, month, and number_of_days are template-specific and should be included based on your template requirements.
Rate Limits
- 5,000 messages per request: approximately 30 seconds to process
- 10,000 messages per request: approximately 45-50 seconds to process
Success Response
Status Code:201 Created
"status": "created" have been successfully scheduled.
Error Response
Status Code:201 Created (partial success)
"status": "invalid" contain errors. The error field provides details about what went wrong.
Example Request and Response
Request
Response
created), while the second message failed due to an invalid phone number (status: invalid).
GET - Message API
1. List Messages
Retrieve a paginated list of messages, with optional filters. Endpoint
If no filters are applied, all messages are returned. Results are ordered newest first (
-created) by default.
Example Request
200 OK
Error Responsesaudio_urlandcall_transcriptionarenullabove because the request did not opt in to them. See Optional Attempt Fields.
2. Retrieve a Single Message
Fetch full details for one message by its ID. Returns a flat JSON object - no pagination wrapper. Endpoint
Query Parameters
Filter and pagination parameters do not apply to this endpoint, but the two opt-in parameters above are accepted here exactly as they are on the list endpoint.
Example Request
200 OK
Use this endpoint to poll for status updates on a specific message - see Message States & Polling Guide below. Poll this endpoint rather than the list endpoint, since list results can shift across pages as new messages are created.Error Responses
Response Fields Reference
Note:send_onandsend_byare returned in a different timestamp format (e.g.2026-05-28 12:13:15.215215+00:00, space-separated) thancreated,modified, and the nestedattemptstimestamps (e.g.2026-05-29T16:20:06.902181+05:30, ISO 8601 with aTseparator and local offset). Parse each accordingly.
Execution State Reason Codes
Note: this field currently returns the human-readable Meaning text shown above (e.g. "Exceeded send_by datetime"), not the snake_case Code. Match against the Meaning column when checking this field’s value.
Attempt Object Fields
Note onentities,audio_urlandcall_transcription: all three are only meaningful for CAI (Cloud AI conversational) templates and will always benullfor IVR. For CAI calls, entities are typically populated within seconds of call completion, while the audio URL depends on a nightly upload cron on the FreeSWITCH slave, soaudio_urlmay show the pending message for up to 24h after the call before becoming a valid signed URL.
Optional Attempt Fields
audio_url and call_transcription are off by default. Each is returned as null unless the request explicitly opts in.
Both parameters are accepted on the list endpoint and the retrieve endpoint alike, and they are independent, so passing one does not enable the other.
Only the exact value
true enables a field, compared case-insensitively, so true, True and TRUE all work. Any other value, including 1, yes and false, leaves the field null.
null value means either the attempt is not a CAI attempt or the request did not opt in.
Message States & Polling Guide
When to poll
- Before
send_on: no need to poll. The message will not transition toIn Progressuntil its scheduled send time. - First attempt: the first attempt is placed shortly after
send_onand should be reflected in the API response at least 30–35 minutes aftersend_on. Do not expect theattemptsarray to be populated before then. - Backup / retry attempts: if the first attempt does not result in
Reached, backup attempts are placed later. The gap between attempts depends on the backup duration configured on the template (e.g. 1 hour, 3 hours) - poll at roughly that cadence rather than continuously. Each new attempt (with its owndelivery_status,entities,audio_url) will appear in theattemptsarray as it runs. Continue polling untilstatebecomesCompletedorStopped. - After
Completed: for IVR attempts, no further changes will occur - stop polling. For CAI attempts,entitiesare typically already present, butaudio_urlmay still show the pending message. In that case, poll once more after 24 hours past the last attempt’sexecution_timeto fetch the signed URL, then stop.
Completedmeans all attempts finished executing - it does not mean the call was answered. Check theattemptsarray’sdelivery_statusvalues to determine the actual outcome.
If a message isStoppedwithexecution_state_reason_code = "Insufficient asset balance"(or another pre-execution reason), it may haveattempts: []- no calls were placed, and there will be no entities or audio to fetch.
Error Handling
HTTP Status Codes
Common Error Scenarios
Invalid Credentials
Invalid Phone Number
Expired Token
Status Code:403 Forbidden
Solution: Re-authenticate using the Login API to obtain a new JWT token. Message Not Found - 404 Not Found
id is correct and belongs to your tenant.
Malformed ID in URL - 404 Not Found
id in the URL path is a valid integer.
Invalid Filter Value - 400 Bad Request
id-based filters, YYYY-MM-DDTHH:MM:SS for send_on-based filters.
Invalid Page Number - 404 Not Found
next in the previous response before requesting the next page, rather than incrementing a counter blindly.
Best Practices
- Token Management: Cache the JWT token and reuse it for multiple requests within the 1-hour validity period. Only request a new token when the current one expires.
- Batch Processing: Group messages in batches of up to 10,000 for optimal performance.
- Error Handling: Always check the
statusfield in the response for each message. Messages can fail individually while others succeed. - Phone Number Format: Always use international format with country code (e.g., +91 for India).
- Retry Logic: Implement exponential backoff for 502, 504, and 5xx errors.
- Rate Limiting: Be mindful of processing times when sending large batches of messages.
Support
For technical support or questions about API integration, please contact:- Email: info@awaaz.de