portal

Get portal verifications

Changed on

Return a verification analytics timeseries for the authenticated portal session's end user.

Authenticates only with a portal session cookie and always restricts results to verification events attributed to the session's external identity. Unlike analytics.getVerifications, this endpoint takes a fixed time window (no query language) and returns outcome-broken-out counts. Bucket granularity is chosen automatically from the window size.

The response carries one zero-filled series per key the end user has verifications for, so a client can render both a per-key table and an account-wide chart from one call by summing them. Pass keyId to narrow the window to a single key.

post/v2/portal.getVerifications

Request

  • Base URL
    https://api.unkey.com
  • URL
    https://api.unkey.com/v2/portal.getVerifications
  • Auth
    API key in cookie portal_session

Request body

startTimeinteger required

Start of the query window as a unix timestamp in milliseconds (inclusive).

endTimeinteger required

End of the query window as a unix timestamp in milliseconds (exclusive). Bucket granularity (minute, hour, or day) is chosen automatically from the window size.

keyIdstring

Optional. Restrict results to a single key. The key must belong to the authenticated end user; results are always scoped to the session identity regardless of this value.

Example request

{
  "startTime": 1704067200000,
  "endTime": 1704672000000,
  "keyId": "key_1234abcd"
}

Response

Successfully retrieved verification analytics.

bucketMillisinteger required

Width of one bucket in milliseconds, chosen from the window size. Every series below is aligned to it, so a client can build the buckets for a window that returned no keys at all without restating the granularity rule.

Example response

{
  "meta": {
    "requestId": "req_123"
  },
  "bucketMillis": 60000,
  "keys": [
    {
      "keyId": "key_1234abcd",
      "data": [
        {
          "time": 1704067200000
        }
      ]
    }
  ]
}

Changes

    • breaking

      removed the required property from the response with the status

    • info

      added the non-success response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      endpoint added