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)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:Bulk Campaign Management APIs
5. Create Campaign
POST/v1/campaigns
Creates a campaign linked to an AI agent.
Header Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
X-API-Key | string | Yes | API key issued to the client |
Content-Type | string | Yes | Must be application/json |
Request Body
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
agent_id | string | Yes | ID of the AI agent to associate with this campaign |
campaign_name | string | Yes | Unique name for the campaign (unique per tenant) |
description | string | No | Description of the campaign purpose |
metadata | object | No | Free-form key/value metadata for the campaign |
Response
Success (201 Created)6. Get Campaign
GET/v1/campaigns/{campaign_id}
Fetch metadata and current counters for a campaign.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
campaign_id | string | Yes | The campaign ID to retrieve |
Header Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
X-API-Key | string | Yes | API key issued to the client |
Response
Success (200 OK)7. Ingest Records (Data Intake)
POST/v1/campaigns/{campaign_id}/ingress
Ingest flat, uniform-schema records for AI calling. Records can be JSON array items or CSV rows. All records in a batch must share the same flat set of keys.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
campaign_id | string | Yes | The campaign ID to ingest data into |
Header Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
X-API-Key | string | Yes | API key issued to the client |
Content-Type | string | Yes | Either application/json or text/csv |
Request Body (JSON Format)
An array of flat objects; keys must match across all objects. Values must be primitives (string, number, boolean, null).Request Body (CSV Format)
First row defines the columns; each row must have the same number of columns.Validation Rules
- Flat only - Values must be primitives (string, number, boolean, null). Arrays/objects are rejected
- Uniform keys - First object (or CSV header) defines the schema; all rows must match exactly
- Consistent types - Each fieldโs type must be consistent across the batch
- Limits (defaults; per-tenant configurable):
- Max rows per request: 10,000
- Max JSON payload: 20 MB
- Max CSV payload: 50 MB
- Timestamps - If present, must be ISO-8601 (e.g.,
2024-01-04T10:00:00Z) - Optional uniqueness - If enabled per tenant, fields like
phone_numbermust be unique per day or campaign
Response
Success (201 Created) - All records acceptedCall 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_UNAVAILABLE | Callee did not respond in time |
USER_REJECTED | Callee rejected the call (busy) |
MAX_DURATION | The set maximum call duration was reached |
USER_HANGUP | The callee hung up the call |
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 |
ERROR_OCCURRED | An error occurred during the call |