Skip to main content
Idem authenticates every request using API keys passed as Bearer tokens in the Authorization header. Keys have the format sk_live_{uuid} and are stored bcrypt-hashed — the raw value is only ever returned once, at creation time. Each key carries one or more scopes that control exactly what it can do; there are no global, all-access keys by default. Applying the principle of least privilege keeps your ledger safe even if a key is compromised.

Passing your API key

Include your key in the Authorization header of every request.
Never expose your API key in client-side code, public repositories, or log output. Treat it with the same care as a private password.

Creating API keys

Creating a key requires the ADMIN scope. Send a POST request to /api/v1/api-keys with the list of scopes the new key should carry.
A successful request returns 201 Created with the key details:
The rawKey value is shown exactly once — at creation time. Idem does not store it in recoverable form. Copy it to your secrets manager immediately. If you lose it, revoke the key and create a new one.

Available scopes

Assign only the scopes a key actually needs. A tightly scoped key limits blast radius if the credential is ever leaked.
For production service accounts, create one key per service with only the scopes that service needs. For example, a reconciliation job only needs RECONCILIATION_READ and RECONCILIATION_WRITE — it does not need TRANSACTIONS_WRITE or ADMIN.

Listing your API keys

Listing keys requires the ADMIN scope. You can retrieve all active keys for your tenant at any time. The response includes scope assignments and creation timestamps, but never the raw key values.

Revoking a key

To revoke a key, send a DELETE request with the keyId you want to invalidate. Revoking requires the ADMIN scope. A successful revocation returns 204 No Content — the key stops working immediately, and all subsequent requests using it receive a 401 response.
Revocation is permanent. If you need the same permissions again, create a new key with the same scopes.

Error responses

When you receive a 403, check the scope table above and ensure the key used for the request includes the required scope. If it does not, create a new key with the correct scopes or ask your admin to update the existing key.