Skip to content
telnyx-cli logo

telnyx-cli

Telnyx API integration via CLI. Send SMS/MMS/WhatsApp messages, manage phone numbers, query call logs, debug webhooks, and access your Telnyx account. Use when interacting with Telnyx APIs, managing messaging, or accessing account data.

SKILL.md

Full skill instructions

Telnyx CLI

Telnyx API integration for OpenClaw: messaging, phone numbers, webhooks, and account management.

Setup

1. Install CLI

npm install -g @telnyx/​api-cli

2. Configure API Key

telnyx auth setup

Paste your API key from: https://portal.telnyx.com/#/app/api-keys

Saves to ~/​.config/​telnyx/​config.json (persistent).

3. Verify

telnyx number list

Commands

CategoryCommandDescription
Messagingtelnyx message sendSend SMS/​email/​WhatsApp
telnyx message listList messages
telnyx message getGet message status
Phone Numberstelnyx number listYour phone numbers
telnyx number searchSearch available numbers
telnyx number buyPurchase a number
telnyx number releaseRelease a number
Callstelnyx call listView calls
telnyx call getGet call details
Webhookstelnyx webhook listList webhooks
telnyx debugger listView webhook events
telnyx debugger retryRetry failed webhooks
Accounttelnyx account getAccount info & balance

Usage

Messaging

# Send SMS
telnyx message send --from +15551234567 --to +15559876543 --text "Hello!"

# List messages
telnyx message list

# Get status
telnyx message get MESSAGE_ID

Phone Numbers

# List
telnyx number list

# Search
telnyx number search --country US --npa 415

# Buy
telnyx number buy --number "+15551234567"

# Release
telnyx number release "+15551234567"

Webhooks & Debugging

# List webhooks
telnyx webhook list

# View failed deliveries
telnyx debugger list --status failed

# Retry failed
telnyx debugger retry EVENT_ID

Account

# Account info
telnyx account get

# Check balance
telnyx account get --output json | jq '.balance'

Output Formats

# Table (default)
telnyx number list

# JSON
telnyx number list --output json

# CSV
telnyx number list --output csv

Examples

Bulk Messaging

#!/​bin/​bash
while read phone; do
  telnyx message send --from +15551234567 --to "$phone" --text "Hello!"
  sleep 1  # Rate limiting
done < recipients.txt

Monitor Webhooks

#!/​bin/​bash
while true; do
  FAILED=$(telnyx debugger list --status failed --output json | jq '.data | length')
  [ "$FAILED" -gt 0 ] && echo "⚠️  $FAILED failed webhooks"
  sleep 300
done

Export Data

# CSV export
telnyx call list --limit 1000 --output csv > calls.csv

# JSON export
telnyx number list --output json > numbers.json

Tips

  • Rate limit: 100 req/​s — add sleep 1 for bulk operations
  • Use --output json or --output csv to change format
  • Get help: telnyx COMMAND --help (e.g., telnyx message --help)
  • API Key location: ~/​.config/​telnyx/​config.json

Integration with OpenClaw

# In cron jobs
0 9 * * * telnyx call list --limit 10 > /​tmp/​daily-calls.txt

# In heartbeat
telnyx debugger list --status failed

# In scripts
BALANCE=$(telnyx account get --output json | jq '.balance')
echo "Balance: $BALANCE"

Troubleshooting

CLI not found

npm install -g @telnyx/​api-cli

API key not configured

# Reconfigure
telnyx auth setup

# Or check existing config
cat ~/​.config/​telnyx/​config.json

Connection issues

# Test connection
telnyx account get

Resources