stripe reporting query-runs creates and retrieves ad hoc queries
Introduced 2026-07-09 · score 0.99
HOW TO USE IT
When running an ad hoc SQL query against Stripe data, create a query run with exactly one SQL source, then retrieve its ID to check status and access the result download URL.
stripe reporting query-runs create --sql "<SQL>"stripe reporting query-runs create --sql-file <path> [--compress-file] [--dry-run] [--live]stripe reporting query-runs retrieve <id> [--live]WHY THIS HELPS
Run and inspect an ad hoc SQL query against Stripe data from the CLI.
BEFORE THIS CHANGE
The CLI could retrieve Sigma scheduled queries through the older `/v1/sigma` endpoint, but could not start new or ad hoc queries.
REQUIREMENTS AND LIMITATIONS
- Version: v1.43.7
- Availability: The API is in public preview.
- --sql (required): SQL query text; required unless --sql-file is set. Mutually exclusive with --sql-file.
- --sql-file <path> (required): Read SQL from a file; use `-` to read stdin. Required unless --sql is set; mutually exclusive with --sql.
- --compress-file: Compress the result file; sets `result_options.compress_file` to true.
- --dry-run: Preview the request without sending it.
- --live: Make a live request; default is test mode.
- <id> (required): ID of the query run to retrieve.
- result_options.compress_file: Boolean set to true by `--compress-file`; the source documents no alternative sub-keys or allowed values.
- Prerequisite: A Stripe API key must be available through the selected CLI profile; the command reads the profile's test or live API key.
- Prerequisite: The endpoint is a preview API; the CLI marks both commands as preview commands and sets the preview Stripe-Version header automatically.
- The request builder sets `Stripe-Version: 2026-06-24.preview` and JSON content-type automatically.
- Retrieve polls query status (`running` → `succeeded`/`failed`) and fetches the result download URL.
FIRST-PARTY EVIDENCE
- https://github.com/stripe/stripe-cli/releases/tag/v1.43.7
- https://github.com/stripe/stripe-cli/pull/1737
- https://github.com/stripe/stripe-cli/blob/v1.43.7/pkg/cmd/reporting.go
Check the installed version and the source before using it. Entry JSON