Overview
Monei supports api key authentication methodAPI Key Authentication
The simplest and most common authentication method for server-side applications.Getting Your API Key
Navigate to Dashboard
Go to monei.cc
Create New Key
Click Create New Key and provide:
- Key name (for identification)
- Environment (sandbox or production)
- Permissions (optional scoping)
Using API Keys
Include your API key in thex-api-key header:
API Key Permissions
Control what your API keys can access:| Permission | Description | Use Case |
|---|---|---|
| Read Only | View account and transaction data | Analytics dashboards |
| Transactions | Execute transactions | Payment processing |
| Account Management | Modify account settings | Admin operations |
| Full Access | All operations | Backend services |
Always use the minimum required permissions for each API key to enhance security.
Security Best Practices
API Key Management
API Key Management
Do:
- Store keys in environment variables
- Use different keys for development and production
- Rotate keys regularly (every 90 days)
- Use scoped permissions
- Monitor key usage
- Commit keys to version control
- Share keys via email or chat
- Use production keys in development
- Hardcode keys in client-side code
Token Security
Token Security
Storage:
- Server-side: Environment variables, secure vaults
- Client-side: httpOnly cookies, secure storage APIs
- Never in localStorage or sessionStorage
- Always use HTTPS
- Never include tokens in URLs
- Use secure headers only
- Implement token refresh before expiration
- Clear tokens on logout
- Revoke compromised tokens immediately
Network Security
Network Security
Transport:
- Always use TLS 1.2 or higher
- Verify SSL certificates
- Use certificate pinning in mobile apps
- Implement client-side rate limiting
- Handle 429 responses gracefully
- Use exponential backoff
- Restrict API access to known IPs (enterprise)
- Use VPN for sensitive operations
Monitoring & Auditing
Monitoring & Auditing
Track:
- All authentication attempts
- Failed login attempts
- API key usage patterns
- Unusual activity
- Multiple failed logins
- API calls from new locations
- Suspicious transaction patterns
- Key usage spikes
- Log all authentication events
- Monitor access patterns
- Review logs regularly
- Set up automated alerts
Authentication Errors
Common authentication errors and how to resolve them:- 403 Forbidden
- 429 Rate Limited
Environment Variables
Recommended environment variable structure:Testing Authentication
Test your authentication setup:Next Steps
Core Concepts
Learn about wallets, transactions, and networks
Security Guidelines
Comprehensive security best practices
API Reference
Explore all available endpoints
Webhooks
Set up secure webhook integrations

