API Key Authentication
Documind uses API key authentication. Every request to the API must include a valid API key in theX-API-Key header.
Creating API Keys
1
Navigate to API Keys
Access the API Keys section in your dashboard at
/api-keys.2
Create New Key
Click “Create API Key” and provide:
- Name: Descriptive name for the key (e.g., “Production Automation”)
- Description: Optional details about key usage
- Scopes: Permissions for the key (read/write access)
- Expiration: Optional expiration date
3
Store Securely
Save the API key in a secure location:
- Environment variables
- Secrets management service (AWS Secrets Manager, Azure Key Vault)
- Password manager
Request Format
Include the API key in theX-API-Key header of every request:
API Key Scopes
Control what operations each API key can perform:Managing API Keys
List All Keys
Update API Key
Update key properties like name, scopes, or expiration:Revoke API Key
Immediately disable an API key:Organization-Wide Keys
Create API keys that work across your entire organization:- Share credits across the organization
- Access extractions from any team member
- Ideal for shared automation infrastructure
Error Responses
401 Unauthorized
Missing or invalid API key:X-API-Key header.
403 Forbidden
API key lacks required scope:402 Payment Required
Insufficient credits:Security Best Practices
Environment Variables
Environment Variables
Store API keys in environment variables, not in code:
.env
Key Rotation
Key Rotation
Rotate API keys periodically (every 90 days recommended):
- Create a new API key
- Update your applications to use the new key
- Verify everything works
- Revoke the old key
Least Privilege
Least Privilege
Grant only the minimum scopes required:
- Read-only automation:
extractions:readonly - Processing automation:
extractions:read,extractions:write - Admin operations: All scopes
Monitoring
Monitoring
Track API key usage via the dashboard:
- API calls per key
- Last used timestamp
- Unusual activity patterns
Next Steps
Quick Start Guide
Make your first authenticated API request