team-telnyx/ai/telnyx-numbers-compliance-javascript

Claude Code and agent skill by team-telnyx/ai

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Manage regulatory requirements, number bundles, supporting documents, and verified numbers for compliance. This skill provides JavaScript SDK examples.

Install

npx vskill@latest install team-telnyx/ai/telnyx-numbers-compliance-javascript

SKILL.md

The same SKILL.md was published earlier as team-telnyx/ai/telnyx-numbers-compliance-javascript.

Telnyx Numbers Compliance - JavaScript

Installation

bash
npm install telnyx@6.74.2

Setup

javascript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
publicKey: process.env['TELNYX_PUBLIC_KEY'], // Required for client.webhooks.unwrap() (webhook verification)
});

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:

javascript
try {
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, then retry the request (bounded exponential backoff)
const retryAfter = err.headers?.['retry-after'] || 1;
await new Promise(r => setTimeout(r, retryAfter * 1000));
// ...retry the call here (give up after a few attempts)
} 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');
}
}
throw err; // Re-throw: a failed request must never look like success to the caller
}

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.

Retrieve Bundles

Returns a paginated list of the billing bundles available to your account, with support for filtering.

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 (array[string])

Get Bundle By Id

Returns the details of a single billing bundle by its ID, so you can inspect its contents before purchasing a user bundle.

GET /bundle_pricing/billing_bundles/{bundle_id}

javascript
const billingBundle = await client.bundlePricing.billingBundles.retrieve(
'8661948c-a386-4385-837f-af00f40f111a',
);
console.log(billingBundle.data);

Returns: active (boolean), bundle_limits (array[object]), cost_code (string), created_at (date), id (uuid), is_public (boolean), name (string), slug (string)

Get User Bundles

Returns a paginated list of the bundles active on your account, with support for filtering.

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 (array[object]), updated_at (date), user_id (uuid)

Create User Bundles

Creates multiple user bundles for the user.

POST /bundle_pricing/user_bundles/bulk

Optional: idempotency_key (uuid), items (array[object])

javascript
const userBundle = await client.bundlePricing.userBundles.create();
console.log(userBundle.data);

Returns: active (boolean), billing_bundle (object), created_at (date), id (uuid), resources (array[object]), updated_at (date), user_id (uuid)

Get Unused User Bundles

Returns all user bundles that aren't in use.

GET /bundle_pricing/user_bundles/unused

javascript
const response = await client.bundlePricing.userBundles.listUnused();
console.log(response.data);

Returns: billing_bundle (object), user_bundle_ids (array[string])

Get User Bundle by Id

Returns the details of a single user bundle on your account by its ID.

GET /bundle_pricing/user_bundles/{user_bundle_id}

javascript
const 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 (array[object]), updated_at (date), user_id (uuid)

Deactivate User Bundle

Deactivates the specified user bundle on your account and returns the deactivated bundle.

DELETE /bundle_pricing/user_bundles/{user_bundle_id}

javascript
const 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 (array[object]), updated_at (date), user_id (uuid)

Get User Bundle Resources

Retrieves the resources of a user bundle by its ID.

GET /bundle_pricing/user_bundles/{user_bundle_id}/resources

javascript
const 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 document links

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

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

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)

javascript
const 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

Returns the details of a single document on your account, including its metadata.

GET /documents/{id}

javascript
const 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

Updates the specified document's attributes and returns the updated 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)

javascript
const 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

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}

javascript
const 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

Downloads the raw file content of the specified document as originally uploaded.

GET /documents/{id}/download

javascript
const response = await client.documents.download('6a09cdc3-8948-47f0-aa62-74ac943d6c58');
console.log(response);
const content = await response.blob();
console.log(content);

Generate a temporary download link for a document

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

javascript
const response = await client.documents.generateDownloadLink(
'550e8400-e29b-41d4-a716-446655440000',
);
console.log(response.data);

Returns: url (uri)

Get action requirement details for a sub number order

Returns the input fields an action requirement needs and the current requirement action for a sub number order. Action requirements are fulfilled by an external step rather than by uploading documents. Australia mobile ID verification is currently the only action requirement.

GET /external_requirements/{regulatory_requirement_id}/sub_number_orders/{sub_number_order_id}

javascript
const response = await client.externalRequirements.subNumberOrders.retrieve('regulatory_requirement_id', 'sub_number_order_id');
console.log(response.data);

Returns: fields_required (array[object]), regulatory_requirement_id (uuid), requirement_action (object)

Fulfill an action requirement for a sub number order

Submits the end user's details to the external verification provider and returns the requirement action. Australia mobile ID verification is currently the only action requirement. It generates a unique Onfido verification link, returned in requirement_action.value, which you share with the end user.

POST /external_requirements/{regulatory_requirement_id}/sub_number_orders/{sub_number_order_id} — Required: requirement

javascript
const response = await client.externalRequirements.subNumberOrders.update('regulatory_requirement_id', 'sub_number_order_id', {
requirement: {},
});
console.log(response.data);

Returns: regulatory_requirement_id (uuid), requirement_action (object), sub_order_id (uuid)

Update requirement group for a phone number order

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
220
Repository forks
22
7-day trend score
32

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/team-telnyx/ai/telnyx-numbers-compliance-javascript/badge)](https://verified-skill.com/skills/team-telnyx/ai/telnyx-numbers-compliance-javascript)

Something wrong with this skill or its page? Tell us.