team-telnyx/telnyx-skills

telnyx-sip-integrations-javascript

>- Manage call recordings, media storage, Dialogflow integration, and external connections for SIP trunking. This skill provides JavaScript SDK examples.

First seen Mar 7, 2026

Installation

$ npx skills add team-telnyx/telnyx-skills --skill telnyx-sip-integrations-javascript

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from team-telnyx/telnyx-skills · top by installs.

npx skills add team-telnyx/telnyx-skills

Browse all from team-telnyx/telnyx-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 188
License LICENSE
Default branch main
Open issues 2
Status Active

Skill metadata

Parsed from SKILL.md frontmatter.

More metadata
author
telnyx
product
sip-integrations
language
javascript
generated_by
telnyx-openapi-pipeline

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 28,693 B
  • docs SUMMARY.md 192 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 12 installs

SKILL.md

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

Telnyx Sip Integrations - JavaScript

Installation

npm install [email protected]

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 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).

Important Notes

  • Pagination: List methods return an auto-paginating iterator. Use for await (const item of result) { ... } to iterate through all pages automatically.

Retrieve a stored credential

Returns the information about custom storage credentials.

GET /customstoragecredentials/{connection_id}

const customStorageCredential = await client.customStorageCredentials.retrieve('connection_id');

console.log(customStorageCredential.connection_id);

Returns: backend (enum: gcs, s3, azure), configuration (object)

Create a custom storage credential

Creates a custom storage credentials configuration.

POST /customstoragecredentials/{connection_id}

const customStorageCredential = await client.customStorageCredentials.create('connection_id', {
  backend: 'gcs',
  configuration: { backend: 'gcs' },
});

console.log(customStorageCredential.connection_id);

Returns: backend (enum: gcs, s3, azure), configuration (object)

Update a stored credential

Updates a stored custom credentials configuration.

PUT /customstoragecredentials/{connection_id}

const customStorageCredential = await client.customStorageCredentials.update('connection_id', {
  backend: 'gcs',
  configuration: { backend: 'gcs' },
});

console.log(customStorageCredential.connection_id);

Returns: backend (enum: gcs, s3, azure), configuration (object)

Delete a stored credential

Deletes a stored custom credentials configuration.

DELETE /customstoragecredentials/{connection_id}

await client.customStorageCredentials.delete('connection_id');

Retrieve stored Dialogflow Connection

Return details of the Dialogflow connection associated with the given CallControl connection.

GET /dialogflowconnections/{connectionid}

const dialogflowConnection = await client.dialogflowConnections.retrieve('connection_id');

console.log(dialogflowConnection.data);

Returns: connectionid (string), conversationprofileid (string), environment (string), recordtype (string), service_account (string)

Create a Dialogflow Connection

Save Dialogflow Credentiails to Telnyx, so it can be used with other Telnyx services.

POST /dialogflowconnections/{connectionid}

const dialogflowConnection = await client.dialogflowConnections.create('connection_id', {
  service_account: {
    type: 'bar',
    project_id: 'bar',
    private_key_id: 'bar',
    private_key: 'bar',
    client_email: 'bar',
    client_id: 'bar',
    auth_uri: 'bar',
    token_uri: 'bar',
    auth_provider_x509_cert_url: 'bar',
    client_x509_cert_url: 'bar',
  },
});

console.log(dialogflowConnection.data);

Returns: connectionid (string), conversationprofileid (string), environment (string), recordtype (string), service_account (string)

Update stored Dialogflow Connection

Updates a stored Dialogflow Connection.

PUT /dialogflowconnections/{connectionid}

const dialogflowConnection = await client.dialogflowConnections.update('connection_id', {
  service_account: {
    type: 'bar',
    project_id: 'bar',
    private_key_id: 'bar',
    private_key: 'bar',
    client_email: 'bar',
    client_id: 'bar',
    auth_uri: 'bar',
    token_uri: 'bar',
    auth_provider_x509_cert_url: 'bar',
    client_x509_cert_url: 'bar',
  },
});

console.log(dialogflowConnection.data);

Returns: connectionid (string), conversationprofileid (string), environment (string), recordtype (string), service_account (string)

Delete stored Dialogflow Connection

Deletes a stored Dialogflow Connection.

DELETE /dialogflowconnections/{connectionid}

await client.dialogflowConnections.delete('connection_id');

List all External Connections

This endpoint returns a list of your External Connections inside the 'data' attribute of the response. External Connections are used by Telnyx customers to seamless configure SIP trunking integrations with Telnyx Partners, through External Voice Integrations in Mission Control Portal.

GET /external_connections

// Automatically fetches more pages as needed.
for await (const externalConnection of client.externalConnections.list()) {
  console.log(externalConnection.id);
}

Returns: active (boolean), createdat (string), credentialactive (boolean), externalsipconnection (enum: zoom, operatorconnect), id (string), inbound (object), outbound (object), recordtype (string), tags (array[string]), updatedat (string), webhookapiversion (enum: 1, 2), webhookeventfailoverurl (uri), webhookeventurl (uri), webhooktimeoutsecs (integer | null)

Creates an External Connection

Creates a new External Connection based on the parameters sent in the request. The externalsipconnection and outbound voice profile id are required. Once created, you can assign phone numbers to your application using the /phone_numbers endpoint.

POST /externalconnections — Required: externalsip_connection, outbound

Optional: active (boolean), inbound (object), tags (array[string]), webhookeventfailoverurl (uri), webhookeventurl (uri), webhooktimeout_secs (integer | null)

const externalConnection = await client.externalConnections.create({
  external_sip_connection: 'zoom',
  outbound: {},
});

console.log(externalConnection.data);

Returns: active (boolean), createdat (string), credentialactive (boolean), externalsipconnection (enum: zoom, operatorconnect), id (string), inbound (object), outbound (object), recordtype (string), tags (array[string]), updatedat (string), webhookapiversion (enum: 1, 2), webhookeventfailoverurl (uri), webhookeventurl (uri), webhooktimeoutsecs (integer | null)

List all log messages

Retrieve a list of log messages for all external connections associated with your account.

GET /externalconnections/logmessages

// Automatically fetches more pages as needed.
for await (const logMessageListResponse of client.externalConnections.logMessages.list()) {
  console.log(logMessageListResponse.code);
}

Returns: log_messages (array[object]), meta (object)

Retrieve a log message

Retrieve a log message for an external connection associated with your account.

GET /externalconnections/logmessages/{id}

const logMessage = await client.externalConnections.logMessages.retrieve('1293384261075731499');

console.log(logMessage.log_messages);

Returns: log_messages (array[object])

Dismiss a log message

Dismiss a log message for an external connection associated with your account.

DELETE /externalconnections/logmessages/{id}

const response = await client.externalConnections.logMessages.dismiss('1293384261075731499');

console.log(response.success);

Returns: success (boolean)

Retrieve an External Connection

Return the details of an existing External Connection inside the 'data' attribute of the response.

GET /external_connections/{id}

const externalConnection = await client.externalConnections.retrieve('1293384261075731499');

console.log(externalConnection.data);

Returns: active (boolean), createdat (string), credentialactive (boolean), externalsipconnection (enum: zoom, operatorconnect), id (string), inbound (object), outbound (object), recordtype (string), tags (array[string]), updatedat (string), webhookapiversion (enum: 1, 2), webhookeventfailoverurl (uri), webhookeventurl (uri), webhooktimeoutsecs (integer | null)

Update an External Connection

Updates settings of an existing External Connection based on the parameters of the request.

PATCH /external_connections/{id} — Required: outbound

Optional: active (boolean), inbound (object), tags (array[string]), webhookeventfailoverurl (uri), webhookeventurl (uri), webhooktimeout_secs (integer | null)

const externalConnection = await client.externalConnections.update('1293384261075731499', {
  outbound: { outbound_voice_profile_id: '1911630617284445511' },
});

console.log(externalConnection.data);

Returns: active (boolean), createdat (string), credentialactive (boolean), externalsipconnection (enum: zoom, operatorconnect), id (string), inbound (object), outbound (object), recordtype (string), tags (array[string]), updatedat (string), webhookapiversion (enum: 1, 2), webhookeventfailoverurl (uri), webhookeventurl (uri), webhooktimeoutsecs (integer | null)

Deletes an External Connection

Permanently deletes an External Connection. Deletion may be prevented if the application is in use by phone numbers, is active, or if it is an Operator Connect connection. To remove an Operator Connect integration please contact Telnyx support.

DELETE /external_connections/{id}

const externalConnection = await client.externalConnections.delete('1293384261075731499');

console.log(externalConnection.data);

Returns: active (boolean), createdat (string), credentialactive (boolean), externalsipconnection (enum: zoom, operatorconnect), id (string), inbound (object), outbound (object), recordtype (string), tags (array[string]), updatedat (string), webhookapiversion (enum: 1, 2), webhookeventfailoverurl (uri), webhookeventurl (uri), webhooktimeoutsecs (integer | null)

List all civic addresses and locations

Returns the civic addresses and locations from Microsoft Teams.

GET /externalconnections/{id}/civicaddresses

const civicAddresses = await client.externalConnections.civicAddresses.list('1293384261075731499');

console.log(civicAddresses.data);

Returns: cityortown (string), cityortownalias (string), companyname (string), country (string), countryordistrict (string), defaultlocationid (uuid), description (string), housenumber (string), housenumbersuffix (string), id (uuid), locations (array[object]), postalorzipcode (string), recordtype (string), stateorprovince (string), streetname (string), street_suffix (string)

Retrieve a Civic Address

Return the details of an existing Civic Address with its Locations inside the 'data' attribute of the response.

GET /externalconnections/{id}/civicaddresses/{address_id}

const civicAddress = await client.externalConnections.civicAddresses.retrieve(
  '318fb664-d341-44d2-8405-e6bfb9ced6d9',
  { id: '1293384261075731499' },
);

console.log(civicAddress.data);

Returns: cityortown (string), cityortownalias (string), companyname (string), country (string), countryordistrict (string), defaultlocationid (uuid), description (string), housenumber (string), housenumbersuffix (string), id (uuid), locations (array[object]), postalorzipcode (string), recordtype (string), stateorprovince (string), streetname (string), street_suffix (string)

Update a location's static emergency address

PATCH /externalconnections/{id}/locations/{locationid} — Required: staticemergencyaddress_id

const response = await client.externalConnections.updateLocation(
  '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
  {
    id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
    static_emergency_address_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
  },
);

console.log(response.data);

Returns: acceptedaddresssuggestions (boolean), locationid (uuid), staticemergencyaddressid (uuid)

List all phone numbers

Returns a list of all active phone numbers associated with the given external connection.

GET /externalconnections/{id}/phonenumbers

// Automatically fetches more pages as needed.
for await (const externalConnectionPhoneNumber of client.externalConnections.phoneNumbers.list(
  '1293384261075731499',
)) {
  console.log(externalConnectionPhoneNumber.civic_address_id);
}

Returns: acquiredcapabilities (array[string]), civicaddressid (uuid), displayedcountrycode (string), locationid (uuid), numberid (string), telephonenumber (string), ticket_id (uuid)

Retrieve a phone number

Return the details of a phone number associated with the given external connection.

GET /externalconnections/{id}/phonenumbers/{phonenumberid}

const phoneNumber = await client.externalConnections.phoneNumbers.retrieve('1234567889', {
  id: '1293384261075731499',
});

console.log(phoneNumber.data);

Returns: acquiredcapabilities (array[string]), civicaddressid (uuid), displayedcountrycode (string), locationid (uuid), numberid (string), telephonenumber (string), ticket_id (uuid)

Update a phone number

Asynchronously update settings of the phone number associated with the given external connection.

PATCH /externalconnections/{id}/phonenumbers/{phonenumberid}

Optional: location_id (uuid)

const phoneNumber = await client.externalConnections.phoneNumbers.update('1234567889', {
  id: '1293384261075731499',
});

console.log(phoneNumber.data);

Returns: acquiredcapabilities (array[string]), civicaddressid (uuid), displayedcountrycode (string), locationid (uuid), numberid (string), telephonenumber (string), ticket_id (uuid)

List all Releases

Returns a list of your Releases for the given external connection. These are automatically created when you change the connection_id of a phone number that is currently on Microsoft Teams.

GET /external_connections/{id}/releases

// Automatically fetches more pages as needed.
for await (const releaseListResponse of client.externalConnections.releases.list(
  '1293384261075731499',
)) {
  console.log(releaseListResponse.tenant_id);
}

Returns: createdat (string), errormessage (string), status (enum: pendingupload, pending, inprogress, complete, failed, expired, unknown), telephonenumbers (array[object]), tenantid (uuid), ticket_id (uuid)

Retrieve a Release request

Return the details of a Release request and its phone numbers.

GET /externalconnections/{id}/releases/{releaseid}

const release = await client.externalConnections.releases.retrieve(
  '7b6a6449-b055-45a6-81f6-f6f0dffa4cc6',
  { id: '1293384261075731499' },
);

console.log(release.data);

Returns: createdat (string), errormessage (string), status (enum: pendingupload, pending, inprogress, complete, failed, expired, unknown), telephonenumbers (array[object]), tenantid (uuid), ticket_id (uuid)

List all Upload requests

Returns a list of your Upload requests for the given external connection.

GET /external_connections/{id}/uploads

// Automatically fetches more pages as needed.
for await (const upload of client.externalConnections.uploads.list('1293384261075731499')) {
  console.log(upload.location_id);
}

Returns: availableusages (array[string]), errorcode (string), errormessage (string), locationid (uuid), status (enum: pendingupload, pending, inprogress, partialsuccess, success, error), tenantid (uuid), ticketid (uuid), tnupload_entries (array[object])

Creates an Upload request

Creates a new Upload request to Microsoft teams with the included phone numbers. Only one of civicaddressid or locationid must be provided, not both. The maximum allowed phone numbers for the numbersids array is 1000.

POST /externalconnections/{id}/uploads — Required: numberids

Optional: additionalusages (array[string]), civicaddressid (uuid), locationid (uuid), usage (enum: callinguserassignment, firstpartyapp_assignment)

const upload = await client.externalConnections.uploads.create('1293384261075731499', {
  number_ids: [
    '3920457616934164700',
    '3920457616934164701',
    '3920457616934164702',
    '3920457616934164703',
  ],
});

console.log(upload.ticket_id);

Returns: success (boolean), ticket_id (uuid)

Refresh the status of all Upload requests

Forces a recheck of the status of all pending Upload requests for the given external connection in the background.

POST /external_connections/{id}/uploads/refresh

const response = await client.externalConnections.uploads.refreshStatus('1293384261075731499');

console.log(response.success);

Returns: success (boolean)

Get the count of pending upload requests

Returns the count of all pending upload requests for the given external connection.

GET /external_connections/{id}/uploads/status

const response = await client.externalConnections.uploads.pendingCount('1293384261075731499');

console.log(response.data);

Returns: pendingnumberscount (integer), pendingorderscount (integer)

Retrieve an Upload request

Return the details of an Upload request and its phone numbers.

GET /externalconnections/{id}/uploads/{ticketid}

const upload = await client.externalConnections.uploads.retrieve(
  '7b6a6449-b055-45a6-81f6-f6f0dffa4cc6',
  { id: '1293384261075731499' },
);

console.log(upload.data);

Returns: availableusages (array[string]), errorcode (string), errormessage (string), locationid (uuid), status (enum: pendingupload, pending, inprogress, partialsuccess, success, error), tenantid (uuid), ticketid (uuid), tnupload_entries (array[object])

Retry an Upload request

If there were any errors during the upload process, this endpoint will retry the upload request. In some cases this will reattempt the existing upload request, in other cases it may create a new upload request. Please check the ticket_id in the response to determine if a new upload request was created.

POST /externalconnections/{id}/uploads/{ticketid}/retry

const response = await client.externalConnections.uploads.retry(
  '7b6a6449-b055-45a6-81f6-f6f0dffa4cc6',
  { id: '1293384261075731499' },
);

console.log(response.data);

Returns: availableusages (array[string]), errorcode (string), errormessage (string), locationid (uuid), status (enum: pendingupload, pending, inprogress, partialsuccess, success, error), tenantid (uuid), ticketid (uuid), tnupload_entries (array[object])

List uploaded media

Returns a list of stored media files.

GET /media

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

console.log(media.data);

Returns: contenttype (string), createdat (string), expiresat (string), medianame (string), updated_at (string)

Upload media

Upload media file to Telnyx so it can be used with other Telnyx services

POST /media — Required: media_url

Optional: medianame (string), ttlsecs (integer)

const response = await client.media.upload({ media_url: 'http://www.example.com/audio.mp3' });

console.log(response.data);

Returns: contenttype (string), createdat (string), expiresat (string), medianame (string), updated_at (string)

Retrieve stored media

Returns the information about a stored media file.

GET /media/{media_name}

const media = await client.media.retrieve('media_name');

console.log(media.data);

Returns: contenttype (string), createdat (string), expiresat (string), medianame (string), updated_at (string)

Update stored media

Updates a stored media file.

PUT /media/{media_name}

Optional: mediaurl (string), ttlsecs (integer)

const media = await client.media.update('media_name');

console.log(media.data);

Returns: contenttype (string), createdat (string), expiresat (string), medianame (string), updated_at (string)

Deletes stored media

Deletes a stored media file.

DELETE /media/{media_name}

await client.media.delete('media_name');

Download stored media

Downloads a stored media file.

GET /media/{media_name}/download

const response = await client.media.download('media_name');

console.log(response);

const content = await response.blob();
console.log(content);

Refresh Operator Connect integration

This endpoint will make an asynchronous request to refresh the Operator Connect integration with Microsoft Teams for the current user. This will create new external connections on the user's account if needed, and/or report the integration results as log messages.

POST /operator_connect/actions/refresh

const response = await client.operatorConnect.actions.refresh();

console.log(response.message);

Returns: message (string), success (boolean)

List all recording transcriptions

Returns a list of your recording transcriptions.

GET /recording_transcriptions

// Automatically fetches more pages as needed.
for await (const recordingTranscription of client.recordingTranscriptions.list()) {
  console.log(recordingTranscription.id);
}

Returns: createdat (string), durationmillis (int32), id (string), recordtype (enum: recordingtranscription), recordingid (string), status (enum: in-progress, completed), transcriptiontext (string), updated_at (string)

Retrieve a recording transcription

Retrieves the details of an existing recording transcription.

GET /recordingtranscriptions/{recordingtranscription_id}

const recordingTranscription = await client.recordingTranscriptions.retrieve(
  '6a09cdc3-8948-47f0-aa62-74ac943d6c58',
);

console.log(recordingTranscription.data);

Returns: createdat (string), durationmillis (int32), id (string), recordtype (enum: recordingtranscription), recordingid (string), status (enum: in-progress, completed), transcriptiontext (string), updated_at (string)

Delete a recording transcription

Permanently deletes a recording transcription.

DELETE /recordingtranscriptions/{recordingtranscription_id}

const recordingTranscription = await client.recordingTranscriptions.delete(
  '6a09cdc3-8948-47f0-aa62-74ac943d6c58',
);

console.log(recordingTranscription.data);

Returns: createdat (string), durationmillis (int32), id (string), recordtype (enum: recordingtranscription), recordingid (string), status (enum: in-progress, completed), transcriptiontext (string), updated_at (string)

List all call recordings

Returns a list of your call recordings.

GET /recordings

// Automatically fetches more pages as needed.
for await (const recordingResponseData of client.recordings.list()) {
  console.log(recordingResponseData.id);
}

Returns: callcontrolid (string), calllegid (string), callsessionid (string), channels (enum: single, dual), conferenceid (string), connectionid (string), createdat (string), downloadurls (object), durationmillis (int32), from (string), id (string), initiatedby (string), recordtype (enum: recording), recordingendedat (string), recordingstartedat (string), source (enum: conference, call), status (enum: completed), to (string), updatedat (string)

Delete a list of call recordings

Permanently deletes a list of call recordings.

POST /recordings/actions/delete

const action = await client.recordings.actions.delete({
  ids: ['428c31b6-7af4-4bcb-b7f5-5013ef9657c1', '428c31b6-7af4-4bcb-b7f5-5013ef9657c2'],
});

console.log(action.status);

Returns: status (enum: ok)

Retrieve a call recording

Retrieves the details of an existing call recording.

GET /recordings/{recording_id}

const recording = await client.recordings.retrieve('recording_id');

console.log(recording.data);

Returns: callcontrolid (string), calllegid (string), callsessionid (string), channels (enum: single, dual), conferenceid (string), connectionid (string), createdat (string), downloadurls (object), durationmillis (int32), from (string), id (string), initiatedby (string), recordtype (enum: recording), recordingendedat (string), recordingstartedat (string), source (enum: conference, call), status (enum: completed), to (string), updatedat (string)

Delete a call recording

Permanently deletes a call recording.

DELETE /recordings/{recording_id}

const recording = await client.recordings.delete('recording_id');

console.log(recording.data);

Returns: callcontrolid (string), calllegid (string), callsessionid (string), channels (enum: single, dual), conferenceid (string), connectionid (string), createdat (string), downloadurls (object), durationmillis (int32), from (string), id (string), initiatedby (string), recordtype (enum: recording), recordingendedat (string), recordingstartedat (string), source (enum: conference, call), status (enum: completed), to (string), updatedat (string)

Create a SIPREC connector

Creates a new SIPREC connector configuration.

POST /siprec_connectors

const siprecConnector = await client.siprecConnectors.create({
  host: 'siprec.telnyx.com',
  name: 'my-siprec-connector',
  port: 5060,
});

console.log(siprecConnector.data);

Returns: appsubdomain (string), createdat (string), host (string), name (string), port (integer), recordtype (string), updatedat (string)

Retrieve a SIPREC connector

Returns details of a stored SIPREC connector.

GET /siprecconnectors/{connectorname}

const siprecConnector = await client.siprecConnectors.retrieve('connector_name');

console.log(siprecConnector.data);

Returns: appsubdomain (string), createdat (string), host (string), name (string), port (integer), recordtype (string), updatedat (string)

Update a SIPREC connector

Updates a stored SIPREC connector configuration.

PUT /siprecconnectors/{connectorname}

const siprecConnector = await client.siprecConnectors.update('connector_name', {
  host: 'siprec.telnyx.com',
  name: 'my-siprec-connector',
  port: 5060,
});

console.log(siprecConnector.data);

Returns: appsubdomain (string), createdat (string), host (string), name (string), port (integer), recordtype (string), updatedat (string)

Delete a SIPREC connector

Deletes a stored SIPREC connector.

DELETE /siprecconnectors/{connectorname}

await client.siprecConnectors.delete('connector_name');