Authentication
To authenticate your account when making API requests, include an access token in the Authorization header. There are two types of access tokens in Storyblok:
Personal access token
Section titled “Personal access token”A Personal Access Token is obtained from the Storyblok UI and grants access to all spaces associated with your account, including the Management API.
It is not tied to a single space but allows actions based on your permissions in all accessible spaces.
This token is used without the Bearer
keyword in the Authorization
header.
You can generate or manage personal access tokens in the Storyblok account settings.
OAuth Access Token
Section titled “OAuth Access Token”An OAuth Access Token is obtained via the OAuth2 authentication flow and is tied to a single space.
- It has a time-to-live (TTL) and is used for authenticating third-party apps or integrations.
- Permissions (scopes) such as
read_content
andwrite_content
are granted during the OAuth process. - This token must be used with the
Bearer
keyword in theAuthorization
header.
You can learn more about obtaining an OAuth access token in the OAuth 2.0 Authorization Flow.
Examples
Section titled “Examples”curl -H "Authorization: YOUR_PERSONAL_ACCESS_TOKEN" https://mapi.storyblok.com/
curl -H "Authorization: Bearer YOUR_OAUTH_ACCESS_TOKEN" https://mapi.storyblok.com/
const StoryblokClient = require('storyblok-js-client')
const Storyblok = new StoryblokClient({oauthToken: 'YOUR_PERSONAL_ACCESS_TOKEN'})
const StoryblokClient = require('storyblok-js-client')
const Storyblok = new StoryblokClient({oauthToken: 'Bearer YOUR_PERSONAL_ACCESS_TOKEN'})
Get in touch with the Storyblok community