Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

API tokens

What a DataOS API token is, how it's created and revoked, and how its scope and expiry work.

API tokens let external clients authenticate requests to DataOS APIs. Every token is issued to a specific DataOS user (or service account), and it can only do what that user is permitted to do. A token is a credential, not a separate identity with its own permissions.

Configuration

API tokens can be created and managed from the API Tokens panel in DataOS Home, or from the DataOS CLI (dataos-ctl).

Creating a new API token

  1. Open Home in DataOS. From the profile menu in the top-right corner, select API Tokens.

  1. Select + New, give the token a name you'll recognize later, and set an expiry (in hours or as a date) so it doesn't outlive its purpose.

  1. Select Save, then copy the token value immediately. It's shown only once.

For example:

The command prints the token value once, along with its type, expiration, creation time, and name. See dataos-ctl user apikey create for the full flag reference.

Deleting an API token

Open the API Tokens panel, locate the token in the list, and select the delete/revoke action next to it. This immediately revokes access for anything using that token.

Token expiry and rotation

Every API token has an expiry, set at creation time (as a duration, such as 24h, via --duration on the CLI, or as hours/a date in the panel). Once a token expires, it stops authenticating requests.

Because a token's value can't be retrieved or edited after creation, rotation means creating a new token and replacing the old one wherever it's used, not renewing or extending the existing one. Set expiry to match how long the token is actually needed, and rotate it before it expires so dependent integrations don't fail unexpectedly.

Usage

Pass the token in the Authorization header of each API request:

This applies to REST APIs, and to any BI tool, SQL client, or AI client connecting to DataOS. Some accept the token as a bearer token or API-token field, while others (such as MySQL-protocol clients) use it as the connection password.

Scope

A token inherits the permissions of the DataOS user or service account it belongs to. Nothing more. DataOS applies that user's existing access (roles, product permissions, masking, and row filters) to every request made with the token, exactly as if the user made the request directly. If the underlying user lacks permission for a resource, requests made with the token are rejected with a 403 Forbidden, the same as they would be for the user.

A token is valid across every service and interface within the DataOS instance it was created in — REST APIs, the CLI, BI tools, SQL clients, and AI/MCP clients all authenticate with the same token, rather than each needing a separately scoped credential. It applies the creating user's permissions identically wherever it's used. A token is also tied to the instance it was created in: it won't authenticate against a different DataOS instance, even for the same user.

This scoping also governs who can create a token in the first place: by default, a user can only create tokens for themselves. Creating one on behalf of another user is a separate, elevated permission — without it, the request is denied with a 403 Forbidden.

Features

API tokens have the following features:

  • They can be used to authenticate API calls.

  • They have limited permissions (scopes), specified to user identity.

  • They are intended to be reusable.

Limitations

API tokens have the following limitations:

  • They can't be viewed or edited after they are created. They are intended to be replaced with a new API token rather than recovered or modified.

  • They can't be used to log in to DataOS instance.

Last updated

Was this helpful?