Authentication
API keys, permissions, and security best practices
Overview
Appflow uses API keys for all authentication. Every request to the API must include a valid key in the Authorization header. Keys are scoped to projects, meaning a single key grants access to all apps within that project. Different key types provide different permission levels, so you can follow the principle of least privilege for each use case.
API Key Types
Appflow provides three key types, each designed for a specific environment. Choose the most restrictive key that satisfies your requirements.
Creating API Keys
You can create API keys from the dashboard under Settings → API Keys, or programmatically via the Management API. When creating a key, specify the key type and optionally limit it to specific scopes.
The response includes the full key value. This is the only time you will see the complete key, so store it securely. If you lose it, you will need to create a new one.
sk_). Client and Read-Only keys cannot create other keys.Using API Keys
Include your API key in the Authorization header with the Bearer scheme on every request. All API endpoints require authentication.
Requests with a missing, expired, or invalid key will receive a 401 Unauthorized response. Requests to endpoints outside the key's permission scope will receive a 403 Forbidden response.
Security Best Practices
Follow these guidelines to keep your API keys and data secure.
sk_) have full read/write access and must only be used from your backend.ck_) can only write events, limiting the blast radius if compromised.expires_at field to automatically disable keys after a given period.Rate Limits
API requests are subject to rate limits based on the endpoint category. Limits are applied per API key unless otherwise noted.
Handling Rate Limit Errors
When you exceed a rate limit, the API returns a 429 Too Many Requests response. The response includes a Retry-After header indicating how many seconds to wait before retrying.
Retry-After value and double the wait time on each subsequent 429 response, up to a maximum of 60 seconds.Next Steps
Now that you understand authentication, continue with these guides.