Skillquality 0.53

telnyx-numbers-javascript

>-

Price
free
Protocol
skill
Verified
no

What it does

<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->

Telnyx Numbers - JavaScript

Installation

npm install telnyx

Setup

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.

Error Handling

All API calls can fail with network errors, rate limits (429), validation errors (422), or authentication errors (401). Always handle errors in production code:

try {
  const availablePhoneNumbers = await client.availablePhoneNumbers.list();
} catch (err) {
  if (err instanceof Telnyx.APIConnectionError) {
    console.error('Network error — check connectivity and retry');
  } else if (err instanceof Telnyx.RateLimitError) {
    const retryAfter = err.headers?.['retry-after'] || 1;
    await new Promise(r => setTimeout(r, retryAfter * 1000));
  } else if (err instanceof Telnyx.APIError) {
    console.error(`API error ${err.status}: ${err.message}`);
    if (err.status === 422) {
      console.error('Validation error — check required fields and formats');
    }
  }
}

Common error codes: 401 invalid API key, 403 insufficient permissions, 404 resource not found, 422 validation error (check field formats), 429 rate limited (retry with exponential backoff).

Important Notes

  • Phone numbers must be in E.164 format (e.g., +13125550001). Include the + prefix and country code. No spaces, dashes, or parentheses.
  • Pagination: List methods return an auto-paginating iterator. Use for await (const item of result) { ... } to iterate through all pages automatically.

Reference Use Rules

Do not invent Telnyx parameters, enums, response fields, or webhook fields.

Core Tasks

Search available phone numbers

Number search is the entrypoint for provisioning. Agents need the search method, key query filters, and the fields returned for candidate numbers.

client.availablePhoneNumbers.list()GET /available_phone_numbers

ParameterTypeRequiredDescription
filterobjectNoConsolidated filter parameter (deepObject style).
const availablePhoneNumbers = await client.availablePhoneNumbers.list();

console.log(availablePhoneNumbers.data);

Response wrapper:

  • items: availablePhoneNumbers.data
  • pagination: availablePhoneNumbers.meta

Primary item fields:

  • phoneNumber
  • recordType
  • quickship
  • reservable
  • bestEffort
  • costInformation

Create a number order

Number ordering is the production provisioning step after number selection.

client.numberOrders.create()POST /number_orders

ParameterTypeRequiredDescription
phoneNumbersarray[object]Yes
connectionIdstring (UUID)NoIdentifies the connection associated with this phone number.
messagingProfileIdstring (UUID)NoIdentifies the messaging profile associated with the phone n...
billingGroupIdstring (UUID)NoIdentifies the billing group associated with the phone numbe...
...+1 optional params in references/api-details.md
const numberOrder = await client.numberOrders.create({
    phoneNumbers: [{"phone_number": "+18005550101"}],
});

console.log(numberOrder.data);

Primary response fields:

  • numberOrder.data.id
  • numberOrder.data.status
  • numberOrder.data.phoneNumbersCount
  • numberOrder.data.requirementsMet
  • numberOrder.data.messagingProfileId
  • numberOrder.data.connectionId

Check number order status

Order status determines whether provisioning completed or additional requirements are still blocking fulfillment.

client.numberOrders.retrieve()GET /number_orders/{number_order_id}

ParameterTypeRequiredDescription
numberOrderIdstring (UUID)YesThe number order ID.
const numberOrder = await client.numberOrders.retrieve('550e8400-e29b-41d4-a716-446655440000');

console.log(numberOrder.data);

Primary response fields:

  • numberOrder.data.id
  • numberOrder.data.status
  • numberOrder.data.requirementsMet
  • numberOrder.data.phoneNumbersCount
  • numberOrder.data.phoneNumbers
  • numberOrder.data.connectionId

Important Supporting Operations

Use these when the core tasks above are close to your flow, but you need a common variation or follow-up step.

Create a number reservation

Create or provision an additional resource when the core tasks do not cover this flow.

client.numberReservations.create()POST /number_reservations

ParameterTypeRequiredDescription
phoneNumbersarray[object]Yes
statusenum (pending, success, failure)NoThe status of the entire reservation.
idstring (UUID)No
recordTypestringNo
...+3 optional params in references/api-details.md
const numberReservation = await client.numberReservations.create({
    phoneNumbers: [{"phone_number": "+18005550101"}],
});

console.log(numberReservation.data);

Primary response fields:

  • numberReservation.data.id
  • numberReservation.data.status
  • numberReservation.data.createdAt
  • numberReservation.data.updatedAt
  • numberReservation.data.customerReference
  • numberReservation.data.errors

Retrieve a number reservation

Fetch the current state before updating, deleting, or making control-flow decisions.

client.numberReservations.retrieve()GET /number_reservations/{number_reservation_id}

ParameterTypeRequiredDescription
numberReservationIdstring (UUID)YesThe number reservation ID.
const numberReservation = await client.numberReservations.retrieve('550e8400-e29b-41d4-a716-446655440000');

console.log(numberReservation.data);

Primary response fields:

  • numberReservation.data.id
  • numberReservation.data.status
  • numberReservation.data.createdAt
  • numberReservation.data.updatedAt
  • numberReservation.data.customerReference
  • numberReservation.data.errors

List Advanced Orders

Inspect available resources or choose an existing resource before mutating it.

client.advancedOrders.list()GET /advanced_orders

const advancedOrders = await client.advancedOrders.list();

console.log(advancedOrders.data);

Response wrapper:

  • items: advancedOrders.data

Primary item fields:

  • id
  • status
  • areaCode
  • comments
  • countryCode
  • customerReference

Create Advanced Order

Create or provision an additional resource when the core tasks do not cover this flow.

client.advancedOrders.create()POST /advanced_orders

ParameterTypeRequiredDescription
phoneNumberTypeenum (local, mobile, toll_free, shared_cost, national, ...)No
requirementGroupIdstring (UUID)NoThe ID of the requirement group to associate with this advan...
countryCodestring (ISO 3166-1 alpha-2)No
...+5 optional params in references/api-details.md
const advancedOrder = await client.advancedOrders.create();

console.log(advancedOrder.id);

Primary response fields:

  • advancedOrder.id
  • advancedOrder.status
  • advancedOrder.areaCode
  • advancedOrder.comments
  • advancedOrder.countryCode
  • advancedOrder.customerReference

Update Advanced Order

Modify an existing resource without recreating it.

client.advancedOrders.updateRequirementGroup()PATCH /advanced_orders/{advanced-order-id}/requirement_group

ParameterTypeRequiredDescription
advanced-order-idstring (UUID)Yes
phoneNumberTypeenum (local, mobile, toll_free, shared_cost, national, ...)No
requirementGroupIdstring (UUID)NoThe ID of the requirement group to associate with this advan...
countryCodestring (ISO 3166-1 alpha-2)No
...+5 optional params in references/api-details.md
const response = await client.advancedOrders.updateRequirementGroup(
  '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);

console.log(response.id);

Primary response fields:

  • response.id
  • response.status
  • response.areaCode
  • response.comments
  • response.countryCode
  • response.customerReference

Get Advanced Order

Fetch the current state before updating, deleting, or making control-flow decisions.

client.advancedOrders.retrieve()GET /advanced_orders/{order_id}

ParameterTypeRequiredDescription
orderIdstring (UUID)Yes
const advancedOrder = await client.advancedOrders.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');

console.log(advancedOrder.id);

Primary response fields:

  • advancedOrder.id
  • advancedOrder.status
  • advancedOrder.areaCode
  • advancedOrder.comments
  • advancedOrder.countryCode
  • advancedOrder.customerReference

List available phone number blocks

Inspect available resources or choose an existing resource before mutating it.

client.availablePhoneNumberBlocks.list()GET /available_phone_number_blocks

ParameterTypeRequiredDescription
filterobjectNoConsolidated filter parameter (deepObject style).
const availablePhoneNumberBlocks = await client.availablePhoneNumberBlocks.list();

console.log(availablePhoneNumberBlocks.data);

Response wrapper:

  • items: availablePhoneNumberBlocks.data
  • pagination: availablePhoneNumberBlocks.meta

Primary item fields:

  • phoneNumber
  • costInformation
  • features
  • range
  • recordType
  • regionInformation

Retrieve all comments

Inspect available resources or choose an existing resource before mutating it.

client.comments.list()GET /comments

ParameterTypeRequiredDescription
filterobjectNoConsolidated filter parameter (deepObject style).
const comments = await client.comments.list();

console.log(comments.data);

Response wrapper:

  • items: comments.data
  • pagination: comments.meta

Primary item fields:

  • id
  • body
  • createdAt
  • updatedAt
  • commentRecordId
  • commentRecordType

Additional Operations

Use the core tasks above first. The operations below are indexed here with exact SDK methods and required params; use references/api-details.md for full optional params, response schemas, and lower-frequency webhook payloads. Before using any operation below, read the optional-parameters section and the response-schemas section so you do not guess missing fields.

OperationSDK methodEndpointUse whenRequired params
Create a commentclient.comments.create()POST /commentsCreate or provision an additional resource when the core tasks do not cover this flow.None
Retrieve a commentclient.comments.retrieve()GET /comments/{id}Fetch the current state before updating, deleting, or making control-flow decisions.id
Mark a comment as readclient.comments.markAsRead()PATCH /comments/{id}/readModify an existing resource without recreating it.id
Get country coverageclient.countryCoverage.retrieve()GET /country_coverageInspect available resources or choose an existing resource before mutating it.None
Get coverage for a specific countryclient.countryCoverage.retrieveCountry()GET /country_coverage/countries/{country_code}Fetch the current state before updating, deleting, or making control-flow decisions.countryCode
List customer service recordsclient.customerServiceRecords.list()GET /customer_service_recordsInspect available resources or choose an existing resource before mutating it.None
Create a customer service recordclient.customerServiceRecords.create()POST /customer_service_recordsCreate or provision an additional resource when the core tasks do not cover this flow.None
Verify CSR phone number coverageclient.customerServiceRecords.verifyPhoneNumberCoverage()POST /customer_service_records/phone_number_coveragesCreate or provision an additional resource when the core tasks do not cover this flow.None
Get a customer service recordclient.customerServiceRecords.retrieve()GET /customer_service_records/{customer_service_record_id}Fetch the current state before updating, deleting, or making control-flow decisions.customerServiceRecordId
List inexplicit number ordersclient.inexplicitNumberOrders.list()GET /inexplicit_number_ordersInspect available resources or choose an existing resource before mutating it.None
Create an inexplicit number orderclient.inexplicitNumberOrders.create()POST /inexplicit_number_ordersCreate or provision an additional resource when the core tasks do not cover this flow.orderingGroups
Retrieve an inexplicit number orderclient.inexplicitNumberOrders.retrieve()GET /inexplicit_number_orders/{id}Fetch the current state before updating, deleting, or making control-flow decisions.id
Create an inventory coverage requestclient.inventoryCoverage.list()GET /inventory_coverageInspect available resources or choose an existing resource before mutating it.None
List mobile network operatorsclient.mobileNetworkOperators.list()GET /mobile_network_operatorsInspect available resources or choose an existing resource before mutating it.None
List network coverage locationsclient.networkCoverage.list()GET /network_coverageInspect available resources or choose an existing resource before mutating it.None
List number block ordersclient.numberBlockOrders.list()GET /number_block_ordersInspect available resources or choose an existing resource before mutating it.None
Create a number block orderclient.numberBlockOrders.create()POST /number_block_ordersCreate or provision an additional resource when the core tasks do not cover this flow.startingNumber, range
Retrieve a number block orderclient.numberBlockOrders.retrieve()GET /number_block_orders/{number_block_order_id}Fetch the current state before updating, deleting, or making control-flow decisions.numberBlockOrderId
Retrieve a list of phone numbers associated to ordersclient.numberOrderPhoneNumbers.list()GET /number_order_phone_numbersInspect available resources or choose an existing resource before mutating it.None
Retrieve a single phone number within a number order.client.numberOrderPhoneNumbers.retrieve()GET /number_order_phone_numbers/{number_order_phone_number_id}Fetch the current state before updating, deleting, or making control-flow decisions.numberOrderPhoneNumberId
Update requirements for a single phone number within a number order.client.numberOrderPhoneNumbers.updateRequirements()PATCH /number_order_phone_numbers/{number_order_phone_number_id}Modify an existing resource without recreating it.numberOrderPhoneNumberId
List number ordersclient.numberOrders.list()GET /number_ordersCreate or inspect provisioning orders for number purchases.None
Update a number orderclient.numberOrders.update()PATCH /number_orders/{number_order_id}Modify an existing resource without recreating it.numberOrderId
List number reservationsclient.numberReservations.list()GET /number_reservationsInspect available resources or choose an existing resource before mutating it.None
Extend a number reservationclient.numberReservations.actions.extend()POST /number_reservations/{number_reservation_id}/actions/extendTrigger a follow-up action in an existing workflow rather than creating a new top-level resource.numberReservationId
Retrieve the features for a list of numbersclient.numbersFeatures.create()POST /numbers_featuresCreate or provision an additional resource when the core tasks do not cover this flow.phoneNumbers
Lists the phone number blocks jobsclient.phoneNumberBlocks.jobs.list()GET /phone_number_blocks/jobsInspect available resources or choose an existing resource before mutating it.None
Deletes all numbers associated with a phone number blockclient.phoneNumberBlocks.jobs.deletePhoneNumberBlock()POST /phone_number_blocks/jobs/delete_phone_number_blockCreate or provision an additional resource when the core tasks do not cover this flow.phoneNumberBlockId
Retrieves a phone number blocks jobclient.phoneNumberBlocks.jobs.retrieve()GET /phone_number_blocks/jobs/{id}Fetch the current state before updating, deleting, or making control-flow decisions.id
List sub number ordersclient.subNumberOrders.list()GET /sub_number_ordersInspect available resources or choose an existing resource before mutating it.None
Retrieve a sub number orderclient.subNumberOrders.retrieve()GET /sub_number_orders/{sub_number_order_id}Fetch the current state before updating, deleting, or making control-flow decisions.subNumberOrderId
Update a sub number order's requirementsclient.subNumberOrders.update()PATCH /sub_number_orders/{sub_number_order_id}Modify an existing resource without recreating it.subNumberOrderId
Cancel a sub number orderclient.subNumberOrders.cancel()PATCH /sub_number_orders/{sub_number_order_id}/cancelModify an existing resource without recreating it.subNumberOrderId
Create a sub number orders reportclient.subNumberOrdersReport.create()POST /sub_number_orders_reportCreate or provision an additional resource when the core tasks do not cover this flow.None
Retrieve a sub number orders reportclient.subNumberOrdersReport.retrieve()GET /sub_number_orders_report/{report_id}Fetch the current state before updating, deleting, or making control-flow decisions.reportId
Download a sub number orders reportclient.subNumberOrdersReport.download()GET /sub_number_orders_report/{report_id}/downloadFetch the current state before updating, deleting, or making control-flow decisions.reportId

Other Webhook Events

Eventdata.event_typeDescription
numberOrderStatusUpdatenumber.order.status.updateNumber Order Status Update

For exhaustive optional parameters, full response schemas, and complete webhook payloads, see references/api-details.md.

Capabilities

skillsource-team-telnyxskill-telnyx-numbers-javascripttopic-agent-skillstopic-ai-coding-agenttopic-claude-codetopic-cpaastopic-cursortopic-iottopic-llmtopic-sdktopic-siptopic-smstopic-speech-to-texttopic-telephony

Install

Quality

0.53/ 1.00

deterministic score 0.53 from registry signals: · indexed on github topic:agent-skills · 167 github stars · SKILL.md body (19,859 chars)

Provenance

Indexed fromgithub
Enriched2026-04-22 06:54:43Z · deterministic:skill-github:v1 · v1
First seen2026-04-18
Last seen2026-04-22

Agent access