import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
});
const phoneNumberResponses = await client.phoneNumber.list();
console.log(phoneNumberResponses);
[
{
"phone_number": "+14157774444",
"phone_number_type": "retell-twilio",
"phone_number_pretty": "+1 (415) 777-4444",
"inbound_agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
"outbound_agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
"inbound_agent_version": 1,
"outbound_agent_version": 1,
"area_code": 415,
"nickname": "Frontdesk Number",
"inbound_webhook_url": "https://example.com/inbound-webhook",
"last_modification_timestamp": 1703413636133
}
]
List all phone numbers
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
});
const phoneNumberResponses = await client.phoneNumber.list();
console.log(phoneNumberResponses);
[
{
"phone_number": "+14157774444",
"phone_number_type": "retell-twilio",
"phone_number_pretty": "+1 (415) 777-4444",
"inbound_agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
"outbound_agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
"inbound_agent_version": 1,
"outbound_agent_version": 1,
"area_code": 415,
"nickname": "Frontdesk Number",
"inbound_webhook_url": "https://example.com/inbound-webhook",
"last_modification_timestamp": 1703413636133
}
]
Authentication header containing API key (find it in dashboard). The format is "Bearer YOUR_API_KEY"
Successfully retrieved all phone numbers.
The response is of type object[]
.
Was this page helpful?