Authentication Errors
”Unauthorized” (401)
- Invalid or expired API key
- API key not set
- API key has extra whitespace or characters
-
Verify your API key is set:
-
Check the key format (should start with
KEY_): - Verify the key in the Telnyx Portal
-
Test with a simple command:
“No API key” Error
Causes:- Environment variable not set
- Environment variable not exported
-
Set the environment variable:
-
Verify it’s exported (not just set):
-
Add to your shell profile for persistence:
Permission Errors
”Forbidden” (403)
- API key doesn’t have permission for this action
- Resource belongs to a different account
- Account verification required
- Check API key permissions in the Portal
- Verify you’re using the correct API key for the account
- Some features require account verification (verify here)
Resource Errors
”Not Found” (404)
- Resource ID is incorrect
- Resource was deleted
- Resource belongs to a different account
-
Verify the resource exists:
- Check for typos in the resource ID
- 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)
- Exceeded API rate limits
- Too many requests in short period
-
Add delays between requests in scripts:
- Use bulk endpoints when available
- Check rate limits documentation
Messaging Errors
”Number not enabled for messaging”
- Enable messaging on the number via the Portal or API
-
Or purchase a messaging-enabled number:
“10DLC campaign required”
”Invalid ‘to’ number”
-
Use E.164 format (include country code):
-
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
-
Verify Go’s bin directory contains telnyx:
-
Add Go bin to PATH:
-
Reinstall if needed:
-
Reload your shell config:
“command not found: go”
Causes:- Go not installed
Go version error
Build/compile errors
Solutions:-
Ensure you have Go 1.22+:
-
Clear module cache and retry:
Connection Issues
Network error / Connection refused
Causes:- No internet connection
- Firewall blocking requests
- Proxy misconfiguration
- Check internet connectivity
- Verify you can reach the API:
- Check proxy settings if applicable
Timeout errors
Solutions:- Check your internet connection
- Try again (may be temporary)
- 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
- GitHub Issues: Report bugs
- Telnyx Support: Contact support
- Community: Slack
- API Status: status.telnyx.com