Every request to the Krino API carries an API key. It goes in the X-API-KEY header; it is not accepted in a query string or in the body.

Creating a key

In the management UI: Settings → API Keys. The key is shown once at creation and never again — only a digest of it is stored.
Do not put the key in source code, in a committed env file, or in a client application. A Krino key is the authority to make decisions on your behalf.

Secret and publishable keys

Only a secret key is accepted in X-API-KEY. A publishable key — the one that starts with pk_ — is made to be embedded in a public page for the device collector; anybody can read it from the page source, so it is refused on the decision, ingestion and health endpoints with 401, however it is sent.

Role

Every key has a role. The narrowest role an integration needs is ApiClient: it can send events and ask for decisions, but cannot reach rule or user management.

Rotating a key

Keys do not expire; rotation is your call. The order that avoids downtime:
1

Create the new key

The old one keeps working.
2

Deploy your services with it

Make sure they have all switched over.
3

Delete the old one

Requests with a deleted key get 401.
A deleted or revoked key stops working on every API server within a minute. A resolved key is cached for at most that long and then read again from the database, so revocation does not depend on a shared cache reaching every server.

Errors