Authentication
All Kubiya Platform API requests require authentication using API keys. This ensures secure access to your agents, workflows, and data.API Key Format
Kubiya Platform uses theUserKey
authentication scheme:
Never share your API keys publicly or commit them to version control. Always use environment variables or secure secret management.
Generating API Keys
Via Kubiya Web App
- Navigate to compose.kubiya.ai
- Go to Settings → API Keys
- Click Generate New Key
- Give your key a descriptive name
- Copy the key immediately (it won’t be shown again)
Via Kubiya CLI
Programmatic Generation
You can also generate API keys programmatically using an existing key:API Key Scopes
API keys can be created with specific scopes to limit access:Scope | Description |
---|---|
agents:read | Read agent configurations and status |
agents:write | Create, update, and delete agents |
tasks:read | View task history and status |
tasks:execute | Execute tasks and workflows |
workflows:read | View workflow definitions |
workflows:manage | Create, update, and manage workflows |
knowledge:read | Access knowledge base entries |
knowledge:write | Add and update knowledge entries |
runners:read | View runner status and configurations |
runners:manage | Deploy and manage runners |
integrations:read | View integration configurations |
integrations:write | Configure integrations and connections |
webhooks:manage | Create and manage webhooks |
admin | Full administrative access |
Making Authenticated Requests
cURL Examples
SDK Examples
TypeScript
Python
JavaScript (Fetch)
Environment Setup
Development
Production
For production environments, use secure secret management:Docker
Kubernetes
GitHub Actions
Authentication Errors
Common Error Responses
Missing API Key
Invalid API Key
Insufficient Permissions
Rate Limited
Best Practices
Security
Environment Variables
Always store API keys in environment variables, never in code
Minimal Scopes
Use the minimal required scopes for each API key
Key Rotation
Rotate API keys regularly (every 90 days recommended)
Monitoring
Monitor API key usage for suspicious activity
Error Handling
Retry Logic
API Key Management
Listing Keys
Revoking Keys
Key Expiration
Set expiration dates for enhanced security:Rate Limiting
The Kubiya Platform implements rate limiting to ensure fair usage:- 100 requests per minute per API key
- 5,000 requests per day per API key
- Burst allowance: Up to 20 requests in 10 seconds
Troubleshooting
Debug Authentication Issues
Common Issues
Invalid API Key Format
Invalid API Key Format
Ensure you’re using the correct format:
API Key Not Working
API Key Not Working
Check:
- Key is not expired
- Key has required scopes
- Key hasn’t been revoked
- Using correct base URL
Rate Limiting
Rate Limiting
Implement proper backoff:
- Use exponential backoff
- Respect Retry-After headers
- Consider request batching
- Monitor usage patterns