Skip to main content
An API key is the token your integration uses to authenticate with the Nuvia API. To learn how to send the key in requests, see Authentication. This page covers the key’s lifecycle: creating, listing, revoking, and choosing scopes.
API keys are created and managed by an authenticated human user, using the app’s login token (human JWT, see Authentication). An API key cannot manage other API keys: the /v1/api-keys endpoints don’t accept API key authentication.

Create an API key

Send a POST /v1/api-keys authenticated as a user. The body accepts:
The response (201) carries the token in accessToken and the key’s metadata in apiKey:
The full token value appears only once, in the accessToken field of the creation response. Nuvia doesn’t store the token, and there’s no way to retrieve it later: only metadata and a preview (keyPreview, the last 4 characters) are kept. Copy and store the token securely at this moment. If you lose the token, revoke the key and create a new one.

List API keys

GET /v1/api-keys returns your company’s keys (paginated with { data, meta }). The response only carries metadata, never the token.

Revoke an API key

DELETE /v1/api-keys/:id revokes the key immediately and responds 204 No Content. The operation is idempotent: revoking an already-revoked key doesn’t cause an error. The key must belong to your company.
cURL
Once revoked, the key stops authenticating on any request.

Available scopes

Scopes follow the <subject>:<action> format. When creating a key, grant only the scopes your integration needs. The table below lists the catalog available in the dashboard, grouped by subject.
The dashboard only offers the scopes in this catalog. If an endpoint returns 403 even with a valid key, confirm the key was created with the scope that endpoint requires.
Known exception: DELETE /v1/inboxes/{id} requires the inboxes:delete scope, which isn’t in the dashboard’s catalog: a key created there gets 403 on this endpoint. To grant it, create the key through POST /v1/api-keys including "inboxes:delete" in scopes: creation only validates the <subject>:<action> format, not the catalog. Every other scope required by the Reference’s endpoints is in the catalog.

Ownership model

An API key belongs to the company (the tenant), not to the user who created it. The creating user is recorded only for auditing. One important consequence:
The key isn’t automatically revoked when the user who created it is deactivated or removed from the company. It stays valid. To end a key’s access, revoke it explicitly with DELETE /v1/api-keys/:id.

Security best practices

1

Treat the key as a secret

The API key is a Bearer token that grants access to everything its scopes allow. Store it in an environment variable or secrets vault, never in source code or version control.
2

Apply least privilege

Grant only the scopes the integration needs. Avoid creating keys with the entire catalog “just in case”.
3

Set an expiration

Use expiresAt for short-lived or temporary keys, reducing the exposure window if the key leaks.
4

Revoke what you don't use

Revoke old, test, or unused keys. Since the key outlives the creating user’s departure, cleanup is the company’s responsibility.

Next steps

Authentication

How to send the API key in requests and understand auth errors.

Rate limits

How the API handles request limits today.