API keys
5 endpoints in this family.
List recent API calls
GET/api/v1/api-requests
Every call made to /api/v1 with one of your account's keys over the last 30 days: method, address, status, error code, duration, and the client the call acted on (null for account-level calls such as /tenants or /keys). Newest first. Use it to see why a call failed without asking us.
A key that is not pinned sees every call and may narrow them with clientId (or the Nodium-Tenant header); a key pinned to a client sees only the calls made on that client. Neither bodies, headers nor query strings are kept. A call refused because the key itself was wrong is not listed: we cannot tell whose it was.
Query parameters
apiKeyIdstringOnly calls made with this key.
clientIdstringOnly calls made on this client (id). Ignored for a pinned key.
errorsOnlybooleantruekeeps only calls that did not succeed (status 400 and above).limitintegerPage size, 1 to 100. Default 50.
cursorstringThe
nextCursorof the previous page.
Response
A page of calls, newest first.
data.itemsApiRequest[]The calls.
data.nextCursorstringPass it as
cursorfor the next page;nullat the end.data.hasMorebooleanWhether another page exists.
curl https://nodium.io/api/v1/api-requests \ -H "Authorization: Bearer $NODIUM_KEY"{ "data": { "items": [ {} ], "nextCursor": "…", "hasMore": true }}List the API keys of your account
GET/api/v1/keys
Every key of your account, active ones first. A key belongs to the account: without a clientId it acts on every client (the Nodium-Tenant header names one; without it, the call acts on "My company"); with a clientId it is pinned to that client and cannot leave it.
Only the public prefix is returned — Nodium keeps a hash of each secret, never the secret itself. Requires a key that is not pinned to a client.
Response
The keys of your account, without their secrets.
data.itemsApiKey[]The keys, active ones first.
Refusals
- 403
all_clients_requiredThe key is pinned to a client.
curl https://nodium.io/api/v1/keys \ -H "Authorization: Bearer $NODIUM_KEY"{ "data": { "items": [ {} ] }}Create an API key
POST/api/v1/keys
Creates another key for your account — for key rotation, or to give a separate system its own key. Without clientId, the key acts on every client of the account; with it, the key is pinned to that client: it acts there without the Nodium-Tenant header, and naming another client answers 404.
The response carries the secret once and never again: store it now.
Body
labelstringA name for you, shown in Nodium.
clientIdstringPin the key to this client: its id, or your
externalId.expiresInDaysintegerThe key stops working after this many days (1 to 3650). Absent: it never expires, unless the key making the call expires — a key never outlives the key that creates it. Past its date it answers 401
api_key_expired.
Response
The key and its secret — shown only here.
data.keyApiKeyThe key.
data.tokenstringThe secret,
nod_…. Shown only here.
Refusals
- 403
all_clients_requiredThe key is pinned to a client. - 404
tenant_not_found`clientId` names no client of your account. - 422
invalid_request`expiresInDays` is not a whole number of days between 1 and 3650.
curl -X POST https://nodium.io/api/v1/keys \ -H "Authorization: Bearer $NODIUM_KEY" \ -H "Content-Type: application/json" \ -d '{ "label": "Billing system", "clientId": "cust_1042", "expiresInDays": 90 }'{ "data": { "key": { "id": "…", "label": "…", "keyPrefix": "…", "clientId": "…", "clientName": "…", "isActive": true, "createdBy": "…", "lastUsedAt": "…", "revokedAt": "…", "expiresAt": "…", "createdAt": "…" }, "token": "…" }}Revoke an API key
DEL/api/v1/keys/{id}
Revokes a key of your account at once: its next call is refused. The key stays listed, revoked, as a trace.
A key revoking itself must say so with ?confirmSelf=true — otherwise the call answers 409 own_key, so that a rotation script that picks the wrong id does not lock itself out.
Path parameters
idstringThe key id.
Query parameters
confirmSelfbooleanRequired,
true, when the key revokes itself.
Response
The revoked key.
data.revokedbooleanAlways
true.data.keyApiKeyThe key, now revoked.
Refusals
- 403
all_clients_requiredThe key is pinned to a client. - 409
own_keyThe key is revoking itself: repeat with `?confirmSelf=true`. - 409
already_revokedThe key was already revoked.
curl -X DELETE https://nodium.io/api/v1/keys/<id> \ -H "Authorization: Bearer $NODIUM_KEY"{ "data": { "revoked": true, "key": { "id": "…", "label": "…", "keyPrefix": "…", "clientId": "…", "clientName": "…", "isActive": true, "createdBy": "…", "lastUsedAt": "…", "revokedAt": "…", "expiresAt": "…", "createdAt": "…" } }}Get the key making the call
GET/api/v1/keys/current
Tells a key what it is, without listing the others: its name, the account it belongs to, the client it is pinned to, and when it stops working. Any key can call it.
Use it to check a key you were just given: a key that acts for every client of your account is pinned: false.
Response
The key that made the call: id, name, account, pinned client, expiry.
data.idstringThe key id.
data.labelstringThe name given to the key, possibly empty.
data.accountIdstringThe account the key belongs to.
data.accountNamestringThe name of that account.
data.pinnedbooleanTrue when the key is pinned to one client and cannot leave it; false when it acts on every client of the account.
data.clientobjectThe client the key is pinned to:
id,name,isHome(true for "My company");nullwhen the key is not pinned.data.expiresAtstringISO 8601 date after which the key answers 401
api_key_expired, ornull: it never expires.
Refusals
- 404
not_foundThe call was made with a console session, not an API key.
curl https://nodium.io/api/v1/keys/current \ -H "Authorization: Bearer $NODIUM_KEY"{ "data": { "id": "…", "label": "…", "accountId": "…", "accountName": "…", "pinned": true, "client": {}, "expiresAt": "…" }}