Skip to main content
This reference covers common issues you may encounter when using the Telnyx CLI and how to resolve them.
Most CLI errors map directly to API error codes. For a complete list, see API Error Codes.

Authentication Errors

”Unauthorized” (401)

Causes:
  • Invalid or expired API key
  • API key not set
  • API key has extra whitespace or characters
Solutions:
  1. Verify your API key is set:
  2. Check the key format (should start with KEY_):
  3. Verify the key in the Telnyx Portal
  4. Test with a simple command:

“No API key” Error

Causes:
  • Environment variable not set
  • Environment variable not exported
Solutions:
  1. Set the environment variable:
  2. Verify it’s exported (not just set):
  3. Add to your shell profile for persistence:

Permission Errors

”Forbidden” (403)

Causes:
  • API key doesn’t have permission for this action
  • Resource belongs to a different account
  • Account verification required
Solutions:
  1. Check API key permissions in the Portal
  2. Verify you’re using the correct API key for the account
  3. Some features require account verification (verify here)

Resource Errors

”Not Found” (404)

Causes:
  • Resource ID is incorrect
  • Resource was deleted
  • Resource belongs to a different account
Solutions:
  1. Verify the resource exists:
  2. Check for typos in the resource ID
  3. Ensure you’re using the correct API key if you have multiple accounts

”Phone number not found”

Solution: List your numbers to see what’s available:

Rate Limiting

”Too Many Requests” (429)

Causes:
  • Exceeded API rate limits
  • Too many requests in short period
Solutions:
  1. Add delays between requests in scripts:
  2. Use bulk endpoints when available
  3. Check rate limits documentation

Messaging Errors

”Number not enabled for messaging”

Solutions:
  1. Enable messaging on the number via the Portal or API
  2. Or purchase a messaging-enabled number:

“10DLC campaign required”

Solution: Register for 10DLC via the Portal or API. See the 10DLC documentation.

”Invalid ‘to’ number”

Solutions:
  1. Use E.164 format (include country code):
  2. Verify the number is valid:

Installation Issues

”command not found: telnyx”

Causes:
  • CLI not installed
  • Go bin directory not in PATH
  • Shell not reloaded after install
Solutions:
  1. Verify Go’s bin directory contains telnyx:
  2. Add Go bin to PATH:
  3. Reinstall if needed:
  4. Reload your shell config:

“command not found: go”

Causes:
  • Go not installed
Solutions: Install Go:

Go version error

Solution: Upgrade Go:

Build/compile errors

Solutions:
  1. Ensure you have Go 1.22+:
  2. Clear module cache and retry:

Connection Issues

Network error / Connection refused

Causes:
  • No internet connection
  • Firewall blocking requests
  • Proxy misconfiguration
Solutions:
  1. Check internet connectivity
  2. Verify you can reach the API:
  3. Check proxy settings if applicable

Timeout errors

Solutions:
  1. Check your internet connection
  2. Try again (may be temporary)
  3. For large operations, the API may need more time

Getting More Help

Enable Debug Mode

For detailed HTTP request/response logging:

Check CLI Version

Ensure you’re on the latest version:

Get Support