> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.getraya.app/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.getraya.app/_mcp/server.

# Raya Voice AI core concepts

Understanding the key concepts will help you effectively use the Raya Voice AI platform.

## Agents

Agents are AI-powered voice assistants that can make calls and conduct conversations. Each agent has:

* **Instructions**: How the agent should behave and what to say
* **Output fields** (`output_fields`): **Array of key–description pairs.** Each item has `key` (field name, e.g. `customer_name`) and `description` (what to extract).
* **Output instructions** (`output_instructions`): **String.** Instructions for how to populate `output_fields` after a call.
* **Configuration**: Settings like silence detection, nudge timing, interruption, call duration, and telephony (see [Voice and runtime settings](#voice-and-runtime-settings-api) below)
* **Webhook URL**: Optional callback URL for call events
* **Call transfer** (`allow_call_transfer`, `transfer_destination_phone`): Optional India-only live transfer to a human. If `allow_call_transfer` is **true**, `transfer_destination_phone` is **required** (10 digits, no country code, e.g. `9876543210`). You cannot enable transfer with a blank number.
* **Inbound DID uniqueness**: Each `in_did` may only be assigned to **one** agent per team. Setting `in_did` on an agent clears that inbound DID on any other agent; the API response includes a `messages` array describing what changed.

### Voice and runtime settings (API)

When you **create** or **update** a regular agent via the API (`POST /api/agent`, `PATCH /api/agent/{id}`), you can optionally configure voice and call behavior. **All of these fields are optional** — omit any key you do not want to change.

| Field                          | Description                                                                                                                              |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `language_id`                  | UUID for **call language** — see [Language Options](/voice-agents/language-options)                                                      |
| `voice_id`                     | UUID for **agent voice** — see [Voice Options](/voice-agents/voice-options)                                                              |
| `tools`                        | Function tools as `{ "llm_tools": [ ... ] }` (PATCH replaces the full list when sent). See [LLM function tools](/voice-agents/llm-tools) |
| `allow_interruption`           | Whether the caller can interrupt the agent                                                                                               |
| `min_user_speech_to_interrupt` | Minimum user speech (seconds) before interruption                                                                                        |
| `max_call_duration_mins`       | Maximum call length in minutes                                                                                                           |
| `say_hello`                    | Whether the agent greets at call start                                                                                                   |
| `voicemail_msg`                | Message when voicemail is detected                                                                                                       |
| `call_duration_exceed_message` | Message when max call duration is reached                                                                                                |
| `out_did` / `in_did`           | Outbound / inbound phone numbers (must be assigned to your team). PATCH `in_did: null` clears inbound DID.                               |

> **Note**
>
> **Supported language and voice options:** Language and voice choices are configured **per team**. The API accepts UUIDs (`language_id`, `voice_id`) only if they are enabled for your account. See [Language Options](/voice-agents/language-options) and [Voice Options](/voice-agents/voice-options). Your team may only allow a subset — confirm with your administrator.

> **Note**
>
> **Language model:** Configured automatically when an agent is created. You cannot set or change it through the Agents API.

**PATCH behavior:** Send only the fields you want to change. Omitted keys stay as-is. For the new voice/runtime fields, do **not** send `null` — omit the key instead. To clear `voicemail_msg` or `call_duration_exceed_message`, send an empty string `""`.

### Regular Agents

General-purpose agents for various use cases like customer support, surveys, notifications, etc.

### Job Agents

Specialized agents designed for recruitment workflows with:

* **Template fields**: **Agent role** (`agent_role`), introduction, about job/company, closing message, and interview questions.
* **Agent role vs job role**: **Agent role** (`agent_role`) is how the voice agent should behave (e.g. “prescreening interviewer”). It is distinct from **job role**, which is the position being hired for (e.g. “Senior Python Developer”).
* **Output fields** (`output_fields`) and **output instructions** (`output_instructions`): Same as regular agents — `output_fields` is an **array of key–description pairs** (`key`, `description`); `output_instructions` is a **string**.
* **Generate from JD** (`generate_from_jd_text`): Optional job description (JD) text. When provided, the API generates template content (agent_role, introduction, about_job, etc.) and merges it with any fields you already supplied. Fields you provide are used as context (e.g. your custom introduction or agent_role).
* Job agent **type**: `hr_pre_screening`, `hr_mock_interview`, or `hr_interview`
* **Call transfer** (`allow_call_transfer`, `transfer_destination_phone`): Same as regular agents — India-only; **10-digit** mobile without country code when a transfer destination is set.

### Updating agents

Agents and job agents can be updated via `PATCH /api/agent/{id}` and `PATCH /api/job-agent/{id}` respectively.

* **PATCH body shape**:
  * **Agents**: `PATCH /api/agent/{id}` accepts the **same optional fields as create** (`name`, `instructions`, `output_fields`, `output_instructions`, [voice/runtime settings](#voice-and-runtime-settings-api), `webhook_url`, silence/nudge config, `out_did`, `in_did`, `allow_call_transfer`, `transfer_destination_phone`). Provided fields update the agent configuration.
  * **Job agents**: `PATCH /api/job-agent/{id}` accepts the **same fields as create** (`name`, `agent_role`, introduction/about job/company, extra/closing messages, questions, `output_fields`, `output_instructions`, webhook and config, `allow_call_transfer`, `transfer_destination_phone`). It **does not support** `generate_from_jd_text` on update. Provided fields replace the corresponding template and output configuration.

> **Warning**
>
> **Caution — PATCH replaces fields you send.** GET the agent first, merge your changes, then PATCH so you do not lose data.

### Deleting agents

Agents can be **deleted** via `DELETE /api/agent/{id}`.

**Warning — deletion is permanent:** Deleting an agent removes the agent and **all associated data**. The following will be permanently deleted and cannot be recovered:

* All **calls** and call history for this agent
* All **batches** and contacts for this agent
* All other related data (e.g. webhook logs, settings) tied to this agent

This action cannot be undone.

**Before deleting:** Stop any **active batch** for that agent. If the agent has a batch with status "Active", the API returns `400` with a message like: `Stop your batch (batch_id) before deleting`. Stop that batch first, then delete the agent.

## Calls

Individual phone call instances with:

* **Status tracking**: Pending → Completed/Failure
* **Transcripts**: Full conversation transcripts
* **Recordings**: Audio recordings of calls
* **Call metadata**: Duration, timestamps, phone numbers
* **Extracted data**: Structured data from conversations
* **Outcomes**: Success/failure status

### Call Statuses

* **Pending**: Call is dialing or in progress
* **Completed**: Call was answered and completed
* **Failure**: Call was not picked up or unable to dial

### Initiating a call (POST /api/call)

When you initiate a call, you may pass **agent_args** to send extra context to the agent (e.g. contact name, order ID). **agent_args must be a JSON object** `{}`, not an array. Example: `{"contact_name": "John", "order_id": "123"}`.

## Batches

Collections of contacts for batch calling campaigns with:

* **Scheduling**: Time zones, business hours, days of week
* **Retry logic**: Max retries, retry intervals
* **Concurrency control**: Simultaneous calls
* **Progress tracking**: Completed, unanswered, total contacts
* **Status management**: Pending, Running, Stopped

### Batch Configuration

* **Schedule**: When to make calls (timezone, hours, days)
* **Max retries**: How many times to retry failed calls
* **Retry after hours**: Wait time between retries
* **Concurrency**: Maximum simultaneous calls

## Contacts

Contact information stored in batches:

* **Contact name**: Name of the person to call
* **Contact phone**: Phone number (10 digits for India)
* **Country code**: Optional country code
* **Agent args**: Additional data passed to the agent during the call. Must be a **JSON object** `{}`, not an array (e.g. `{"contact_name": "John", "order_id": "123"}`).
* **Status**: Pending, Completed, Unanswered, Invalid
* **Call history**: All calls made to this contact

## User Interaction

### Nudging

Send messages to users during active calls to guide conversations:

* Real-time intervention
* Dynamic conversation management
* Context-aware messaging

## Rate Limits

* **Call initiation**: Per-key limit (default 1 per 20 seconds, configurable in key settings)
* **Other endpoints**: 1 request per second per API key

When rate limited, you'll receive a `429` status code with retry information.

## Concurrency Limits

Your account has a maximum number of concurrent calls. The system will return a `429` error if you exceed this limit.

## Webhooks

Optional callback URLs for receiving call events. Your webhook is invoked in two cases:

* **Call completed** — when the call was answered and finished
* **Call failed** — when the call was not picked up, could not be dialed, or otherwise failed

Your webhook receives a **POST** request with a JSON body. You can expect the following data:

### Webhook payload

| Field                | Type           | Description                                                                             |
| -------------------- | -------------- | --------------------------------------------------------------------------------------- |
| `uuid`               | string         | Unique call identifier                                                                  |
| `caller_no`          | string         | Caller phone number                                                                     |
| `to_number`          | string         | Callee/destination phone number                                                         |
| `in_did`             | number \| null | Inbound DID number                                                                      |
| `out_did`            | number \| null | Outbound DID number                                                                     |
| `call_transcript`    | array          | Conversation messages (on **Completed** calls); may be empty on **Failure**             |
| `call_recording_url` | string         | URL to the call recording (on **Completed**); may be empty on **Failure**               |
| `outcome`            | string         | `"Completed"` or `"Failure"` — use this to distinguish success vs failure               |
| `call_start_time`    | string         | ISO 8601 start time (UTC)                                                               |
| `call_end_time`      | string         | ISO 8601 end time (UTC)                                                                 |
| `call_duration`      | number         | Call duration in seconds                                                                |
| `agent_id`           | string         | Agent UUID                                                                              |
| `agent_args`         | object         | The same `agent_args` object `{}` you passed for this contact/call                      |
| `timezone`           | string         | Timezone used for the call (e.g. `"UTC"`)                                               |
| `call_output`        | object         | Extracted data from the conversation (on **Completed**); typically empty on **Failure** |
| `created_at`         | string         | ISO 8601 creation time (UTC)                                                            |
| `batch_id`           | string \| null | Batch ID if the call was part of a batch                                                |
| `contact_id`         | string \| null | Contact ID if the call was part of a batch                                              |

All timestamp fields (`call_start_time`, `call_end_time`, `created_at`) are in **UTC** (ISO 8601 with `Z` suffix).

* **Event-driven integrations**: Use the payload to update your CRM, sheets, or other systems. Check `outcome` to handle completed vs failed calls.

## Timezones

All scheduling and time-based operations use IANA timezone identifiers:

* `Asia/Kolkata` - India Standard Time
* `America/New_York` - Eastern Time
* `Europe/London` - GMT/BST
* `UTC` - Coordinated Universal Time

## Phone Numbers

* **Format**: 10 digits for India (e.g., "1234567890")
* **Country code**: Optional, defaults to "91" for India
* **DID**: Direct Inward Dialing number for outbound calls

## Data Extraction

Agents can extract structured data from conversations:

* Custom output fields
* JSON format responses
* Integration with external systems