api/javascript/telnyx-numbers-config-javascript/SKILL.md
Configure phone number settings including caller ID, call forwarding, messaging enablement, and connection assignments. This skill provides JavaScript SDK examples.
npx skillsauth add team-telnyx/telnyx-toolkit telnyx-numbers-config-javascriptInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
npm install telnyx
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
All examples below assume client is already initialized as shown above.
GET /phone_number_blocks/jobs
// Automatically fetches more pages as needed.
for await (const job of client.phoneNumberBlocks.jobs.list()) {
console.log(job.id);
}
GET /phone_number_blocks/jobs/{id}
const job = await client.phoneNumberBlocks.jobs.retrieve('id');
console.log(job.data);
Creates a new background job to delete all the phone numbers associated with the given block.
POST /phone_number_blocks/jobs/delete_phone_number_block — Required: phone_number_block_id
const response = await client.phoneNumberBlocks.jobs.deletePhoneNumberBlock({
phone_number_block_id: 'f3946371-7199-4261-9c3d-81a0d7935146',
});
console.log(response.data);
GET /phone_numbers
// Automatically fetches more pages as needed.
for await (const phoneNumberDetailed of client.phoneNumbers.list()) {
console.log(phoneNumberDetailed.id);
}
GET /phone_numbers/{id}
const phoneNumber = await client.phoneNumbers.retrieve('1293384261075731499');
console.log(phoneNumber.data);
PATCH /phone_numbers/{id}
const phoneNumber = await client.phoneNumbers.update('1293384261075731499');
console.log(phoneNumber.data);
DELETE /phone_numbers/{id}
const phoneNumber = await client.phoneNumbers.delete('1293384261075731499');
console.log(phoneNumber.data);
PATCH /phone_numbers/{id}/actions/bundle_status_change — Required: bundle_id
const response = await client.phoneNumbers.actions.changeBundleStatus('1293384261075731499', {
bundle_id: '5194d8fc-87e6-4188-baa9-1c434bbe861b',
});
console.log(response.data);
POST /phone_numbers/{id}/actions/enable_emergency — Required: emergency_enabled, emergency_address_id
const response = await client.phoneNumbers.actions.enableEmergency('1293384261075731499', {
emergency_address_id: '53829456729313',
emergency_enabled: true,
});
console.log(response.data);
GET /phone_numbers/{id}/voice
const voice = await client.phoneNumbers.voice.retrieve('1293384261075731499');
console.log(voice.data);
PATCH /phone_numbers/{id}/voice
const voice = await client.phoneNumbers.voice.update('1293384261075731499');
console.log(voice.data);
Verifies ownership of the provided phone numbers and returns a mapping of numbers to their IDs, plus a list of numbers not found in the account.
POST /phone_numbers/actions/verify_ownership — Required: phone_numbers
const response = await client.phoneNumbers.actions.verifyOwnership({
phone_numbers: ['+15551234567'],
});
console.log(response.data);
GET /phone_numbers/csv_downloads
// Automatically fetches more pages as needed.
for await (const csvDownload of client.phoneNumbers.csvDownloads.list()) {
console.log(csvDownload.id);
}
POST /phone_numbers/csv_downloads
const csvDownload = await client.phoneNumbers.csvDownloads.create();
console.log(csvDownload.data);
GET /phone_numbers/csv_downloads/{id}
const csvDownload = await client.phoneNumbers.csvDownloads.retrieve('id');
console.log(csvDownload.data);
GET /phone_numbers/jobs
// Automatically fetches more pages as needed.
for await (const phoneNumbersJob of client.phoneNumbers.jobs.list()) {
console.log(phoneNumbersJob.id);
}
GET /phone_numbers/jobs/{id}
const job = await client.phoneNumbers.jobs.retrieve('id');
console.log(job.data);
Creates a new background job to delete a batch of numbers.
POST /phone_numbers/jobs/delete_phone_numbers — Required: phone_numbers
const response = await client.phoneNumbers.jobs.deleteBatch({
phone_numbers: ['+19705555098', '+19715555098', '32873127836'],
});
console.log(response.data);
Creates a background job to update the emergency settings of a collection of phone numbers.
POST /phone_numbers/jobs/update_emergency_settings — Required: emergency_enabled, phone_numbers
const response = await client.phoneNumbers.jobs.updateEmergencySettingsBatch({
emergency_enabled: true,
phone_numbers: ['+19705555098', '+19715555098', '32873127836'],
});
console.log(response.data);
Creates a new background job to update a batch of numbers.
POST /phone_numbers/jobs/update_phone_numbers — Required: phone_numbers
const response = await client.phoneNumbers.jobs.updateBatch({
phone_numbers: ['1583466971586889004', '+13127367254'],
});
console.log(response.data);
GET /phone_numbers/regulatory_requirements
const phoneNumbersRegulatoryRequirement =
await client.phoneNumbersRegulatoryRequirements.retrieve();
console.log(phoneNumbersRegulatoryRequirement.data);
List phone numbers, This endpoint is a lighter version of the /phone_numbers endpoint having higher performance and rate limit.
GET /phone_numbers/slim
// Automatically fetches more pages as needed.
for await (const phoneNumberSlimListResponse of client.phoneNumbers.slimList()) {
console.log(phoneNumberSlimListResponse.id);
}
GET /phone_numbers/voice
// Automatically fetches more pages as needed.
for await (const phoneNumberWithVoiceSettings of client.phoneNumbers.voice.list()) {
console.log(phoneNumberWithVoiceSettings.id);
}
GET /v2/mobile_phone_numbers
// Automatically fetches more pages as needed.
for await (const mobilePhoneNumber of client.mobilePhoneNumbers.list()) {
console.log(mobilePhoneNumber.id);
}
GET /v2/mobile_phone_numbers/{id}
const mobilePhoneNumber = await client.mobilePhoneNumbers.retrieve('id');
console.log(mobilePhoneNumber.data);
PATCH /v2/mobile_phone_numbers/{id}
const mobilePhoneNumber = await client.mobilePhoneNumbers.update('id');
console.log(mobilePhoneNumber.data);
tools
Build cross-platform VoIP calling apps with React Native using Telnyx Voice SDK. High-level reactive API with automatic lifecycle management, CallKit/ConnectionService integration, and push notifications. Use for mobile VoIP apps with minimal setup.
tools
Build browser-based VoIP calling apps using Telnyx WebRTC JavaScript SDK. Covers authentication, voice calls, events, debugging, call quality metrics, and AI Agent integration. Use for web-based real-time communication.
tools
Build VoIP calling apps on iOS using Telnyx WebRTC SDK. Covers authentication, making/receiving calls, CallKit integration, PushKit/APNS push notifications, call quality metrics, and AI Agent integration. Use when implementing real-time voice communication on iOS.
tools
Build cross-platform VoIP calling apps with Flutter using Telnyx WebRTC SDK. Covers authentication, making/receiving calls, push notifications (FCM + APNS), call quality metrics, and AI Agent integration. Works on Android, iOS, and Web.