Manage Access Tokens
Storyblok offers a rich set of APIs and services for delivering and managing content and assets. Tokens safeguard access to these services.
Content Delivery API access tokens
Section titled “Content Delivery API access tokens”Use the Content Delivery API’s read-only access tokens to view the content and assets of a specific space.
To manage per-space tokens and generate new ones, select the space and open Settings → Access Tokens, or use the Access Tokens endpoint.
The following types of tokens are available:
- Public: access
publishedcontent using the Content Delivery API. Use this token in production frontends. - Preview: access
draftandpublishedcontent using the Content Delivery API. Use this token in the Visual Editor or staging environments. - Asset: access private assets using the Content Delivery API.
- Release: access content associated with a specific release. Requires the Releases app.
- Theme: access a theme for use by the Storyblok rendering service (deprecated).
The following example uses the JavaScript SDK to fetch published stories using the Content Delivery API:
import { apiPlugin, storyblokInit } from "@storyblok/js";
const { storyblokApi } = storyblokInit({ accessToken: "YOUR_ACCESS_TOKEN", use: [apiPlugin],});
// Use a public or preview access tokenconst { data } = await storyblokApi.get("cdn/stories", { version: "published",});Management API access tokens
Section titled “Management API access tokens”Use the Management API’s personal access tokens to perform create, read, update, delete (CRUD) operations across spaces.
Personal access token
Section titled “Personal access token”The personal access token is account-specific. Generate new tokens or view existing ones in your Account settings: My account → Account settings → Personal access tokens.
Choose + Generate New Token, name it, and set an expiration date for an additional security layer.
Select which spaces the token can access:
- All spaces is the default, and grants access to all the spaces you own. Learn more about space ownership in the Roles manual.
- Only selected spaces allows you to limit the token to specific spaces. Select one or more spaces where the token applies.
Next, set individual permissions under Select scopes. Select at least one of the following scopes:
- AI branding
- AI translation
- Asset folders
- Assets
- Collaborators
- Comments
- Components
- Datasource entries
- Datasources
- Experiments
- Releases
- Spaces
- Statistics
- Stories
- Strata
- Tags
- Taxonomies
- Users
- Webhooks
- Workflows
The list includes only scopes for features that at least one of your organizations has access to. For example, AI branding appears only if one of your organizations has a plan that supports it. The API checks your plan on every request: if a token has a scope for a feature that your plan excludes, requests for that feature fail with a 403 status code.
Finally, review the configuration. After you generate the token, you can only rename it; other settings are read-only.
Once you select Generate Token, you get a one-time option to view and copy the token. This is the only occasion you can view it—copy and store the token securely.
Security best practices
Section titled “Security best practices”- Store your personal access tokens in environment variables, and never expose them in frontend code you commit to version control.
- Immediately revoke any exposed tokens and generate a new one.
- Apply the principle of least privilege and restrict the token’s access to the required spaces and scopes.
- Use unscoped tokens only for development or tooling that requires unrestricted access.
Was this page helpful?
This site uses reCAPTCHA and Google's Privacy Policy (opens in a new window).Terms of Service (opens in a new window) apply.
- Need help?Contact support (opens in a new window)
- Something isn’t right?Check system status (opens in a new window)
Get in touch with the Storyblok community