Documentation Index
Fetch the complete documentation index at: https://backstage.spotify.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Create an API token
API tokens allow external services, scripts, or applications to authenticate with Portal APIs. Tokens are typically used for integrations, automation, and service-to-service access.Who can create API tokens
You must be a Portal admin to create or update API tokens.Step 1: Open App Settings
- In your Portal instance, sign in as an admin.
- Go to Admin → App Settings.
- Scroll down to the External access section.
Step 2: Create or select an API access entry
You can either:- Use an existing API access entry that matches your needs, or
- Create a new API access entry
- Which plugins the token can access
- Which permissions are granted
- The intended purpose (subject) of the token
Step 3: Configure access permissions
For the selected API access entry, configure the access restrictions carefully:- Plugin access: Limit access to only the plugins the integration needs
- Permissions: Grant only the required permissions (for example, read-only access)
- Scope: Avoid overly broad access unless absolutely necessary
For more details, see Access
Restrictions
in the Backstage documentation.

Step 4: Generate a secure token value
The token value itself is never generated or shown by Portal. You must generate it externally. You can use any secure method or platform you prefer. For example, using Node.js:Token requirements
- Must be at least 8 characters long
- Must not contain spaces
Step 5: Save the token
- Paste the generated token value into the Secret field.
- Store the token securely before saving.
- Click Add Item.
- Click Save.
- Wait for Portal to reload and apply the new configuration. You should see a confirmation that the new configuration was applied successfully.
Step 6: Use the API token
Once configured, the token can be used to authenticate API requests. Include the token in theAuthorization header of your requests:
curl- Scripts
- Backend services
- Automation tools
Verify authentication
If the token is valid and correctly scoped, API requests will succeed. If the token is:- Missing or invalid → the API will return an authentication error (401)
- Valid but under-scoped → the API may return a permission error (403)
Security best practices
- Treat API tokens like passwords
- Never commit tokens to source control
- Store tokens in a secure secrets manager
- Rotate tokens periodically
- Use separate tokens for different integrations or environments
- Revoke and replace tokens immediately if compromised