Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Manage regulatory requirements, number bundles, supporting documents, and verified numbers for compliance. This skill provides JavaScript SDK examples.
.claude/skills/team-telnyx-telnyx-numbers-compliance-javascript/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 257% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 241% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 187% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 306% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 263% | 0% |
<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
bashnpm install telnyx@6.74.2
javascriptimport 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.
All API calls can fail with network errors, rate limits (429), validation errors (422), or authentication errors (401). Always handle errors in production code:
javascripttry { const result = await client.messages.send({ to: '+13125550001', from: '+13125550002', text: 'Hello' }); } catch (err) { if (err instanceof Telnyx.APIConnectionError) { console.error('Network error — check connectivity and retry'); } else if (err instanceof Telnyx.RateLimitError) { // 429: rate limited — wait and retry with exponential backoff 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).
+13125550001). Include the + prefix and country code. No spaces, dashes, or parentheses.for await (const item of result) { ... } to iterate through all pages automatically.Get all allowed bundles.
GET /bundle_pricing/billing_bundles
javascript// Automatically fetches more pages as needed. for await (const billingBundleSummary of client.bundlePricing.billingBundles.list()) { console.log(billingBundleSummary.id); }
Returns: cost_code (string), created_at (date), currency (string), id (uuid), is_public (boolean), mrc_price (float), name (string), slug (string), specs (arraystring])
Get a single bundle by ID.
GET /bundle_pricing/billing_bundles/{bundle_id}
javascriptconst billingBundle = await client.bundlePricing.billingBundles.retrieve( '8661948c-a386-4385-837f-af00f40f111a', ); console.log(billingBundle.data);
Returns: active (boolean), bundle_limits (arrayobject]), cost_code (string), created_at (date), id (uuid), is_public (boolean), name (string), slug (string)
Get a paginated list of user bundles.
GET /bundle_pricing/user_bundles
javascript// Automatically fetches more pages as needed. for await (const userBundle of client.bundlePricing.userBundles.list()) { console.log(userBundle.id); }
Returns: active (boolean), billing_bundle (object), created_at (date), id (uuid), resources (arrayobject]), updated_at (date), user_id (uuid)
Creates multiple user bundles for the user.
POST /bundle_pricing/user_bundles/bulk
Optional: idempotency_key (uuid), items (arrayobject])
javascriptconst userBundle = await client.bundlePricing.userBundles.create(); console.log(userBundle.data);
Returns: active (boolean), billing_bundle (object), created_at (date), id (uuid), resources (arrayobject]), updated_at (date), user_id (uuid)
Returns all user bundles that aren't in use.
GET /bundle_pricing/user_bundles/unused
javascriptconst response = await client.bundlePricing.userBundles.listUnused(); console.log(response.data);
Returns: billing_bundle (object), user_bundle_ids (arraystring])
Retrieves a user bundle by its ID.
GET /bundle_pricing/user_bundles/{user_bundle_id}
javascriptconst userBundle = await client.bundlePricing.userBundles.retrieve( 'ca1d2263-d1f1-43ac-ba53-248e7a4bb26a', ); console.log(userBundle.data);
Returns: active (boolean), billing_bundle (object), created_at (date), id (uuid), resources (arrayobject]), updated_at (date), user_id (uuid)
Deactivates a user bundle by its ID.
DELETE /bundle_pricing/user_bundles/{user_bundle_id}
javascriptconst response = await client.bundlePricing.userBundles.deactivate( 'ca1d2263-d1f1-43ac-ba53-248e7a4bb26a', ); console.log(response.data);
Returns: active (boolean), billing_bundle (object), created_at (date), id (uuid), resources (arrayobject]), updated_at (date), user_id (uuid)
Retrieves the resources of a user bundle by its ID.
GET /bundle_pricing/user_bundles/{user_bundle_id}/resources
javascriptconst response = await client.bundlePricing.userBundles.listResources( 'ca1d2263-d1f1-43ac-ba53-248e7a4bb26a', ); console.log(response.data);
Returns: created_at (date), id (uuid), resource (string), resource_type (string), updated_at (date)
List all documents links ordered by created_at descending.
GET /document_links
javascript// Automatically fetches more pages as needed. for await (const documentLinkListResponse of client.documentLinks.list()) { console.log(documentLinkListResponse.id); }
Returns: created_at (string), document_id (uuid), id (uuid), linked_record_type (string), linked_resource_id (string), record_type (string), updated_at (string)
List all documents ordered by created_at descending.
GET /documents
javascript// Automatically fetches more pages as needed. for await (const docServiceDocument of client.documents.list()) { console.log(docServiceDocument.id); }
Returns: av_scan_status (enum: scanned, infected, pending_scan, not_scanned), content_type (string), created_at (string), customer_reference (string), filename (string), id (uuid), record_type (string), sha256 (string), size (object), status (enum: pending, verified, denied), updated_at (string)
Upload a document. Uploaded files must be linked to a service within 30 minutes or they will be automatically deleted.
POST /documents
Optional: customer_reference (string), file (byte), filename (string), url (string)
javascriptconst response = await client.documents.uploadJson({ document: {} }); console.log(response.data);
Returns: av_scan_status (enum: scanned, infected, pending_scan, not_scanned), content_type (string), created_at (string), customer_reference (string), filename (string), id (uuid), record_type (string), sha256 (string), size (object), status (enum: pending, verified, denied), updated_at (string)
Retrieve a document.
GET /documents/{id}
javascriptconst document = await client.documents.retrieve('6a09cdc3-8948-47f0-aa62-74ac943d6c58'); console.log(document.data);
Returns: av_scan_status (enum: scanned, infected, pending_scan, not_scanned), content_type (string), created_at (string), customer_reference (string), filename (string), id (uuid), record_type (string), sha256 (string), size (object), status (enum: pending, verified, denied), updated_at (string)
Update a document.
PATCH /documents/{id}
Optional: av_scan_status (enum: scanned, infected, pending_scan, not_scanned), content_type (string), created_at (string), customer_reference (string), filename (string), id (uuid), record_type (string), sha256 (string), size (object), status (enum: pending, verified, denied), updated_at (string)
javascriptconst document = await client.documents.update('6a09cdc3-8948-47f0-aa62-74ac943d6c58'); console.log(document.data);
Returns: av_scan_status (enum: scanned, infected, pending_scan, not_scanned), content_type (string), created_at (string), customer_reference (string), filename (string), id (uuid), record_type (string), sha256 (string), size (object), status (enum: pending, verified, denied), updated_at (string)
Delete a document. A document can only be deleted if it's not linked to a service. If it is linked to a service, it must be unlinked prior to deleting.
DELETE /documents/{id}
javascriptconst document = await client.documents.delete('6a09cdc3-8948-47f0-aa62-74ac943d6c58'); console.log(document.data);
Returns: av_scan_status (enum: scanned, infected, pending_scan, not_scanned), content_type (string), created_at (string), customer_reference (string), filename (string), id (uuid), record_type (string), sha256 (string), size (object), status (enum: pending, verified, denied), updated_at (string)
Download a document.
GET /documents/{id}/download
javascriptconst response = await client.documents.download('6a09cdc3-8948-47f0-aa62-74ac943d6c58'); console.log(response); const content = await response.blob(); console.log(content);
Generates a temporary pre-signed URL that can be used to download the document directly from the storage backend without authentication.
GET /documents/{id}/download_link
javascriptconst response = await client.documents.generateDownloadLink( '550e8400-e29b-41d4-a716-446655440000', ); console.log(response.data);
Returns: url (uri)
POST /number_order_phone_numbers/{id}/requirement_group — Required: requirement_group_id
javascriptconst response = await client.numberOrderPhoneNumbers.updateRequirementGroup( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { requirement_group_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }, ); console.log(response.data);
Returns: bundle_id (uuid), country_code (string), deadline (date-time), id (uuid), is_block_number (boolean), locality (string), order_request_id (uuid), phone_number (string), phone_number_type (string), record_type (string), regulatory_requirements (arrayobject]), requirements_met (boolean), requirements_status (string), status (string), sub_number_order_id (uuid)
GET /phone_numbers_regulatory_requirements
javascriptconst phoneNumbersRegulatoryRequirement = await client.phoneNumbersRegulatoryRequirements.retrieve(); console.log(phoneNumbersRegulatoryRequirement.data);
Returns: phone_number (string), phone_number_type (string), record_type (string), region_information (arrayobject]), regulatory_requirements (arrayobject])
GET /regulatory_requirements
javascriptconst regulatoryRequirement = await client.regulatoryRequirements.retrieve(); console.log(regulatoryRequirement.data);
Returns: action (string), country_code (string), phone_number_type (string), regulatory_requirements (arrayobject])
GET /requirement_groups
javascriptconst requirementGroups = await client.requirementGroups.list(); console.log(requirementGroups);
POST /requirement_groups — Required: country_code, phone_number_type, action
Optional: customer_reference (string), regulatory_requirements (arrayobject])
javascriptconst requirementGroup = await client.requirementGroups.create({ action: 'ordering', country_code: 'US', phone_number_type: 'local', }); console.log(requirementGroup.id);
Returns: action (string), country_code (string), created_at (date-time), customer_reference (string), id (string), phone_number_type (string), record_type (string), regulatory_requirements (arrayobject]), status (enum: approved, unapproved, pending-approval, declined, expired), updated_at (date-time)
GET /requirement_groups/{id}
javascriptconst requirementGroup = await client.requirementGroups.retrieve('550e8400-e29b-41d4-a716-446655440000'); console.log(requirementGroup.id);
Returns: action (string), country_code (string), created_at (date-time), customer_reference (string), id (string), phone_number_type (string), record_type (string), regulatory_requirements (arrayobject]), status (enum: approved, unapproved, pending-approval, declined, expired), updated_at (date-time)
PATCH /requirement_groups/{id}
Optional: customer_reference (string), regulatory_requirements (arrayobject])
javascriptconst requirementGroup = await client.requirementGroups.update('550e8400-e29b-41d4-a716-446655440000'); console.log(requirementGroup.id);
Returns: action (string), country_code (string), created_at (date-time), customer_reference (string), id (string), phone_number_type (string), record_type (string), regulatory_requirements (arrayobject]), status (enum: approved, unapproved, pending-approval, declined, expired), updated_at (date-time)
DELETE /requirement_groups/{id}
javascriptconst requirementGroup = await client.requirementGroups.delete('550e8400-e29b-41d4-a716-446655440000'); console.log(requirementGroup.id);
Returns: action (string), country_code (string), created_at (date-time), customer_reference (string), id (string), phone_number_type (string), record_type (string), regulatory_requirements (arrayobject]), status (enum: approved, unapproved, pending-approval, declined, expired), updated_at (date-time)
POST /requirement_groups/{id}/submit_for_approval
javascriptconst requirementGroup = await client.requirementGroups.submitForApproval('550e8400-e29b-41d4-a716-446655440000'); console.log(requirementGroup.id);
Returns: action (string), country_code (string), created_at (date-time), customer_reference (string), id (string), phone_number_type (string), record_type (string), regulatory_requirements (arrayobject]), status (enum: approved, unapproved, pending-approval, declined, expired), updated_at (date-time)
List all requirement types ordered by created_at descending
GET /requirement_types
javascriptconst requirementTypes = await client.requirementTypes.list(); console.log(requirementTypes.data);
Returns: acceptance_criteria (object), created_at (string), description (string), example (string), id (uuid), name (string), record_type (string), type (enum: document, address, textual), updated_at (string)
Retrieve a requirement type by id
GET /requirement_types/{id}
javascriptconst requirementType = await client.requirementTypes.retrieve( 'a38c217a-8019-48f8-bff6-0fdd9939075b', ); console.log(requirementType.data);
Returns: acceptance_criteria (object), created_at (string), description (string), example (string), id (uuid), name (string), record_type (string), type (enum: document, address, textual), updated_at (string)
List all requirements with filtering, sorting, and pagination
GET /requirements
javascript// Automatically fetches more pages as needed. for await (const requirementListResponse of client.requirements.list()) { console.log(requirementListResponse.id); }
Returns: action (enum: both, branded_calling, ordering, porting), country_code (string), created_at (string), id (uuid), locality (string), phone_number_type (enum: local, national, toll_free), record_type (string), requirements_types (arrayobject]), updated_at (string)
Retrieve a document requirement record
GET /requirements/{id}
javascriptconst requirement = await client.requirements.retrieve('a9dad8d5-fdbd-49d7-aa23-39bb08a5ebaa'); console.log(requirement.data);
Returns: action (enum: both, branded_calling, ordering, porting), country_code (string), created_at (string), id (uuid), locality (string), phone_number_type (enum: local, national, toll_free), record_type (string), requirements_types (arrayobject]), updated_at (string)
POST /sub_number_orders/{id}/requirement_group — Required: requirement_group_id
javascriptconst response = await client.subNumberOrders.updateRequirementGroup( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { requirement_group_id: 'a4b201f9-8646-4e54-a7d2-b2e403eeaf8c' }, ); console.log(response.data);
Returns: country_code (string), created_at (date-time), customer_reference (string), id (uuid), is_block_sub_number_order (boolean), order_request_id (uuid), phone_number_type (string), phone_numbers (arrayobject]), phone_numbers_count (integer), record_type (string), regulatory_requirements (arrayobject]), requirements_met (boolean), status (string), updated_at (date-time)
Returns a list of your user addresses.
GET /user_addresses
javascript// Automatically fetches more pages as needed. for await (const userAddress of client.userAddresses.list()) { console.log(userAddress.id); }
Returns: administrative_area (string), borough (string), business_name (string), country_code (string), created_at (string), customer_reference (string), extended_address (string), first_name (string), id (uuid), last_name (string), locality (string), neighborhood (string), phone_number (string), postal_code (string), record_type (string), street_address (string), updated_at (string)
Creates a user address.
POST /user_addresses — Required: first_name, last_name, business_name, street_address, locality, country_code
Optional: administrative_area (string), borough (string), customer_reference (string), extended_address (string), neighborhood (string), phone_number (string), postal_code (string), skip_address_verification (boolean)
javascriptconst userAddress = await client.userAddresses.create({ business_name: "Toy-O'Kon", country_code: 'US', first_name: 'Alfred', last_name: 'Foster', locality: 'Austin', street_address: '600 Congress Avenue', }); console.log(userAddress.data);
Returns: administrative_area (string), borough (string), business_name (string), country_code (string), created_at (string), customer_reference (string), extended_address (string), first_name (string), id (uuid), last_name (string), locality (string), neighborhood (string), phone_number (string), postal_code (string), record_type (string), street_address (string), updated_at (string)
Retrieves the details of an existing user address.
GET /user_addresses/{id}
javascriptconst userAddress = await client.userAddresses.retrieve('550e8400-e29b-41d4-a716-446655440000'); console.log(userAddress.data);
Returns: administrative_area (string), borough (string), business_name (string), country_code (string), created_at (string), customer_reference (string), extended_address (string), first_name (string), id (uuid), last_name (string), locality (string), neighborhood (string), phone_number (string), postal_code (string), record_type (string), street_address (string), updated_at (string)
Gets a paginated list of Verified Numbers.
GET /verified_numbers
javascript// Automatically fetches more pages as needed. for await (const verifiedNumber of client.verifiedNumbers.list()) { console.log(verifiedNumber.phone_number); }
Returns: phone_number (string), record_type (enum: verified_number), verified_at (string)
Initiates phone number verification procedure. Supports DTMF extension dialing for voice calls to numbers behind IVR systems.
POST /verified_numbers — Required: phone_number, verification_method
Optional: extension (string)
javascriptconst verifiedNumber = await client.verifiedNumbers.create({ phone_number: '+15551234567', verification_method: 'sms', }); console.log(verifiedNumber.phone_number);
Returns: phone_number (string), verification_method (string)
GET /verified_numbers/{phone_number}
javascriptconst verifiedNumberDataWrapper = await client.verifiedNumbers.retrieve('+15551234567'); console.log(verifiedNumberDataWrapper.data);
Returns: phone_number (string), record_type (enum: verified_number), verified_at (string)
DELETE /verified_numbers/{phone_number}
javascriptconst verifiedNumberDataWrapper = await client.verifiedNumbers.delete('+15551234567'); console.log(verifiedNumberDataWrapper.data);
Returns: phone_number (string), record_type (enum: verified_number), verified_at (string)
POST /verified_numbers/{phone_number}/actions/verify — Required: verification_code
javascriptconst verifiedNumberDataWrapper = await client.verifiedNumbers.actions.submitVerificationCode( '+15551234567', { verification_code: '123456' }, ); console.log(verifiedNumberDataWrapper.data);
Returns: phone_number (string), record_type (enum: verified_number), verified_at (string)
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 12,711 | 27,726 | +118% | 1 | 1 | 0% | 2,479 | 8,852 | +257% | 0 | 0 | — |
case-02 | fail→pass | 12,782 | 7,912 | -38% | 1 | 1 | 0% | 2,469 | 8,425 | +241% | 0 | 0 | — |
case-03 | fail→pass | 14,665 | 7,997 | -45% | 1 | 1 | 0% | 2,965 | 8,505 | +187% | 0 | 0 | — |
case-04 | fail→pass | 10,080 | 28,326 | +181% | 1 | 1 | 0% | 1,989 | 8,083 | +306% | 0 | 0 | — |
case-05 | fail→pass | 10,112 | 5,994 | -41% | 1 | 1 | 0% | 2,255 | 8,191 | +263% | 0 | 0 | — |
case-06 | fail→pass | 14,225 | 5,314 | -63% | 1 | 1 | 0% | 2,613 | 7,768 | +197% | 0 | 0 | — |
case-07 | fail→pass | 9,586 | 5,324 | -44% | 1 | 1 | 0% | 1,752 | 7,775 | +344% | 0 | 0 | — |
case-08 | fail→pass | 7,699 | 4,449 | -42% | 1 | 1 | 0% | 1,474 | 7,541 | +412% | 0 | 0 | — |
case-09 | fail→pass | 14,311 | 6,864 | -52% | 1 | 1 | 0% | 2,862 | 8,186 | +186% | 0 | 0 | — |
case-10 | pass→pass | 7,073 | 3,472 | -51% | 1 | 1 | 0% | 1,374 | 7,450 | +442% | 0 | 0 | — |
case-11 | fail→pass | 11,221 | 4,188 | -63% | 1 | 1 | 0% | 2,231 | 7,602 | +241% | 0 | 0 | — |
case-12 | fail→pass | 11,670 | 3,412 | -71% | 1 | 1 | 0% | 2,333 | 7,443 | +219% | 0 | 0 | — |
case-13 | fail→pass | 14,097 | 7,116 | -50% | 1 | 1 | 0% | 2,593 | 8,081 | +212% | 0 | 0 | — |
case-14 | fail→pass | 11,112 | 3,022 | -73% | 1 | 1 | 0% | 2,059 | 7,241 | +252% | 0 | 0 | — |
case-15 | pass→pass | 7,603 | 4,880 | -36% | 1 | 1 | 0% | 1,608 | 7,757 | +382% | 0 | 0 | — |
case-16 | fail→pass | 5,283 | 3,222 | -39% | 1 | 1 | 0% | 1,066 | 7,410 | +595% | 0 | 0 | — |
case-17 | pass→pass | 12,220 | 4,455 | -64% | 1 | 1 | 0% | 2,492 | 7,632 | +206% | 0 | 0 | — |
case-18 | fail→pass | 6,732 | 2,495 | -63% | 1 | 1 | 0% | 1,270 | 7,162 | +464% | 0 | 0 | — |
case-19 | fail→pass | 11,444 | 4,764 | -58% | 1 | 1 | 0% | 2,276 | 7,704 | +238% | 0 | 0 | — |
case-20 | pass→pass | 8,316 | 6,626 | -20% | 1 | 1 | 0% | 1,535 | 8,105 | +428% | 0 | 0 | — |
case-21 | pass→pass | 3,917 | 4,414 | +13% | 1 | 1 | 0% | 774 | 7,606 | +883% | 0 | 0 | — |
case-22 | pass→pass | 5,249 | 6,451 | +23% | 1 | 1 | 0% | 994 | 8,092 | +714% | 0 | 0 | — |
case-23 | pass→pass | 6,327 | 5,585 | -12% | 1 | 1 | 0% | 1,005 | 7,838 | +680% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +70 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.