Base URLs
- Production:
https://api.revrag.ai - Staging:
https://staging-api.revrag.ai
Authentication
All API requests require an API key to be included in the request headers:Single Trigger APIs
🚀 Quick Start: Want to test these APIs immediately? Check out our Postman Collection with all endpoints pre-configured and ready to import!
1. Get All Agents
GET/v1/campaigns/agents
Get All Agents
Header Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
X-API-Key | string | Yes | API Key for authentication |
Response
Success (200 OK)cURL Example
2. Trigger Single Call
POST/v1/campaigns/trigger/single
Trigger a single AI call for testing purposes.
Header Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
X-API-Key | string | Yes | API Key for authentication |
Request Body
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
agent_id | string (uuid) | Yes | The ID of the agent |
to_phone_number | string | Yes | Recipient phone number |
variable_fields | object or null | No | Variable fields for the call |
custom_metadata | object or null | No | Custom metadata fields for tracking and organization. This field is flexible and can accept any key-value pairs |
Response
Success (200 OK)cURL Example
3. Get Call Status
GET/v1/campaigns/trigger/status/{call_id}
Get the status of a specific call by its call_id.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
call_id | string (uuid) | Yes | The ID of the call |
Header Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
X-API-Key | string | Yes | API Key for authentication |
Response
Success (200 OK)Response Parameters
| Parameter | Type | Description |
|---|---|---|
call_status | string | Current status of the call (QUEUED, RUNNING, or ENDED) |
call_id | string (uuid) | Unique identifier for the call |
agent_id | string (uuid) | ID of the agent used for this call |
from_number | string | Phone number from which the call was made |
to_number | string | Phone number to which the call was made |
summary | string | AI-generated summary of the call conversation |
start_time | string | ISO 8601 timestamp when the call started |
end_time | string | ISO 8601 timestamp when the call ended |
duration | number | Call duration in seconds |
disconnection_reason | string | Reason why the call ended (see Disconnection Reason Values) |
recording_url | string | URL to the call recording (MP4 format) |
transcription | object | Full transcription of the call with messages and timestamps |
custom_variables | array | AI-extracted variables from the conversation during the call |
variables_fields | object or null | The original variable fields that were passed when triggering the call (note: the request body uses variable_fields; the response key has an extra s) |
custom_metadata | object or null | The original custom metadata that was passed when triggering the call |
cURL Example
4. Webhook Notifications (Optional)
Instead of polling the call status endpoint, you can configure a webhook URL to receive real-time call completion notifications. When a call ends, we’ll automatically send the same response body structure as the “Get Call Status” API to your webhook endpoint.Webhook Configuration
Contact our support team at contact@revrag.ai to configure your webhook URL.Webhook Payload
The webhook will receive a POST request with the same JSON structure as the call status response, including the original values you passed asvariable_fields (echoed back on the payload as variables_fields) and custom_metadata:
Call Status Values
| Status | Description |
|---|---|
QUEUED | Call is queued for execution |
RUNNING | Call is currently in progress |
ENDED | Call has ended |
Disconnection Reason Values
When a call ends, thedisconnection_reason field indicates why the call was terminated:
| Reason | Description |
|---|---|
USER_HANGUP | The callee hung up the call |
USER_REJECTED | Callee rejected the call (busy) |
MAX_DURATION | The set maximum call duration was reached |
VOICEMAIL_REACHED | Voicemail was reached |
AGENT_HANGUP | The agent ended the call as per prompt or upon detecting conversation completion |
SILENCE_TIMEOUT | Callee was silent for longer than the configured silence timeout period |
CALL_NOT_PICKED | Call was not picked up by the callee |
ERROR_OCCURRED | An error occurred during the call |
CALL_NOT_CONNECTED | Call was not connected due to Telephony Issue |
CALL_DROPPED | Call was dropped in Between due to Network Issues |