productivity
Telnyx CLI for AI Agents
Use the Telnyx CLI from KosmoKrator to call Telnyx tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.Telnyx CLI Setup
Telnyx can be configured headlessly with `kosmokrator integrations:configure telnyx`.
# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash
# Configure and verify this integration.
kosmokrator integrations:configure telnyx --set api_key="$TELNYX_API_KEY" --enable --read allow --write ask --json
kosmokrator integrations:doctor telnyx --json
kosmokrator integrations:status --json Credentials
Authentication type: API key api_key. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
api_key | TELNYX_API_KEY | Secret secret | yes | API Key |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call telnyx.telnyx_list_phone_numbers '{"page_size":1,"page_number":1,"filter_phone_number":"example_filter_phone_number","filter_status":"example_filter_status"}' --json kosmo integrations:telnyx telnyx_list_phone_numbers '{"page_size":1,"page_number":1,"filter_phone_number":"example_filter_phone_number","filter_status":"example_filter_status"}' --json Discovery
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs telnyx --json
kosmo integrations:docs telnyx.telnyx_list_phone_numbers --json
kosmo integrations:schema telnyx.telnyx_list_phone_numbers --json
kosmo integrations:search "Telnyx" --json
kosmo integrations:list --json Automation Contexts
The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.
CLI Functions
Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.
telnyx.telnyx_list_phone_numbers
List phone numbers on your Telnyx account. Returns phone number IDs, numbers in E.164 format, status, and billing details.
read - Parameters
- page_size, page_number, filter_phone_number, filter_status
kosmo integrations:call telnyx.telnyx_list_phone_numbers '{"page_size":1,"page_number":1,"filter_phone_number":"example_filter_phone_number","filter_status":"example_filter_status"}' --json kosmo integrations:telnyx telnyx_list_phone_numbers '{"page_size":1,"page_number":1,"filter_phone_number":"example_filter_phone_number","filter_status":"example_filter_status"}' --json telnyx.telnyx_get_phone_number
Get details for a specific phone number by its ID. Returns the number, status, connection, and billing information.
read - Parameters
- phone_number_id
kosmo integrations:call telnyx.telnyx_get_phone_number '{"phone_number_id":"example_phone_number_id"}' --json kosmo integrations:telnyx telnyx_get_phone_number '{"phone_number_id":"example_phone_number_id"}' --json telnyx.telnyx_list_messages
List SMS and MMS messages sent and received on your Telnyx account. Supports filtering by direction, phone number, and date range.
read - Parameters
- page_size, page_number, direction, filter_source, filter_destination, filter_status
kosmo integrations:call telnyx.telnyx_list_messages '{"page_size":1,"page_number":1,"direction":"example_direction","filter_source":"example_filter_source","filter_destination":"example_filter_destination","filter_status":"example_filter_status"}' --json kosmo integrations:telnyx telnyx_list_messages '{"page_size":1,"page_number":1,"direction":"example_direction","filter_source":"example_filter_source","filter_destination":"example_filter_destination","filter_status":"example_filter_status"}' --json telnyx.telnyx_send_sms
Send an SMS or MMS message via Telnyx. Provide a sender phone number (from your Telnyx account), a destination number, and the message body.
write - Parameters
- from, to, text, subject, media_urls, use_mms
kosmo integrations:call telnyx.telnyx_send_sms '{"from":"example_from","to":"example_to","text":"example_text","subject":"example_subject","media_urls":"example_media_urls","use_mms":true}' --json kosmo integrations:telnyx telnyx_send_sms '{"from":"example_from","to":"example_to","text":"example_text","subject":"example_subject","media_urls":"example_media_urls","use_mms":true}' --json telnyx.telnyx_list_calls
List voice calls made on your Telnyx account. Returns call session IDs, status, participants, and duration.
read - Parameters
- page_size, page_number, filter_status
kosmo integrations:call telnyx.telnyx_list_calls '{"page_size":1,"page_number":1,"filter_status":"example_filter_status"}' --json kosmo integrations:telnyx telnyx_list_calls '{"page_size":1,"page_number":1,"filter_status":"example_filter_status"}' --json telnyx.telnyx_get_call
Get details for a specific voice call by its call session ID. Returns participants, status, duration, and call metadata.
read - Parameters
- call_session_id
kosmo integrations:call telnyx.telnyx_get_call '{"call_session_id":"example_call_session_id"}' --json kosmo integrations:telnyx telnyx_get_call '{"call_session_id":"example_call_session_id"}' --json telnyx.telnyx_list_call_records
List call recordings stored on your Telnyx account. Returns recording IDs, associated call sessions, download URLs, duration, and creation timestamps.
read - Parameters
- page_size, page_number, filter_call_session_id, filter_conference_id
kosmo integrations:call telnyx.telnyx_list_call_records '{"page_size":1,"page_number":1,"filter_call_session_id":"example_filter_call_session_id","filter_conference_id":"example_filter_conference_id"}' --json kosmo integrations:telnyx telnyx_list_call_records '{"page_size":1,"page_number":1,"filter_call_session_id":"example_filter_call_session_id","filter_conference_id":"example_filter_conference_id"}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
telnyx.telnyx_list_phone_numbers 4 parameters
kosmo integrations:schema telnyx.telnyx_list_phone_numbers --json | Parameter | Type | Required | Description |
|---|---|---|---|
page_size | integer | no | Number of results per page (default: 20, max: 250). |
page_number | integer | no | Page number to retrieve (starts at 1). |
filter_phone_number | string | no | Filter by phone number in E.164 format (e.g., "+12345678900"). |
filter_status | string | no | Filter by phone number status. |
telnyx.telnyx_get_phone_number 1 parameters
kosmo integrations:schema telnyx.telnyx_get_phone_number --json | Parameter | Type | Required | Description |
|---|---|---|---|
phone_number_id | string | yes | The Telnyx phone number ID (e.g., "1293384265029123456"). |
telnyx.telnyx_list_messages 6 parameters
kosmo integrations:schema telnyx.telnyx_list_messages --json | Parameter | Type | Required | Description |
|---|---|---|---|
page_size | integer | no | Number of results per page (default: 20, max: 250). |
page_number | integer | no | Page number to retrieve (starts at 1). |
direction | string | no | Filter by message direction. |
filter_source | string | no | Filter by source phone number in E.164 format. |
filter_destination | string | no | Filter by destination phone number in E.164 format. |
filter_status | string | no | Filter by delivery status. |
telnyx.telnyx_send_sms 6 parameters
kosmo integrations:schema telnyx.telnyx_send_sms --json | Parameter | Type | Required | Description |
|---|---|---|---|
from | string | yes | Sender phone number in E.164 format (e.g., "+12345678900"). Must be a number on your Telnyx account. |
to | string | yes | Destination phone number in E.164 format (e.g., "+19876543210"). |
text | string | yes | The text body of the message. |
subject | string | no | Subject line (for MMS messages). |
media_urls | array | no | Array of media URLs to include as MMS attachments. |
use_mms | boolean | no | Set to true to send as MMS. Defaults to false (SMS). |
telnyx.telnyx_list_calls 3 parameters
kosmo integrations:schema telnyx.telnyx_list_calls --json | Parameter | Type | Required | Description |
|---|---|---|---|
page_size | integer | no | Number of results per page (default: 20, max: 250). |
page_number | integer | no | Page number to retrieve (starts at 1). |
filter_status | string | no | Filter by call session status. |
telnyx.telnyx_get_call 1 parameters
kosmo integrations:schema telnyx.telnyx_get_call --json | Parameter | Type | Required | Description |
|---|---|---|---|
call_session_id | string | yes | The Telnyx call session ID (e.g., "0ccc7b54-4e3a-4fa1-8c3f-5d2e3f4g5h6i"). |
telnyx.telnyx_list_call_records 4 parameters
kosmo integrations:schema telnyx.telnyx_list_call_records --json | Parameter | Type | Required | Description |
|---|---|---|---|
page_size | integer | no | Number of results per page (default: 20, max: 250). |
page_number | integer | no | Page number to retrieve (starts at 1). |
filter_call_session_id | string | no | Filter recordings by call session ID. |
filter_conference_id | string | no | Filter recordings by conference ID. |
Permissions
Headless calls still follow the integration read/write permission policy. Configure read/write defaults with
integrations:configure. Add --force only for trusted automation that should bypass that policy.