telnyx-ai-assistants-c…
AI voice assistants with custom instructions, knowledge bases, and tool integrations.
Manage call recordings, media storage, Dialogflow integration, and external connections for SIP trunking. This skill provides JavaScript SDK examples.
Claude Code
$ npx -y skills add team-telnyx/ai --skill telnyx-sip-integrations-javascript --agent claude-code
Codex
$ npx skills add team-telnyx/ai --skill telnyx-sip-integrations-javascript -a codex -y
Cursor
$ npx skills add team-telnyx/ai --skill telnyx-sip-integrations-javascript -a cursor -y
Gemini CLI
$ npx skills add team-telnyx/ai --skill telnyx-sip-integrations-javascript -a gemini-cli -y
GitHub Copilot
$ npx skills add team-telnyx/ai --skill telnyx-sip-integrations-javascript -a github-copilot -y
OpenCode
$ npx skills add team-telnyx/ai --skill telnyx-sip-integrations-javascript -a opencode -y
Windsurf
$ npx skills add team-telnyx/ai --skill telnyx-sip-integrations-javascript -a windsurf -y
name: telnyx-sip-integrations-javascript description: >- Manage call recordings, media storage, Dialogflow integration, and external connections for SIP trunking. This skill provides JavaScript SDK examples. metadata: author: telnyx product: sip-integrations language: javascript generated_by: telnyx-openapi-pipeline
<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
npm install telnyx@6.74.2
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.
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, 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).
Returns the information about custom storage credentials.
`GET /custom_storage_credentials/{connection_id}`
const customStorageCredential = await client.customStorageCredentials.retrieve('connection_id');
console.log(customStorageCredential.connection_id);Returns: `backend` (enum: gcs, s3, s3-generic, azure), `configuration` (object)
Creates a custom storage credentials configuration.
`POST /custom_storage_credentials/{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, s3-generic, azure), `configuration` (object)
Updates a stored custom credentials configuration.
`PUT /custom_storage_credentials/{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, s3-generic, azure), `configuration` (object)
Deletes a stored custom credentials configuration.
`DELETE /custom_storage_credentials/{connection_id}`
await client.customStorageCredentials.delete('connection_id');Return details of the Dialogflow connection associated with the given CallControl connection.
`GET /dialogflow_connections/{connection_id}`
const dialogflowConnection = await client.dialogflowConnections.retrieve('connection_id');
console.log(dialogflowConnection.data);Returns: `connection_id` (string), `conversation_profile_id` (string), `environment` (string), `record_type` (string), `service_account` (string)
Save Dialogflow Credentiails to Telnyx, so it can be used with other Telnyx services.
`POST /dialogflow_connections/{connection_id}`
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: `connection_id` (string), `conversation_profile_id` (string), `environment` (string), `record_type` (string), `service_account` (string)
Updates the stored Dialogflow connection for the specified connection and returns the updated configuration.
`PUT /dialogflow_connections/{connection_id}`
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: `connection_id` (string), `conversation_profile_id` (string), `environment` (string), `record_type` (string), `service_account` (string)
Deletes the stored Dialogflow connection for the specified connection.
`DELETE /dialogflow_connections/{connection_id}`
``
This repo is the one-stop shop for AI Agents and AI-first developers building with Telnyx — everything an agent needs to build production-grade applications and manage its account, from signup to funding.
AI voice assistants with custom instructions, knowledge bases, and tool integrations.
AI voice assistants with custom instructions, knowledge bases, and tool integrations.
AI voice assistants with custom instructions, knowledge bases, and tool integrations.
AI voice assistants with custom instructions, knowledge bases, and tool integrations.
AI voice assistants with custom instructions, knowledge bases, and tool integrations.
AI voice assistants with custom instructions, knowledge bases, and tool integrations.
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.