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.

Body

application/json

POST /v1/keys/rotate body. The workspace and the key being rotated are the API key that signs the request, so neither is a body member. An empty object takes the default overlap.

overlap_seconds
integer

How long the presented key keeps working beside the new one, from 60 seconds to 7 days. Default 86400 (24 hours). At the end of the overlap the presented key stops authenticating.

Required range: 60 <= x <= 604800

Response

The new key, shown once. Both keys authenticate until previous_key_expires_at; after it only the new key does.

The 201 answer of POST /v1/keys/rotate: the new key, shown once, and when the key that was presented stops working. The new key has the scopes and the environment of the presented key.

key
string
required

The new credential, nrk_, in the environment of the presented key: nrk_live_ or nrk_test_. It is shown only in this answer and is never stored or returned again.

Pattern: ^nrk_(live|test)_[0-7][0-9A-HJKMNP-TV-Z]{25}_[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$
key_id
string
required

The public id of the new key.

Pattern: ^[0-7][0-9A-HJKMNP-TV-Z]{25}$
scopes
enum<string>[]
required

The scopes of the new key: those of the presented key.

Minimum array length: 1
Available options:
assess,
history,
webhooks,
detailed,
integrations
created_at
string<date-time>
required
previous_key_id
string
required

The id of the key that signed this request.

Pattern: ^[0-7][0-9A-HJKMNP-TV-Z]{25}$
previous_key_expires_at
string<date-time>
required

When the previous key stops authenticating. Until then both keys work.