API Reference
Authentication
Authenticate with the Mailgent API
All API requests require a Bearer token in the Authorization header.
Base URL
https://api.mailgent.devAuthentication
Include your API key in every request:
curl https://api.mailgent.dev/v0/messages \
-H "Authorization: Bearer mgent-your-api-key"API Key Format
mgent-{64 hex characters}API keys are created when you create an Identity in the console. The full key is shown only once — store it securely.
Error Responses
Missing Authorization header
{
"error": "unauthorized",
"message": "Missing or invalid Authorization header",
"status": 401
}Invalid API key
{
"error": "unauthorized",
"message": "Invalid API key",
"status": 401
}Insufficient scope
{
"error": "forbidden",
"message": "Missing required scope: mail:send",
"status": 403
}Rate Limits
API requests are rate-limited per identity. Current limits:
| Tier | Requests/minute |
|---|---|
| Default | 100 |
Rate limit headers are included in responses:
X-RateLimit-RemainingX-RateLimit-Reset