Skip to main content
POST
cURL

Authorizations

Authorization
string
header
required

Your API key, sent as Authorization: Bearer <key>. A key is nrk_live_ or nrk_test_, a 26-character key id, _ and a 43-character secret. A key sees only its own environment's data.

Each key has one or more scopes: assess creates and reads assessments, records outcomes and reports key usage; history reads assessments, an account's current risk and an account's history, and erases an account; detailed adds the detailed view; webhooks registers, tests, rotates and deletes webhook endpoints; integrations registers and manages hosted provider integrations. A missing, unknown, revoked or expired key answers 401. A valid key without the scope an operation needs answers 403.

Headers

Idempotency-Key
string
required

Opaque client key, 16 to 128 characters of [A-Za-z0-9._:-] (a UUID or ULID fits). Scoped to the workspace principal and bound to the canonical body for 24 hours.

Required string length: 16 - 128
Pattern: ^[A-Za-z0-9._:-]{16,128}$

Body

application/json

POST /v1/key_usage/batches body: facts about requests made with API keys your platform issued to your accounts, one event per request. Each event names the key by the SHA-256 that the assessment's issued_credential.sha256 carried, not the key itself. The SDKs buffer events and send them in the background. A batch holds 1 to 500 events and at most 256 KiB. Idempotency-Key is required and binds the body as on POST /v1/assessments, so a retried batch is counted once.

events
object[]
required
Required array length: 1 - 500 elements

Response

The batch was recorded: accepted events are counted and ignored ones added nothing. A replay of the same Idempotency-Key and body answers the record the first request created, with Idempotent-Replayed: true, and counts nothing again.

The 202 answer of POST /v1/key_usage/batches. A replay with the same Idempotency-Key and body answers the same record and counts nothing again.

id
string
required

Opaque, server-assigned id of the batch: 'kub_' and a 26-character Crockford base32 ULID.

Pattern: ^kub_[0-9A-HJKMNP-TV-Z]{26}$
received_at
string<date-time>
required

When NoResponse first recorded the batch.

accepted
integer
required

Events counted.

Required range: 0 <= x <= 500
ignored
integer
required

Events that added nothing: a private, reserved or unreadable ip, or an occurred_at more than 24 hours old or more than 5 minutes ahead.

Required range: 0 <= x <= 500