curl https://api.ringyo.ai/v1/phone-numbers/pn_abc123?include=stats \
-H "Authorization: Bearer YOUR_API_KEY"
const response = await fetch(
'https://api.ringyo.ai/v1/phone-numbers/pn_abc123?include=stats',
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
},
}
);
const phoneNumber = await response.json();
import requests
response = requests.get(
'https://api.ringyo.ai/v1/phone-numbers/pn_abc123',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
params={'include': 'stats'}
)
phone_number = response.json()
{
"id": "pn_abc123",
"phone_number": "+18005551234",
"friendly_name": "Main Business Line",
"country": "US",
"region": "CA",
"capabilities": {
"voice": true,
"sms": true
},
"status": "active",
"default_agent_id": "agent_abc123",
"stats": {
"total_calls": 5420,
"total_minutes": 18500,
"calls_this_month": 342,
"minutes_this_month": 1156
},
"created_at": "2024-01-10T08:00:00Z",
"updated_at": "2024-01-15T12:30:00Z"
}
{
"error": {
"code": "phone_number_not_found",
"message": "The specified phone number does not exist"
}
}
Phone Numbers
Get Phone Number
Retrieve details of a specific phone number
GET
/
v1
/
phone-numbers
/
{phone_number_id}
curl https://api.ringyo.ai/v1/phone-numbers/pn_abc123?include=stats \
-H "Authorization: Bearer YOUR_API_KEY"
const response = await fetch(
'https://api.ringyo.ai/v1/phone-numbers/pn_abc123?include=stats',
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
},
}
);
const phoneNumber = await response.json();
import requests
response = requests.get(
'https://api.ringyo.ai/v1/phone-numbers/pn_abc123',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
params={'include': 'stats'}
)
phone_number = response.json()
{
"id": "pn_abc123",
"phone_number": "+18005551234",
"friendly_name": "Main Business Line",
"country": "US",
"region": "CA",
"capabilities": {
"voice": true,
"sms": true
},
"status": "active",
"default_agent_id": "agent_abc123",
"stats": {
"total_calls": 5420,
"total_minutes": 18500,
"calls_this_month": 342,
"minutes_this_month": 1156
},
"created_at": "2024-01-10T08:00:00Z",
"updated_at": "2024-01-15T12:30:00Z"
}
{
"error": {
"code": "phone_number_not_found",
"message": "The specified phone number does not exist"
}
}
Request
Retrieve detailed information about a specific phone number.Headers
string
required
Bearer token for authentication. Format:
Bearer YOUR_API_KEYPath Parameters
string
required
The unique identifier of the phone number (e.g.,
pn_abc123)Query Parameters
string
Comma-separated list of additional data:
stats, recent_callsResponse
string
Unique identifier for the phone number
string
The phone number in E.164 format
string
Display name for the phone number
string
Two-letter country code
string
State or region code
object
Object with
voice and sms boolean fieldsstring
Current status:
active, pending, inactivestring
Agent ID for handling incoming calls
object
Usage statistics (when
include=stats)string
ISO 8601 creation timestamp
curl https://api.ringyo.ai/v1/phone-numbers/pn_abc123?include=stats \
-H "Authorization: Bearer YOUR_API_KEY"
const response = await fetch(
'https://api.ringyo.ai/v1/phone-numbers/pn_abc123?include=stats',
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
},
}
);
const phoneNumber = await response.json();
import requests
response = requests.get(
'https://api.ringyo.ai/v1/phone-numbers/pn_abc123',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
params={'include': 'stats'}
)
phone_number = response.json()
{
"id": "pn_abc123",
"phone_number": "+18005551234",
"friendly_name": "Main Business Line",
"country": "US",
"region": "CA",
"capabilities": {
"voice": true,
"sms": true
},
"status": "active",
"default_agent_id": "agent_abc123",
"stats": {
"total_calls": 5420,
"total_minutes": 18500,
"calls_this_month": 342,
"minutes_this_month": 1156
},
"created_at": "2024-01-10T08:00:00Z",
"updated_at": "2024-01-15T12:30:00Z"
}
{
"error": {
"code": "phone_number_not_found",
"message": "The specified phone number does not exist"
}
}
Error Codes
| Code | Description |
|---|---|
phone_number_not_found | The specified ID does not exist |
unauthorized | You don’t have access to this phone number |