Overview
The deployERP API uses Bearer token authentication. All API requests must include a valid API key in the Authorization header. This guide covers authentication setup, best practices, and troubleshooting.Authentication Methods
API Keys
Long-lived tokens for programmatic access
OAuth 2.0
Coming soon: OAuth flow for third-party apps
API Key Management
Creating API Keys
Generate API keys from your dashboard:1
Navigate to API Settings
Go to Settings → API Keys in your dashboard
2
Create New Key
Click Generate New API Key
3
Configure Permissions
Select required permissions for the key
4
Set Expiration
Choose expiration date (optional)
5
Save Key
Copy and securely store the generated key
API Key Format
dep_- Prefix identifying deployERP keyslive- Environment (live/test)a1b2c3...- Unique key identifier
Using API Keys
Request Headers
Include your API key in the Authorization header:Environment Variables
Best practice: Store API keys in environment variables:API Key Permissions
Permission Scopes
Configure granular permissions for API keys:Permission Examples
- Read-Only Key
- Deployment Key
- Admin Key
Security Features
IP Whitelisting
Restrict API key usage by IP address:Key Expiration
Set expiration dates for enhanced security:Rate Limiting per Key
Different rate limits based on key type:Authentication Errors
Common Error Responses
- Missing Authentication
- Invalid Token
- Expired Token
- Insufficient Permissions
- IP Restricted
Error Handling
Implement proper error handling:Key Rotation
Automatic Rotation
Enable automatic key rotation:Manual Rotation
Rotate keys programmatically:Best Practices
Secure Storage
Secure Storage
- Never commit API keys to version control
- Use environment variables or secret managers
- Encrypt keys at rest
- Rotate keys regularly
Least Privilege
Least Privilege
- Grant minimum required permissions
- Create separate keys for different purposes
- Review permissions regularly
- Remove unused keys
Monitoring
Monitoring
- Track API key usage
- Set up alerts for unusual activity
- Review access logs
- Monitor failed authentication attempts
Key Hygiene
Key Hygiene
- Name keys descriptively
- Document key purposes
- Set expiration dates
- Use IP whitelisting when possible

