Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Manage port-out requests when numbers are being ported away from Telnyx. List, view, and update port-out status. This skill provides JavaScript SDK examples.
.claude/skills/team-telnyx-telnyx-porting-out-javascript/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-13 | ✗→✓ | ▲ Improved | 184% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 149% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 103% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 155% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 100% | 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).
for await (const item of result) { ... } to iterate through all pages automatically.Returns the portout requests according to filters
GET /portouts
javascript// Automatically fetches more pages as needed. for await (const portoutDetails of client.portouts.list()) { console.log(portoutDetails.id); }
Returns: already_ported (boolean), authorized_name (string), carrier_name (string), city (string), created_at (string), current_carrier (string), end_user_name (string), foc_date (string), host_messaging (boolean), id (string), inserted_at (string), lsr (arraystring]), phone_numbers (arraystring]), pon (string), reason (string | null), record_type (string), rejection_code (integer), requested_foc_date (string), service_address (string), spid (string), state (string), status (enum: pending, authorized, ported, rejected, rejected-pending, canceled), support_key (string), updated_at (string), user_id (uuid), vendor (uuid), zip (string)
Returns a list of all port-out events.
GET /portouts/events
javascript// Automatically fetches more pages as needed. for await (const eventListResponse of client.portouts.events.list()) { console.log(eventListResponse); }
Returns: available_notification_methods (arraystring]), created_at (date-time), event_type (enum: portout.status_changed, portout.foc_date_changed, portout.new_comment), id (uuid), payload (object), payload_status (enum: created, completed), portout_id (uuid), record_type (string), updated_at (date-time)
Show a specific port-out event.
GET /portouts/events/{id}
javascriptconst event = await client.portouts.events.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); console.log(event.data);
Returns: available_notification_methods (arraystring]), created_at (date-time), event_type (enum: portout.status_changed, portout.foc_date_changed, portout.new_comment), id (uuid), payload (object), payload_status (enum: created, completed), portout_id (uuid), record_type (string), updated_at (date-time)
Republish a specific port-out event.
POST /portouts/events/{id}/republish
javascriptawait client.portouts.events.republish('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
Given a port-out ID, list rejection codes that are eligible for that port-out
GET /portouts/rejections/{portout_id}
javascriptconst response = await client.portouts.listRejectionCodes('329d6658-8f93-405d-862f-648776e8afd7'); console.log(response.data);
Returns: code (integer), description (string), reason_required (boolean)
List the reports generated about port-out operations.
GET /portouts/reports
javascript// Automatically fetches more pages as needed. for await (const portoutReport of client.portouts.reports.list()) { console.log(portoutReport.id); }
Returns: created_at (date-time), document_id (uuid), id (uuid), params (object), record_type (string), report_type (enum: export_portouts_csv), status (enum: pending, completed), updated_at (date-time)
Generate reports about port-out operations.
POST /portouts/reports
javascriptconst report = await client.portouts.reports.create({ params: { filters: {} }, report_type: 'export_portouts_csv', }); console.log(report.data);
Returns: created_at (date-time), document_id (uuid), id (uuid), params (object), record_type (string), report_type (enum: export_portouts_csv), status (enum: pending, completed), updated_at (date-time)
Retrieve a specific report generated.
GET /portouts/reports/{id}
javascriptconst report = await client.portouts.reports.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); console.log(report.data);
Returns: created_at (date-time), document_id (uuid), id (uuid), params (object), record_type (string), report_type (enum: export_portouts_csv), status (enum: pending, completed), updated_at (date-time)
Returns the portout request based on the ID provided
GET /portouts/{id}
javascriptconst portout = await client.portouts.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); console.log(portout.data);
Returns: already_ported (boolean), authorized_name (string), carrier_name (string), city (string), created_at (string), current_carrier (string), end_user_name (string), foc_date (string), host_messaging (boolean), id (string), inserted_at (string), lsr (arraystring]), phone_numbers (arraystring]), pon (string), reason (string | null), record_type (string), rejection_code (integer), requested_foc_date (string), service_address (string), spid (string), state (string), status (enum: pending, authorized, ported, rejected, rejected-pending, canceled), support_key (string), updated_at (string), user_id (uuid), vendor (uuid), zip (string)
Returns a list of comments for a portout request.
GET /portouts/{id}/comments
javascriptconst comments = await client.portouts.comments.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); console.log(comments.data);
Returns: body (string), created_at (string), id (string), portout_id (string), record_type (string), user_id (string)
Creates a comment on a portout request.
POST /portouts/{id}/comments
Optional: body (string)
javascriptconst comment = await client.portouts.comments.create('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); console.log(comment.data);
Returns: body (string), created_at (string), id (string), portout_id (string), record_type (string), user_id (string)
List every supporting documents for a portout request.
GET /portouts/{id}/supporting_documents
javascriptconst supportingDocuments = await client.portouts.supportingDocuments.list( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', ); console.log(supportingDocuments.data);
Returns: created_at (string), document_id (uuid), id (uuid), portout_id (uuid), record_type (string), type (enum: loa, invoice), updated_at (string)
Creates a list of supporting documents on a portout request.
POST /portouts/{id}/supporting_documents
Optional: documents (arrayobject])
javascriptconst supportingDocument = await client.portouts.supportingDocuments.create( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', ); console.log(supportingDocument.data);
Returns: created_at (string), document_id (uuid), id (uuid), portout_id (uuid), record_type (string), type (enum: loa, invoice), updated_at (string)
Authorize or reject portout request
PATCH /portouts/{id}/{status} — Required: reason
Optional: host_messaging (boolean)
javascriptconst response = await client.portouts.updateStatus('authorized', { id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', reason: 'I do not recognize this transaction', }); console.log(response.data);
Returns: already_ported (boolean), authorized_name (string), carrier_name (string), city (string), created_at (string), current_carrier (string), end_user_name (string), foc_date (string), host_messaging (boolean), id (string), inserted_at (string), lsr (arraystring]), phone_numbers (arraystring]), pon (string), reason (string | null), record_type (string), rejection_code (integer), requested_foc_date (string), service_address (string), spid (string), state (string), status (enum: pending, authorized, ported, rejected, rejected-pending, canceled), support_key (string), updated_at (string), user_id (uuid), vendor (uuid), zip (string)
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-13 | fail→pass | 6,001 | 2,763 | -54% | 1 | 1 | 0% | 1,323 | 3,751 | +184% | 0 | 0 | — |
case-01 | fail→pass | 8,285 | 4,874 | -41% | 1 | 1 | 0% | 1,674 | 4,166 | +149% | 0 | 0 | — |
case-02 | fail→pass | 9,179 | 4,124 | -55% | 1 | 1 | 0% | 1,951 | 3,966 | +103% | 0 | 0 | — |
case-03 | fail→pass | 7,666 | 3,711 | -52% | 1 | 1 | 0% | 1,505 | 3,841 | +155% | 0 | 0 | — |
case-04 | fail→pass | 10,442 | 4,399 | -58% | 1 | 1 | 0% | 1,995 | 3,996 | +100% | 0 | 0 | — |
case-05 | fail→pass | 7,578 | 2,654 | -65% | 1 | 1 | 0% | 1,661 | 3,692 | +122% | 0 | 0 | — |
case-06 | fail→pass | 9,243 | 2,452 | -73% | 1 | 1 | 0% | 1,939 | 3,664 | +89% | 0 | 0 | — |
case-07 | fail→pass | 6,597 | 3,134 | -52% | 1 | 1 | 0% | 1,451 | 3,871 | +167% | 0 | 0 | — |
case-08 | fail→pass | 6,828 | 3,407 | -50% | 1 | 1 | 0% | 1,346 | 3,785 | +181% | 0 | 0 | — |
case-09 | fail→pass | 6,401 | 2,873 | -55% | 1 | 1 | 0% | 1,429 | 3,824 | +168% | 0 | 0 | — |
case-10 | pass→pass | 4,733 | 2,292 | -52% | 1 | 1 | 0% | 1,083 | 3,667 | +239% | 0 | 0 | — |
case-11 | fail→pass | 8,290 | 3,575 | -57% | 1 | 1 | 0% | 1,730 | 3,925 | +127% | 0 | 0 | — |
case-12 | fail→pass | 8,041 | 3,496 | -57% | 1 | 1 | 0% | 1,684 | 3,941 | +134% | 0 | 0 | — |
case-14 | fail→pass | 8,492 | 2,925 | -66% | 1 | 1 | 0% | 1,774 | 3,783 | +113% | 0 | 0 | — |
case-15 | fail→pass | 12,368 | 5,528 | -55% | 1 | 1 | 0% | 2,575 | 4,362 | +69% | 0 | 0 | — |
case-16 | fail→pass | 9,278 | 3,729 | -60% | 1 | 1 | 0% | 1,834 | 3,878 | +111% | 0 | 0 | — |
case-17 | fail→pass | 9,277 | 4,021 | -57% | 1 | 1 | 0% | 1,876 | 3,963 | +111% | 0 | 0 | — |
case-18 | fail→pass | 7,901 | 4,233 | -46% | 1 | 1 | 0% | 1,703 | 4,060 | +138% | 0 | 0 | — |
case-19 | pass→pass | 6,998 | 2,048 | -71% | 1 | 1 | 0% | 1,396 | 3,462 | +148% | 0 | 0 | — |
case-20 | pass→pass | 7,810 | 7,186 | -8% | 1 | 1 | 0% | 1,476 | 4,622 | +213% | 0 | 0 | — |
case-21 | fail→pass | 4,822 | 2,475 | -49% | 1 | 1 | 0% | 1,027 | 3,713 | +262% | 0 | 0 | — |
case-22 | pass→pass | 6,107 | 4,992 | -18% | 1 | 1 | 0% | 1,257 | 4,128 | +228% | 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. 22 cases were attempted. The headline lift of +82 percentage points is the difference between those two pass rates over the 22 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.