Skip to main content

get-verifications

Run custom SQL queries against your key verification analytics data using the Unkey CLI. Export results for billing, reporting, or debugging.
2 min read

Execute custom SQL queries against your key verification analytics.

Use this to inspect verification patterns, monitor outcomes, and build custom reports over your key usage data. Only SELECT queries are allowed. The response rows are dynamic -- fields vary based on your SQL SELECT clause and can include any combination of columns such as time, outcome, count, key_id, and more.

For complete documentation including available tables, columns, data types, and query examples, see the schema reference in the API documentation.

Required permissions:

  • analytics.*.read_verifications (to query verification analytics)
Note

See the API reference for the full HTTP endpoint documentation.

Usage#

Flags#

--querystringrequired#

SQL SELECT query to execute against your analytics data. Only SELECT queries are allowed. The query runs against the key_verifications_v1 table, which contains columns like time, key_id, outcome, and more. See the API reference for the full schema.

Global Flags#

FlagTypeDescription
--root-keystringOverride root key ($UNKEY_ROOT_KEY)
--api-urlstringOverride API base URL (default: https://api.unkey.com)
--configstringPath to config file (default: ~/.unkey/config.toml)
--outputstringOutput format. Use json for raw JSON
--bodystringSend this JSON string as the request body. You cannot combine it with request-building flags.

Examples#

Output#

Default output shows the request ID, followed by the query results:

With --output=json, the full response envelope is returned: