Skip to navigation

Getting started with Raya Voice AI Agents

Quick start guide for Raya Voice AI Agents API
View as Markdown

This guide will help you get up and running with Raya Voice AI Agents API.

Prerequisites

  • An API key (contact your administrator)
  • HTTP client (cURL, Postman, or your preferred tool)
  • Basic understanding of REST APIs

Step 1: List Your Agents

See all available agents:

curl "https://v1.getraya.app/api/agent" \
-H "X-API-Key: <YOUR_API_KEY>"

Response:

{
"agents": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Customer Support Agent",
"created_at": "2024-01-15T10:25:00Z"
}
],
"total": 1,
"offset": 0,
"limit": 10
}

Step 2: Initiate a Call

Make a call using an agent. Optional agent_args lets you pass extra context (e.g. contact name, order ID); it must be a JSON object {}, not an array.

curl -X POST https://v1.getraya.app/api/call \
-H "X-API-Key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "123e4567-e89b-12d3-a456-426614174000",
"to_number": "1234567890",
"country_code": "91",
"timezone": "Asia/Kolkata",
"agent_args": {"contact_name": "John", "order_id": "123"}
}'

Response:

{
"message": "Call initiated successfully",
"uuid": "123e4567e89b12d3a456426614174000"
}

Step 3: Check Call Status

Poll for call completion (recommended: every 2 minutes):

curl "https://v1.getraya.app/api/call/123e4567e89b12d3a456426614174000" \
-H "X-API-Key: <YOUR_API_KEY>"

Response:

{
"uuid": "123e4567e89b12d3a456426614174000",
"outcome": "Completed",
"call_start_time": "2024-01-15T10:30:00Z",
"call_end_time": "2024-01-15T10:35:00Z",
"call_duration": 300,
"call_transcript": {...},
"call_recording_url": "https://example.com/recordings/call-123.wav"
}

Step 4: Create or configure an agent (Optional)

Create a new agent with optional voice and runtime settings. Only name is required.

curl -X POST https://v1.getraya.app/api/agent \
-H "X-API-Key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "Customer Support Agent",
"instructions": "You are a helpful support agent.",
"say_hello": true,
"max_call_duration_mins": 30
}'

Use GET /api/agent/{id} to read full configuration (including language_id, voice_id, tools, and call messages). Use PATCH /api/agent/{id} to update individual fields.

For language_id and voice_id UUIDs, see Language Options and Voice Options. Enabled options vary per team — confirm with your administrator if a UUID is rejected.

See Core Concepts — Voice and runtime settings for all optional fields. For tools, see LLM function tools.

Step 5: Create a Batch (Optional)

For multiple calls, create a batch:

curl -X POST https://v1.getraya.app/api/batch \
-H "X-API-Key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "123e4567-e89b-12d3-a456-426614174000",
"batch_name": "Customer Follow-up",
"contacts": [
{
"contact_name": "John Doe",
"contact_phone": "1234567890",
"country_code": "91"
}
]
}'

Next Steps