Authentication
Learn how to authenticate with the Workflows API
Authentication
The Workflows API uses API keys for authentication. All API requests must include your API key in the x-api-key header.
API Key Format
API keys follow this format:
Example: wfk_abc123def456ghi789jkl012mno345pq
Using Your API Key
Include your API key in the x-api-key header with every request:
API Key Scopes
API keys can be configured with different permission scopes:
| Scope | Description | Endpoints |
|---|---|---|
workflows:read | Read workflow definitions | GET /workflows, GET /workflows/:id |
workflows:write | Create and modify workflows | POST /workflows, PUT /workflows/:id |
workflows:execute | Run workflows | POST /workflows/:id/run |
runs:read | Read workflow run history | GET /runs, GET /runs/:id |
connections:read | View connections | GET /connections |
connections:write | Manage connections | POST /connections, DELETE /connections/:id |
Security Best Practices
Never expose your API key in client-side code, public repositories, or logs.
Do's
- Store API keys in environment variables
- Use different keys for development and production
- Rotate keys periodically (every 90 days recommended)
- Use the minimum required scopes
- Revoke compromised keys immediately
Don'ts
- Don't commit API keys to version control
- Don't share keys via email or chat
- Don't use production keys in development
- Don't log API keys in application logs
Environment Variables
We recommend storing your API key in an environment variable:
Then access it in your code:
Rate Limits
API requests are rate limited per API key using a sliding window algorithm:
| Category | Limit | Endpoints |
|---|---|---|
| Read | 1000/min | GET requests |
| Write | 100/min | POST, PUT, DELETE requests |
| Execute | 500/min | Workflow run, cancel, retry |
| Webhooks | 10000/min | Webhook ingestion (by IP) |
Rate Limit Headers
Every authenticated response includes rate limit headers:
| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests allowed in window |
X-RateLimit-Remaining | Requests remaining in current window |
X-RateLimit-Reset | Unix timestamp when window resets |
Handling Rate Limits
When you exceed the rate limit, you'll receive a 429 Too Many Requests response:
Best practices for handling rate limits:
- Check rate limit headers proactively
- Implement exponential backoff on 429 errors
- Queue non-urgent requests
- Cache responses where appropriate
Error Responses
401 Unauthorized
Missing or invalid API key:
403 Forbidden
API key lacks required permissions: