Skip to main content
POST
/
api
/
v1
/
calling
/
create-call
Create Call
curl --request POST \
  --url https://api.ravan.ai/api/v1/calling/create-call \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '
{
  "type": "outbound_call",
  "agent_id": "<string>",
  "from_phone_number": "<string>",
  "to_phone_number": "<string>",
  "metadata": {},
  "prompt_dynamic_variables": {}
}
'
{
  "access_token": "<string>",
  "message": "call created successfully",
  "room_id": "call_019eb7e0-075d-742b-91ea-94cddde0534a",
  "session_id": "019eb7e0-075d-742b-91ea-94cddde0534a",
  "success": true,
  "url": "<string>"
}

Authorizations

X-Api-Key
string
required
Your Agni API key used to authenticate the request. Pass it in the X-Api-Key header. Find or rotate it from your Ravan AI account settings.

Body

type
string
required
The call type to create. Use web_call for a browser-based call or outbound_call to place a phone call.
agent_id
string
required
The unique ID of the agent that should own, handle, or be assigned to this resource. Use the id returned by the Agent API.
from_phone_number
string
required
The caller ID used for outbound calls, in E.164 format. The number must be purchased, imported, or connected in Agni. Example: +14157774444.
to_phone_number
string
required
The destination phone number for an outbound call, in E.164 format. Example: +12137774445.
metadata
object
Custom key-value data to attach to the resource. Use this for IDs or attributes from your own systems.
prompt_dynamic_variables
object
Dynamic variables injected into the agent prompt for this call. Keys should match variables used in the prompt template.

Response

success
boolean
Whether the request succeeded.
message
string
Human-readable status message.
access_token
string
LiveKit access token.
room_id
string
Room ID for the created call session.
session_id
string
Call session UUID.
url
string
LiveKit WebSocket URL.
{
  "access_token": "<string>",
  "message": "call created successfully",
  "room_id": "call_019eb7e0-075d-742b-91ea-94cddde0534a",
  "session_id": "019eb7e0-075d-742b-91ea-94cddde0534a",
  "success": true,
  "url": "<string>"
}

Authorizations

X-Api-Key
string
header
required

Body

application/json
type
enum<string>
required

Call type

Available options:
web_call,
outbound_call
Example:

"outbound_call"

agent_id
string
required

Agent UUID

Example:

"<string>"

from_phone_number
string
required

Caller ID (for outbound)

Example:

"<string>"

to_phone_number
string
required

Destination phone (for outbound)

Example:

"<string>"

metadata
object

Custom key-value metadata

Example:
{}
prompt_dynamic_variables
object

Variables for agent prompt

Example:
{}

Response

200 - application/json

Successful response

success
boolean
message
string
access_token
string

LiveKit access token

room_id
string

Room ID for the created call session

session_id
string

Call session UUID

url
string

LiveKit WebSocket URL