Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
df071ad
Add unedited AI-drafted updates
pwizla Mar 11, 2026
0294a1a
Make edits based on the new Notion page
pwizla Mar 11, 2026
8278324
Edit files with Style Checker recommendations
pwizla Mar 11, 2026
7c27aaf
Split into 2 pages: API tokens vs. Admin tokens
pwizla Mar 11, 2026
bcdcd1c
Add first draft of new Admin Tokens feature page
pwizla Mar 11, 2026
bf4bc9c
Refine Admin tokens page and make it more consistent with API tokens
pwizla Mar 12, 2026
c7b956a
Ensure headings are visible in secondary TOC
pwizla Mar 12, 2026
c520e16
Improve formatting and layout
pwizla Mar 12, 2026
287a846
Add a section about regenerating an admin token
pwizla Mar 12, 2026
3636c40
Clean up RBAC table
pwizla Mar 12, 2026
84ae66c
Simplify caution callout in Usage section
pwizla Mar 12, 2026
e8563a6
Remove superfluous "admin-tokens-permission-model" file and link
pwizla Mar 12, 2026
1dc4fa4
Remove todos
pwizla Mar 12, 2026
d28932f
Add note about removing permissions from a role
pwizla Mar 12, 2026
b9927fe
Fix wrong link in config. > admin-panel file
pwizla Mar 12, 2026
5d9186f
Make the "creating a new admin token" description breathe
pwizla Mar 12, 2026
be65094
Fix unclear "server token"
pwizla Mar 12, 2026
29fed2a
Add blank line
pwizla Mar 12, 2026
7559909
Simplify a sentence in the admin tokens intro.
pwizla Mar 12, 2026
6438dcf
Add "context" to the intro. paragraph of the Usage section
pwizla Mar 12, 2026
736a0d8
Fix unclear Usage intro
pwizla Mar 12, 2026
eeb6b1d
Fix duplicate dot
pwizla Mar 12, 2026
29d9211
Address Nico's review feedback and add feature flag support
pwizla Apr 16, 2026
3dd00dd
Update feature flag name
pwizla Apr 16, 2026
fc20e26
Rewrite Usage section to match API tokens pattern
pwizla Apr 16, 2026
9e70219
Remove dead link to MCP server page
pwizla Apr 16, 2026
c4ca697
Move feature badge placement
pwizla Apr 17, 2026
361c3e2
Add TODOs for screenshots
pwizla Apr 17, 2026
69e439d
Remove tooltip in Feature flags intro badge
pwizla Apr 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions docusaurus/docs/cms/configurations/admin-panel.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ module.exports = ({ env }) => ({
</TabItem>
<TabItem value="ts" label="TypeScript">

```js title="/config/admin.ts"
```ts title="/config/admin.ts"
export default ({ env }) => ({
host: "my-host.com",
port: 3000,
Expand Down Expand Up @@ -208,15 +208,15 @@ module.exports = ({ env }) => ({
</TabItem>
<TabItem value="ts" label="TypeScript">

```js title="/config/server.ts"
```ts title="/config/server.ts"
export default ({ env }) => ({
host: env("HOST", "0.0.0.0"),
port: env.int("PORT", 1337),
url: "http://yourbackend.com",
});
```

```js title="/config/admin.ts"
```ts title="/config/admin.ts"
export default ({ env }) => ({
/**
* Note: The administration will be accessible from the root of the domain
Expand All @@ -239,10 +239,14 @@ With this configuration:

The [API tokens](/cms/features/api-tokens) feature can be configured with the following parameters:

| Parameter | Description | Type | Default |
|-----------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|-------------------------------------------------------------------------------------------------------------------------------------|
| `apiToken.salt` | Salt used to generate API tokens | string | Random string |
| `apiToken.secrets.encryptionKey` | Encryption key used to set API tokens visibility in the admin panel | string | Random string |
| Parameter | Description | Type | Default |
|------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|---------------|
| `apiToken.salt` | Salt used to generate API tokens (applies to both `content-api` and `admin` token kinds). | string | Random string |
| `apiToken.secrets.encryptionKey` | Encryption key used to set API token visibility in the admin panel. When set, token keys remain viewable at any time by the token's owner. | string | Random string |

:::tip
Admin tokens — the new kind of API token for programmatic access to the Admin API — are configured entirely from the admin panel. No additional code-based configuration is required beyond the parameters above (see [Admin tokens](/cms/features/admin-tokens)).
Comment thread
pwizla marked this conversation as resolved.
:::

## Audit logs

Expand Down Expand Up @@ -592,4 +596,4 @@ export default ({ env }) => ({

</Tabs>
</TabItem>
</Tabs>
</Tabs>
4 changes: 3 additions & 1 deletion docusaurus/docs/cms/configurations/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The `config/features.js|ts` file is used to enable feature flags. Currently this

Some incoming Strapi features are not yet ready to be shipped to all users, but Strapi still offers community users the opportunity to provide early feedback on these new features or changes. With these experimental features, developers have the flexibility to choose and integrate new features and changes into their Strapi applications as they become available in the current major version as well as assist us in shaping these new features.

Such experimental features are indicated by a <FeatureFlagBadge /> badge throughout the documentation, where the name of the feature flag to use is included in the badge (e.g., <FeatureFlagBadge feature="FeatureFlagName" />). Enabling these features requires enabling the corresponding future flags. Future flags differ from features that are in alpha in that future flags are disabled by default.
Such experimental features are indicated by a <FeatureFlagBadge /> badge throughout the documentation, where the name of the feature flag to use is included in the badge (e.g., <FeatureFlagBadge feature="FeatureFlagName" noTooltip />). Enabling these features requires enabling the corresponding future flags. Future flags differ from features that are in alpha in that future flags are disabled by default.

:::danger
Enable future flags at your own risk. Experimental features may be subject to change or removal, may contain breaking changes, may be unstable or not fully ready for use, and some parts may still be under development or using mock data.
Expand Down Expand Up @@ -112,3 +112,5 @@ Developers can use the following APIs to interact with future flags:
| Property name | Related feature | Suggested environment variable name |
| ------------- | --------------- | ---------------------------------- |
| `experimental_firstPublishedAt` | [Draft & Publish](/cms/features/draft-and-publish#recording-the-first-publication-date) | `STRAPI_FUTURE_EXPERIMENTAL_FIRST_PUBLISHED_AT` |
| `adminTokens` | [Admin Tokens](/cms/features/admin-tokens) | `STRAPI_FUTURE_ADMIN_TOKENS` |

126 changes: 126 additions & 0 deletions docusaurus/docs/cms/features/admin-tokens.md
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's something a bit strange with the admin tokens feature because they are actually opening the access to the admin api while the admin API is not a public API just yet. I don't know how we should present that aspect, especially until we release the MCP server where the admin tokens will make total sense with it.

Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
---
title: Admin Tokens
description: Learn how to use Admin tokens to authenticate programmatic access to the Strapi Admin API.
toc_max_heading_level: 4
displayed_sidebar: cmsSidebar
tags:
- admin tokens
- admin panel
- authentication
- RBAC
- features
---

# Admin Tokens
<FeatureFlagBadge feature="adminTokens" />

<Tldr>
Admin tokens authenticate programmatic access to the Strapi Admin API. Each token is scoped to a subset of its owner's permissions and is designed for automation workflows such as MCP agents, CI/CD pipelines, and scripts.
</Tldr>

Admin tokens allow automated clients to authenticate requests to the Strapi Admin API. For authenticating requests to the Content API, see [API Tokens](/cms/features/api-tokens).

Admin tokens and API tokens are strictly separated: each is rejected on the other's routes.

<IdentityCard>
<IdentityCardItem icon="credit-card" title="Plan">
Free feature
</IdentityCardItem>
<IdentityCardItem icon="user" title="Role & permission">
Activated by default for Super Admin. Each lower-level role needs an explicit permission grant in Roles > Settings - Admin tokens.
</IdentityCardItem>
<IdentityCardItem icon="toggle-right" title="Activation">
Requires enabling the corresponding future flag,<br/>see [Features configuration](/cms/configurations/features)
</IdentityCardItem>
<IdentityCardItem icon="desktop" title="Environment">
Available in both Development & Production environment
</IdentityCardItem>
</IdentityCard>

<!-- TODO: Update screenshot once admin tokens UI is finalized behind the feature flag -->
<ThemedImage
alt="Admin tokens in the admin panel"
sources={{
light: '/img/assets/settings/settings_admin-tokens-overview.png',
dark: '/img/assets/settings/settings_admin-tokens-overview_DARK.png',
}}
/>

## Configuration

Admin tokens are configured entirely from the admin panel. No code-based configuration is specific to Admin tokens. The shared salt and encryption key that apply to all token kinds are set via `apiToken.salt` and `apiToken.secrets.encryptionKey` in your `/config/admin` file (see [API tokens](/cms/features/api-tokens#code-based-configuration)).
Comment thread
pwizla marked this conversation as resolved.

**Path to configure the feature:** <Icon name="gear-six" /> _Settings > Administration Panel > Admin Tokens_

### Creating a new Admin token

1. Click on the **Create new Admin Token** button.
2. In the token creation form, configure the new Admin token:

| Setting name | Instructions |
| --- | --- |
| Name | Write the name of the token. |
| Description | (optional) Write a description for the token. |
| Token duration | Choose a duration: _7 days_, _30 days_, _90 days_, or _Unlimited_. |
3. Define which admin actions this token can perform:
- Click the tabs below the form to browse permission categories.
- Use the checkboxes to enable or disable individual permissions.

:::note
Permissions that the current user does not hold appear disabled and cannot be selected. Conditions applied to the owner's role are shown as read-only and apply automatically to the token.
:::
4. Click on the **Save** button. The new Admin token will be displayed at the top of the interface, along with a copy button <Icon name="copy" />.

<!-- TODO: Update screenshot once admin tokens UI is finalized behind the feature flag -->
<ThemedImage
alt="Admin token permissions"
sources={{
light: '/img/assets/settings/settings_admin-token-creation.png',
dark: '/img/assets/settings/settings_admin-token-creation_DARK.png',
}}
/>

:::caution
The plaintext token key is shown only once, immediately after creation or regeneration. The `admin.secrets.encryptionKey` configuration that makes Content API token keys persistently viewable does not apply to Admin tokens. Admin token keys are always restricted to the token owner, regardless of encryption configuration.
:::
Comment thread
pwizla marked this conversation as resolved.

### Managing Admin tokens

Admin tokens have a dedicated settings page at <Icon name="gear-six" /> _Settings > Administration Panel > Admin Tokens_. Admin tokens and API tokens are stored in the same database table (differentiated by a `kind` field) but are managed through independent interfaces in the admin panel.

The Admin Tokens page displays an **Owner** column showing the display name of each token's owner.

Any user with access to the Admin Tokens settings page can view Admin tokens. A token can only be edited or deleted by its owner or a super-admin.

When a super-admin views an Admin token owned by another user, a read-only **Owner** field appears in the token details panel. The permissions panel shows only the checkboxes within the token owner's permission scope, not the super-admin's unrestricted access.

Removing a permission from a role causes admin tokens owned by users of that role to have the corresponding permission deleted automatically.

:::caution Owner account deactivation and deletion

* If the token owner's account is deleted, all Admin tokens owned by that user are automatically deleted along with their associated permissions. There is no recovery path. Rotate and replace Admin tokens before offboarding a team member who owns them.
* If the token owner's account is deactivated or blocked, any request authenticated with that owner's Admin token is rejected. The token itself is not deleted. Re-activating or unblocking the owner restores token functionality.
:::

#### Regenerating an Admin token

The **Regenerate** button is only visible to the token's owner. Other users, including super-admins, do not see this button for tokens they do not own.

To regenerate an Admin token:

1. Click on the Admin token's edit button.
2. Click on the **Regenerate** button.
3. Click on the **Regenerate** button to confirm in the dialog.
4. Copy the new Admin token displayed at the top of the interface.

## Usage

Using Admin tokens allows executing a request on Strapi's admin routes as an authenticated user.

Admin tokens can be helpful to give access to people or applications without managing a user account, for instance to connect an MCP server or a CI/CD pipeline.

When performing a request to Strapi's admin routes, the Admin token should be added to the request's `Authorization` header with the following syntax: `bearer your-admin-token`.

:::caution
Never expose Admin tokens in client-side code. Store them in a secrets manager or environment variable.
:::
Comment on lines +116 to +126
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to remove this section

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Nico, thanks for the feedback! For structure parity with other features pages, I need a Usage section (what's a feature if you can't use it or don't know how to use it, right? 😅 )

But considering we might not want to disclose any admin route for now since the API is not public yet, I updated this section with a much more generic usage definition. WDYT?
Screenshot 2026-04-17 at 10 36 14

29 changes: 17 additions & 12 deletions docusaurus/docs/cms/features/api-tokens.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: API Tokens
description: Learn how you can use API tokens to manage end-users authentication.
description: Learn how to use content-api tokens to authenticate REST and GraphQL API requests in Strapi.
displayed_sidebar: cmsSidebar
sidebar_position: 2
toc_max_heading_level: 5
tags:
Expand All @@ -14,28 +15,27 @@ tags:
# API Tokens

<Tldr>
API tokens provide scoped authentication for REST and GraphQL requests without exposing user credentials. This documentation explains token types, creation, expiration, and secure usage within the admin panel.
API tokens authenticate external requests to the Strapi Content API without exposing user credentials. Each token is scoped to a set of permissions and expires after a configurable duration.
</Tldr>

API tokens allow users to authenticate REST and GraphQL API queries (see [APIs introduction](/cms/api/content-api)).
API tokens allow external clients to authenticate requests to the Strapi [Content API](/cms/api/content-api). For programmatic access to the Admin API, see [Admin Tokens](/cms/features/admin-tokens).

API tokens and Admin tokens are strictly separated: a Content API token is rejected on admin routes, and an admin token is rejected on Content API routes.

:::caution Security
Prefer readonly tokens for public access, scope server tokens to only what you need, rotate longlived tokens, and store them in a secrets manager. Never expose admin tokens in client‑side code.
Prefer read-only tokens for public access, scope tokens to only what you need, rotate long-lived tokens, and store them in a secrets manager.
:::

<IdentityCard>
<IdentityCardItem icon="layout" title="Plan">
Free feature
</IdentityCardItem>

<IdentityCardItem icon="user" title="Role and permission">
<IdentityCardItem icon="user" title="Role & permission">
Minimum "Access the API tokens settings page" in Roles > Settings - API tokens
</IdentityCardItem>

<IdentityCardItem icon="toggle-right" title="Activation">
Available by default
</IdentityCardItem>

<IdentityCardItem icon="desktop" title="Environment">
Available in both Development & Production environment
</IdentityCardItem>
Expand All @@ -57,12 +57,12 @@ Most configuration options for API tokens are available in the admin panel, and

**Path to configure the feature:** <Icon name="gear-six" /> _Settings > Global settings > API Tokens_

The _API Tokens_ interface displays a table listing all of the created API tokens. More specifically, it displays each API token's name, description, date of creation, and date of last use.
The _API Tokens_ interface displays a table listing all created content-api tokens.

From there, you have the possibility to:

- click on the <Icon name="pencil-simple" /> to edit an API token's name, description, type, duration or [regenerate the token](#regenerating-an-api-token).
- click on the <Icon name="trash" /> to delete an API token.
- click on the <Icon name="pencil-simple" /> to edit a token's name, description, type, duration or [regenerate the token](#regenerating-an-api-token).
- click on the <Icon name="trash" /> to delete a token.

:::note
Strapi pre-generates 2 API tokens for you, a Full access one and a Read-only one. Since tokens can be only seen once without encryption configured, you may want to [regenerate](#regenerating-an-api-token) them after setting up an encryption key to make them permanently viewable.
Expand All @@ -72,6 +72,7 @@ Strapi pre-generates 2 API tokens for you, a Full access one and a Read-only one

1. Click on the **Create new API Token** button.
2. In the API token edition interface, configure the new API token:

| Setting name | Instructions |
| -------------- | ------------------------------------------------------------------------ |
| Name | Write the name of the API token. |
Expand Down Expand Up @@ -135,7 +136,7 @@ module.exports = ({ env }) => ({

<TabItem label="TypeScript" value="ts">

```js title="/config/admin.ts"
```ts title="/config/admin.ts"
export default ({ env }) => ({
// other config parameters
secrets: {
Expand All @@ -149,6 +150,10 @@ export default ({ env }) => ({

This key is used to encrypt and decrypt token values. Without this key, tokens remain usable, but will not be viewable after initial display. New Strapi projects will have this key automatically generated.

:::tip
For automation workflows that need to call the Admin API programmatically, use admin tokens instead. See [Admin Tokens](/cms/features/admin-tokens) for the full documentation.
:::

## Usage

Using API tokens allows executing a request on [REST API](/cms/api/rest) or [GraphQL API](/cms/api/graphql) endpoints as an authenticated user.
Expand Down
Loading
Loading