Authentication
The ZenFlow API uses API Keys to authenticate requests. You can manage your API keys from the ZenFlow dashboard.Getting an API Key
- Log in to your ZenFlow Dashboard
- Navigate to Settings > API Keys
- Click Create API Key
- Configure your key:
- Name: A descriptive name (e.g., “ERP Integration”)
- Scopes: Select the permissions your key needs
- Expiration: Optional expiration date
- Click Create
- Copy your API key immediately - it won’t be shown again
Using Your API Key
Include your API key in theX-API-Key header with every request:
API Key Format
ZenFlow API keys follow this format:zenflow_live_*: Production keyszenflow_test_*: Test/sandbox keys (coming soon)
Scopes
API keys are scoped to specific permissions. Available scopes:| Scope | Description |
|---|---|
read:orders | Read order data |
write:orders | Create and update orders |
read:products | Read product catalog |
write:products | Create and update products |
read:stock | Read inventory levels |
write:stock | Update inventory |
read:webhooks | View webhook configurations |
write:webhooks | Manage webhooks |
admin | Full access to all resources |
Scope Presets
For common use cases, we offer preset scope combinations:| Preset | Scopes | Use Case |
|---|---|---|
| Read Only | read:orders, read:products, read:stock | Reporting and analytics |
| ERP Sync | read:orders, write:orders, read:products, read:stock, write:stock | Full ERP integration |
| Stock Sync | read:products, read:stock, write:stock | Inventory synchronization |
| Full Access | admin | Administrative access |
Error Responses
Invalid API Key
Missing API Key
Insufficient Permissions
Expired API Key
Security Best Practices
Use Environment Variables
Store API keys in environment variables, not in code
Minimum Permissions
Only request the scopes you actually need
Rotate Regularly
Rotate your API keys periodically
Monitor Usage
Review API key usage logs for suspicious activity
Example: Environment Variables
Rotating API Keys
To rotate an API key:- Create a new API key with the same scopes
- Update your application to use the new key
- Verify the new key is working
- Revoke the old key
You can have multiple active API keys. This allows for zero-downtime rotation.
IP Whitelisting (Optional)
For additional security, you can restrict API key usage to specific IP addresses:- Go to Settings > API Keys
- Select your API key
- Add allowed IP addresses or CIDR ranges
- Save changes



