Skip to main content

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:
  1. 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.
  2. 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
The JWT token returned is active for 1 hour. This token must be passed with the Message API to successfully authenticate message requests.

Error Response

Status Code: 401 Unauthorized
This error indicates an issue with the provided credentials.

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
All messages with "status": "created" have been successfully scheduled.

Error Response

Status Code: 201 Created (partial success)
Messages with "status": "invalid" contain errors. The error field provides details about what went wrong.

Example Request and Response

Request

Response

The first message was successfully created (status: 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
Query Parameters If no filters are applied, all messages are returned. Results are ordered newest first (-created) by default. Example Request
Example Response Status Code: 200 OK
audio_url and call_transcription are null above because the request did not opt in to them. See Optional Attempt Fields.
Error Responses

2. Retrieve a Single Message

Fetch full details for one message by its ID. Returns a flat JSON object - no pagination wrapper. Endpoint
Path Parameters 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
Example Response Status Code: 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_on and send_by are returned in a different timestamp format (e.g. 2026-05-28 12:13:15.215215+00:00, space-separated) than created, modified, and the nested attempts timestamps (e.g. 2026-05-29T16:20:06.902181+05:30, ISO 8601 with a T separator 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 on entities, audio_url and call_transcription: all three are only meaningful for CAI (Cloud AI conversational) templates and will always be null for 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, so audio_url may 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.
Both keys are always present in the response. A 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 to In Progress until its scheduled send time.
  • First attempt: the first attempt is placed shortly after send_on and should be reflected in the API response at least 30–35 minutes after send_on. Do not expect the attempts array 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 own delivery_status, entities, audio_url) will appear in the attempts array as it runs. Continue polling until state becomes Completed or Stopped.
  • After Completed: for IVR attempts, no further changes will occur - stop polling. For CAI attempts, entities are typically already present, but audio_url may still show the pending message. In that case, poll once more after 24 hours past the last attempt’s execution_time to fetch the signed URL, then stop.
Completed means all attempts finished executing - it does not mean the call was answered. Check the attempts array’s delivery_status values to determine the actual outcome.
If a message is Stopped with execution_state_reason_code = "Insufficient asset balance" (or another pre-execution reason), it may have attempts: [] - no calls were placed, and there will be no entities or audio to fetch.

Error Handling

HTTP Status Codes

Common Error Scenarios

Invalid Credentials

Solution: Verify email and password are correct.

Invalid Phone Number

Solution: Ensure phone number is in valid international format (e.g., +9194XXXXXXXX).

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
Verify the message id is correct and belongs to your tenant. Malformed ID in URL - 404 Not Found
Ensure the id in the URL path is a valid integer. Invalid Filter Value - 400 Bad Request
Check that query parameter values match the expected type - integers for id-based filters, YYYY-MM-DDTHH:MM:SS for send_on-based filters. Invalid Page Number - 404 Not Found
Check next in the previous response before requesting the next page, rather than incrementing a counter blindly.

Best Practices

  1. 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.
  2. Batch Processing: Group messages in batches of up to 10,000 for optimal performance.
  3. Error Handling: Always check the status field in the response for each message. Messages can fail individually while others succeed.
  4. Phone Number Format: Always use international format with country code (e.g., +91 for India).
  5. Retry Logic: Implement exponential backoff for 502, 504, and 5xx errors.
  6. Rate Limiting: Be mindful of processing times when sending large batches of messages.

Support

For technical support or questions about API integration, please contact: