---
title: "Query key verification data"
method: POST
path: "/v2/analytics.getVerifications"
tags: ["analytics"]
---

# Query key verification data

`POST /v2/analytics.getVerifications`

Execute custom SQL queries against your key verification analytics. CTEs, subqueries, UNION, and EXCEPT are supported.
Queries must use one of the five public aliases: `key_verifications_v1`, `key_verifications_per_minute_v1`, `key_verifications_per_hour_v1`, `key_verifications_per_day_v1`, or `key_verifications_per_month_v1`. Physical `default.*` table names are unsupported.
Queries are always restricted to the authenticated workspace. Wildcard analytics permission can read every API in that workspace; API-scoped permissions automatically restrict results to the permitted APIs.
For complete documentation including available tables, columns, data types, query examples, see the schema reference in the API documentation.

## Request body

- V2AnalyticsGetVerificationsRequestBody
  - `query` string, required — SQL query to execute against your analytics data. Queries may reference only the five public aliases: `key_verifications_v1`, `key_verifications_per_minute_v1`, `key_verifications_per_hour_v1`, `key_verifications_per_day_v1`, or `key_verifications_per_month_v1`. Physical `default.*` table names are unsupported. Only SELECT queries are allowed. CTEs, subqueries, UNION, and EXCEPT are supported.

## Response `200`

Query executed successfully

- V2AnalyticsGetVerificationsResponseBody
  - `meta` Meta, required — Metadata object included in every API response. This provides context about the request and is essential for debugging, audit trails, and support inquiries. The `requestId` is particularly important when troubleshooting issues with the Unkey support team.
    - `requestId` string, required — A unique id for this request. Always include this ID when contacting support about a specific API request. This identifier allows Unkey's support team to trace the exact request through logs and diagnostic systems to provide faster assistance.
  - `data` object[], required — Array of verification rows returned by the query. Fields vary based on the SQL SELECT clause.

## Other responses

- `400` — Invalid SQL query, blocked operation, or missing required authentication
- `401` — Invalid authentication credentials
- `403` — Insufficient permissions
- `422` — Query exceeds resource limits (timeout, memory, rows scanned, or result size)
- `429` — Query quota exceeded
- `500` — Query execution failed
- `503` — Connection to the database failed

---

[API](https://skmtc.net/unkeyed/apis/unkey-api.md) · [All operations](https://skmtc.net/unkeyed/apis/unkey-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/unkeyed/unkey-api/revisions/4bd11a7252bc/schema)
