KosmoKrator

communication

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.

7 functions 6 read 1 write API key auth

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 use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
api_key TELNYX_API_KEY Secret secret yes API Key

Call Telnyx Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

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

Use the provider shortcut form for shorter human-facing commands.

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

Agent Discovery Commands

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

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Telnyx.

telnyx.telnyx_list_phone_numbers

Read read

List phone numbers on your Telnyx account. Returns phone number IDs, numbers in E.164 format, status, and billing details.

Parameters
page_size, page_number, filter_phone_number, filter_status

Generic CLI call

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

Provider shortcut

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

Read read

Get details for a specific phone number by its ID. Returns the number, status, connection, and billing information.

Parameters
phone_number_id

Generic CLI call

kosmo integrations:call telnyx.telnyx_get_phone_number '{"phone_number_id":"example_phone_number_id"}' --json

Provider shortcut

kosmo integrations:telnyx telnyx_get_phone_number '{"phone_number_id":"example_phone_number_id"}' --json

telnyx.telnyx_list_messages

Read read

List SMS and MMS messages sent and received on your Telnyx account. Supports filtering by direction, phone number, and date range.

Parameters
page_size, page_number, direction, filter_source, filter_destination, filter_status

Generic CLI call

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

Provider shortcut

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

Write write

Send an SMS or MMS message via Telnyx. Provide a sender phone number (from your Telnyx account), a destination number, and the message body.

Parameters
from, to, text, subject, media_urls, use_mms

Generic CLI call

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

Provider shortcut

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

Read read

List voice calls made on your Telnyx account. Returns call session IDs, status, participants, and duration.

Parameters
page_size, page_number, filter_status

Generic CLI call

kosmo integrations:call telnyx.telnyx_list_calls '{"page_size":1,"page_number":1,"filter_status":"example_filter_status"}' --json

Provider shortcut

kosmo integrations:telnyx telnyx_list_calls '{"page_size":1,"page_number":1,"filter_status":"example_filter_status"}' --json

telnyx.telnyx_get_call

Read read

Get details for a specific voice call by its call session ID. Returns participants, status, duration, and call metadata.

Parameters
call_session_id

Generic CLI call

kosmo integrations:call telnyx.telnyx_get_call '{"call_session_id":"example_call_session_id"}' --json

Provider shortcut

kosmo integrations:telnyx telnyx_get_call '{"call_session_id":"example_call_session_id"}' --json

telnyx.telnyx_list_call_records

Read read

List call recordings stored on your Telnyx account. Returns recording IDs, associated call sessions, download URLs, duration, and creation timestamps.

Parameters
page_size, page_number, filter_call_session_id, filter_conference_id

Generic CLI call

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

Provider shortcut

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

List phone numbers on your Telnyx account. Returns phone number IDs, numbers in E.164 format, status, and billing details.

Operation
Read read
Schema command
kosmo integrations:schema telnyx.telnyx_list_phone_numbers --json
ParameterTypeRequiredDescription
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

Get details for a specific phone number by its ID. Returns the number, status, connection, and billing information.

Operation
Read read
Schema command
kosmo integrations:schema telnyx.telnyx_get_phone_number --json
ParameterTypeRequiredDescription
phone_number_id string yes The Telnyx phone number ID (e.g., "1293384265029123456").

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.

Operation
Read read
Schema command
kosmo integrations:schema telnyx.telnyx_list_messages --json
ParameterTypeRequiredDescription
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

Send an SMS or MMS message via Telnyx. Provide a sender phone number (from your Telnyx account), a destination number, and the message body.

Operation
Write write
Schema command
kosmo integrations:schema telnyx.telnyx_send_sms --json
ParameterTypeRequiredDescription
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

List voice calls made on your Telnyx account. Returns call session IDs, status, participants, and duration.

Operation
Read read
Schema command
kosmo integrations:schema telnyx.telnyx_list_calls --json
ParameterTypeRequiredDescription
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

Get details for a specific voice call by its call session ID. Returns participants, status, duration, and call metadata.

Operation
Read read
Schema command
kosmo integrations:schema telnyx.telnyx_get_call --json
ParameterTypeRequiredDescription
call_session_id string yes The Telnyx call session ID (e.g., "0ccc7b54-4e3a-4fa1-8c3f-5d2e3f4g5h6i").

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.

Operation
Read read
Schema command
kosmo integrations:schema telnyx.telnyx_list_call_records --json
ParameterTypeRequiredDescription
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.