SELECT and get rows back. You only ever see your own workspace’s data. Use it to build usage dashboards, bill on verifications, find keys that are hitting limits, or answer a one-off question.
Get access
Ask support@unkey.com to turn on analytics for your workspace. There’s no plan gate and no self-serve switch. Until it’s on, the endpoints return HTTP 412 witherr:unkey:data:analytics_not_configured. Once it’s on, the restrictions and quotas apply.
You need a root key with the permissions listed on this page. Create one under Root Keys in the dashboard sidebar. See Permission reference for every permission.
The endpoints
There are four, one per data set. Each takes{"query": "<SQL>"} and returns data as an array of rows, keyed by the column names you selected.
A root key with
read_analytics for specific keyspaces (or namespaces) instead of * only sees rows for those.
Response
Public tables
key_verifications_v1 has one row per verification. key_verifications_per_minute_v1, _per_hour_v1, _per_day_v1, and _per_month_v1 are rollups, much faster for charts and totals. The ratelimits tables follow the same pattern. Any other table name fails with err:user:bad_request:invalid_analytics_table. Columns and types are on key_verifications tables and ratelimits tables.
Where to go next
Analytics query language
Analytics restrictions and quotas
Analytics query examples
Analytics troubleshooting
unkey api analytics get-verifications and unkey api analytics get-ratelimits. The CLI reference starts at get-verifications.