Overview
Flowise uses API keys for authentication. API keys allow you to securely access your chatflows and other resources programmatically without exposing your credentials.API keys are sensitive credentials. Keep them secure and never commit them to version control.
Authentication Methods
Flowise supports the following authentication methods:- Bearer Token Authentication - Primary method for API access
- Chatflow-specific API Keys - Scoped access to individual chatflows
Creating an API Key
Via Flowise UI
- Log in to your Flowise instance
- Navigate to Settings → API Keys
- Click Add New
- Provide a descriptive name for your key
- Select the required permissions
- Click Create
- Copy the generated API key immediately (it won’t be shown again)
Via API
You can also create API keys programmatically:Using API Keys
Bearer Token Authentication
Include your API key in theAuthorization header using the Bearer scheme:
Query Parameter Authentication
For prediction endpoints, you can also pass the API key as a query parameter:API Key Permissions
API keys can be assigned specific permissions to limit their access scope. Common permissions include:| Permission | Description |
|---|---|
chatflows:view | View chatflows and their configurations |
chatflows:create | Create new chatflows |
chatflows:update | Update existing chatflows |
chatflows:delete | Delete chatflows |
agentflows:view | View agent flows |
agentflows:create | Create new agent flows |
agentflows:update | Update existing agent flows |
agentflows:delete | Delete agent flows |
predictions:create | Send messages to chatflows |
apikeys:view | View API keys |
apikeys:create | Create new API keys |
apikeys:update | Update existing API keys |
apikeys:delete | Delete API keys |
Permissions follow a hierarchical structure. The
update permission typically includes view access.Managing API Keys
List All API Keys
Retrieve all API keys in your workspace:Update an API Key
Update the name or permissions of an existing API key:Delete an API Key
Revoke an API key when it’s no longer needed:Chatflow-Specific API Keys
Each chatflow can have its own API key for scoped access. To retrieve a chatflow using its specific API key:Authentication Errors
401 Unauthorized
Occurs when:- API key is missing
- API key is invalid or expired
- API key doesn’t have permission to access the resource
403 Forbidden
Occurs when:- API key is valid but lacks required permissions
- Resource is restricted to specific workspace or organization
Best Practices
Use Environment Variables
Store API keys in environment variables, never hardcode them in your source code.
Rotate Keys Regularly
Periodically rotate your API keys to minimize security risks.
Use Minimal Permissions
Grant API keys only the permissions they need (principle of least privilege).
Monitor Usage
Regularly audit API key usage and revoke unused or compromised keys.
Security Recommendations
- Never share API keys - Each application or user should have their own key
- Use HTTPS in production - Always use TLS/SSL encryption for API requests
- Implement key rotation - Regularly rotate keys and revoke old ones
- Monitor for breaches - Set up alerts for unusual API activity
- Limit key scope - Use chatflow-specific keys when possible
- Store securely - Use secure vaults or secret management services
Example: Complete Authentication Flow
Here’s a complete example of creating an API key and using it to interact with a chatflow:Next Steps
API Overview
Learn about API endpoints and response formats
API Reference
Explore detailed endpoint documentation
