curl -X POST https://api.ringyo.ai/v1/calls \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone_number": "+14155551234",
"agent_id": "agent_abc123",
"metadata": {
"customer_id": "cust_456",
"campaign": "follow_up"
}
}'
const response = await fetch('https://api.ringyo.ai/v1/calls', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
phone_number: '+14155551234',
agent_id: 'agent_abc123',
metadata: {
customer_id: 'cust_456',
campaign: 'follow_up'
}
})
});
const call = await response.json();
import requests
response = requests.post(
'https://api.ringyo.ai/v1/calls',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={
'phone_number': '+14155551234',
'agent_id': 'agent_abc123',
'metadata': {
'customer_id': 'cust_456',
'campaign': 'follow_up'
}
}
)
call = response.json()
{
"id": "call_xyz789",
"status": "queued",
"phone_number": "+14155551234",
"from_number": "+18005551234",
"agent_id": "agent_abc123",
"metadata": {
"customer_id": "cust_456",
"campaign": "follow_up"
},
"record": true,
"created_at": "2024-01-15T10:30:00Z"
}
{
"error": {
"code": "invalid_phone_number",
"message": "Phone number must be in E.164 format"
}
}
{
"error": {
"code": "insufficient_credits",
"message": "Your account has insufficient credits for this call"
}
}
{
"error": {
"code": "agent_not_found",
"message": "The specified agent does not exist"
}
}
Calls
Create Call
Initiate a new outbound phone call
POST
/
v1
/
calls
curl -X POST https://api.ringyo.ai/v1/calls \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone_number": "+14155551234",
"agent_id": "agent_abc123",
"metadata": {
"customer_id": "cust_456",
"campaign": "follow_up"
}
}'
const response = await fetch('https://api.ringyo.ai/v1/calls', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
phone_number: '+14155551234',
agent_id: 'agent_abc123',
metadata: {
customer_id: 'cust_456',
campaign: 'follow_up'
}
})
});
const call = await response.json();
import requests
response = requests.post(
'https://api.ringyo.ai/v1/calls',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={
'phone_number': '+14155551234',
'agent_id': 'agent_abc123',
'metadata': {
'customer_id': 'cust_456',
'campaign': 'follow_up'
}
}
)
call = response.json()
{
"id": "call_xyz789",
"status": "queued",
"phone_number": "+14155551234",
"from_number": "+18005551234",
"agent_id": "agent_abc123",
"metadata": {
"customer_id": "cust_456",
"campaign": "follow_up"
},
"record": true,
"created_at": "2024-01-15T10:30:00Z"
}
{
"error": {
"code": "invalid_phone_number",
"message": "Phone number must be in E.164 format"
}
}
{
"error": {
"code": "insufficient_credits",
"message": "Your account has insufficient credits for this call"
}
}
{
"error": {
"code": "agent_not_found",
"message": "The specified agent does not exist"
}
}
Request
Initiate an outbound call to a phone number using a specified agent.Headers
string
required
Bearer token for authentication. Format:
Bearer YOUR_API_KEYstring
required
Must be
application/jsonBody Parameters
string
required
The destination phone number in E.164 format (e.g.,
+14155551234)string
required
The ID of the agent to use for this call
string
The phone number to call from. Must be a number you own. Defaults to your primary number.
object
Custom key-value pairs to attach to the call for your reference
string
URL to receive real-time call events. Overrides account-level webhook settings.
boolean
default:"true"
Whether to record the call
integer
default:"3600"
Maximum call duration in seconds (1-3600)
Response
string
Unique identifier for the call
string
Current status:
queued, ringing, in_progress, completed, failedstring
The destination phone number
string
The agent ID used for the call
string
ISO 8601 timestamp of when the call was created
curl -X POST https://api.ringyo.ai/v1/calls \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone_number": "+14155551234",
"agent_id": "agent_abc123",
"metadata": {
"customer_id": "cust_456",
"campaign": "follow_up"
}
}'
const response = await fetch('https://api.ringyo.ai/v1/calls', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
phone_number: '+14155551234',
agent_id: 'agent_abc123',
metadata: {
customer_id: 'cust_456',
campaign: 'follow_up'
}
})
});
const call = await response.json();
import requests
response = requests.post(
'https://api.ringyo.ai/v1/calls',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={
'phone_number': '+14155551234',
'agent_id': 'agent_abc123',
'metadata': {
'customer_id': 'cust_456',
'campaign': 'follow_up'
}
}
)
call = response.json()
{
"id": "call_xyz789",
"status": "queued",
"phone_number": "+14155551234",
"from_number": "+18005551234",
"agent_id": "agent_abc123",
"metadata": {
"customer_id": "cust_456",
"campaign": "follow_up"
},
"record": true,
"created_at": "2024-01-15T10:30:00Z"
}
{
"error": {
"code": "invalid_phone_number",
"message": "Phone number must be in E.164 format"
}
}
{
"error": {
"code": "insufficient_credits",
"message": "Your account has insufficient credits for this call"
}
}
{
"error": {
"code": "agent_not_found",
"message": "The specified agent does not exist"
}
}
Error Codes
| Code | Description |
|---|---|
invalid_phone_number | Phone number is not in valid E.164 format |
agent_not_found | The specified agent_id does not exist |
insufficient_credits | Account doesn’t have enough credits |
rate_limit_exceeded | Too many concurrent calls |
invalid_from_number | The from_number is not owned by your account |