The Botpress API uses token-based authentication. Different token types provide different levels of access.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/botpress/botpress/llms.txt
Use this file to discover all available pages before exploring further.
Token Types
Personal Access Token (PAT)
Full workspace access for administrative operations. Use cases:- Managing bots and integrations
- Workspace administration
- CI/CD pipelines
- Development tools
bp_pat_...
Creating a PAT:
- Go to your Botpress Dashboard
- Navigate to Settings > Personal Access Tokens
- Click “Create Token”
- Set permissions and expiration
- Copy the token (shown only once)
Bot Token
Bot-scoped access for runtime operations. Use cases:- Bot runtime operations
- Sending/receiving messages
- Managing conversations and users
- Calling actions
bp_bot_...
Getting a bot token:
Bot tokens are automatically provided in bot handlers via the client prop. For standalone use:
Integration Token
Integration-scoped access. Use cases:- Integration runtime operations
- Webhook handling
- Creating messages from external platforms
bp_int_...
Using Tokens
Environment Variables
Store tokens securely in environment variables:.env
In Bot Handlers
Tokens are automatically available in handlers:In Integration Handlers
Token Scopes
Different tokens have different permissions:Personal Access Token
Create, update, delete workspaces
Create, update, delete bots
Create, update, delete integrations
Manage workspace users and permissions
View and manage billing
Bot Token
Create, read, update, delete conversations
Send and receive messages
Create and manage users within the bot
Read and write bot, user, and conversation state
Call integration actions
Read and write table data
Upload and manage files
Cannot modify bot configuration
Integration Token
Create conversations for the integration
Send messages to bots
Create users
Create events
Read/write integration, conversation, and user state
Security Best Practices
1. Never Commit Tokens
Add.env to .gitignore:
.gitignore
2. Use Environment Variables
3. Rotate Tokens Regularly
Create new tokens periodically and revoke old ones.4. Use Minimal Scopes
Use bot tokens for runtime operations instead of PATs when possible.5. Secure Token Storage
In production:- Use secret management services (AWS Secrets Manager, Azure Key Vault, etc.)
- Encrypt tokens at rest
- Use ephemeral tokens when possible
6. Monitor Token Usage
Track API calls to detect unusual activity:Token Revocation
Revoke compromised tokens immediately:- Go to Botpress Dashboard
- Navigate to Settings > Personal Access Tokens
- Find the token
- Click “Revoke”
Troubleshooting
401 Unauthorized
403 Forbidden
See Also
- Client Overview - Client initialization
- Client Methods - API operations reference