curl -X POST https://api.magpipe.ai/functions/v1/list-phone-numbers \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/list-phone-numbers',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
}
);
const { numbers, total } = await response.json();
console.log(`You have ${total} numbers`);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/list-phone-numbers',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={}
)
data = response.json()
print(f"You have {data['total']} numbers")
{
"numbers": [
{
"id": "a1b2c3d4-5678-9012-3456-789012345678",
"phone_number": "+16045551234",
"friendly_name": "Main Line",
"agent_id": "550e8400-e29b-41d4-a716-446655440000",
"agent_name": "Sarah - Receptionist",
"text_agent_id": "660e8400-e29b-41d4-a716-446655440001",
"text_agent_name": "SMS Handler",
"capabilities": {
"voice": true,
"sms": true,
"mms": true
},
"is_active": true,
"created_at": "2024-01-10T10:00:00Z"
},
{
"id": "b2c3d4e5-6789-0123-4567-890123456789",
"phone_number": "+16045559999",
"friendly_name": "Support Line",
"agent_id": null,
"agent_name": null,
"text_agent_id": null,
"text_agent_name": null,
"capabilities": {
"voice": true,
"sms": true,
"mms": false
},
"is_active": true,
"created_at": "2024-01-12T14:00:00Z"
}
],
"total": 2
}
Phone Numbers
List Phone Numbers
List all phone numbers in your account
POST
/
list-phone-numbers
curl -X POST https://api.magpipe.ai/functions/v1/list-phone-numbers \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/list-phone-numbers',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
}
);
const { numbers, total } = await response.json();
console.log(`You have ${total} numbers`);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/list-phone-numbers',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={}
)
data = response.json()
print(f"You have {data['total']} numbers")
{
"numbers": [
{
"id": "a1b2c3d4-5678-9012-3456-789012345678",
"phone_number": "+16045551234",
"friendly_name": "Main Line",
"agent_id": "550e8400-e29b-41d4-a716-446655440000",
"agent_name": "Sarah - Receptionist",
"text_agent_id": "660e8400-e29b-41d4-a716-446655440001",
"text_agent_name": "SMS Handler",
"capabilities": {
"voice": true,
"sms": true,
"mms": true
},
"is_active": true,
"created_at": "2024-01-10T10:00:00Z"
},
{
"id": "b2c3d4e5-6789-0123-4567-890123456789",
"phone_number": "+16045559999",
"friendly_name": "Support Line",
"agent_id": null,
"agent_name": null,
"text_agent_id": null,
"text_agent_name": null,
"capabilities": {
"voice": true,
"sms": true,
"mms": false
},
"is_active": true,
"created_at": "2024-01-12T14:00:00Z"
}
],
"total": 2
}
Retrieve all phone numbers provisioned in your account with their current configuration.
Request Body
Response
curl -X POST https://api.magpipe.ai/functions/v1/list-phone-numbers \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/list-phone-numbers',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
}
);
const { numbers, total } = await response.json();
console.log(`You have ${total} numbers`);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/list-phone-numbers',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={}
)
data = response.json()
print(f"You have {data['total']} numbers")
{
"numbers": [
{
"id": "a1b2c3d4-5678-9012-3456-789012345678",
"phone_number": "+16045551234",
"friendly_name": "Main Line",
"agent_id": "550e8400-e29b-41d4-a716-446655440000",
"agent_name": "Sarah - Receptionist",
"text_agent_id": "660e8400-e29b-41d4-a716-446655440001",
"text_agent_name": "SMS Handler",
"capabilities": {
"voice": true,
"sms": true,
"mms": true
},
"is_active": true,
"created_at": "2024-01-10T10:00:00Z"
},
{
"id": "b2c3d4e5-6789-0123-4567-890123456789",
"phone_number": "+16045559999",
"friendly_name": "Support Line",
"agent_id": null,
"agent_name": null,
"text_agent_id": null,
"text_agent_name": null,
"capabilities": {
"voice": true,
"sms": true,
"mms": false
},
"is_active": true,
"created_at": "2024-01-12T14:00:00Z"
}
],
"total": 2
}