Skip to main content
This guide covers common patterns for automating workflows with the Telnyx CLI — output formats, filtering, and integration with scripts and CI/CD pipelines.

Output Formats

The CLI supports multiple output formats via the --format flag.

Auto Format (Default)

Interactive exploration mode, best for browsing data:

JSON Format

Machine-readable output for scripting and automation:

YAML Format

Human-readable structured output:

Pretty Format

Indented, colorized JSON:

Raw Format

Unformatted API response:

All Format Options

Transforming Output with GJSON

Use --transform to extract specific fields using GJSON syntax:

Filtering JSON with jq

Combine with jq for powerful filtering:

Pagination

List commands support pagination via filter parameters:

Filtering

Most list commands support filtering via individual --filter.* flags:
Filter flag names use kebab-case (e.g., --filter.country-code, not --filter.country_code).

Global Flags

These flags work with all commands:

Environment Variables

Scripting Examples

Bash: Bulk SMS Send

Bash: Export Numbers to CSV

Bash: Monitor Account Balance

GitHub Actions: Deploy Notification

Debug Mode

To inspect the full HTTP request and response:
This is useful for:
  • Troubleshooting authentication issues
  • Understanding the exact API calls being made
  • Debugging unexpected responses

Next Steps

Command Reference

Full list of all commands

Troubleshooting

Common issues and solutions