Appendix: Endpoint Reference
This appendix provides a quick reference for all HTTP endpoints, both those exposed by the proxy and those that client applications must implement.
Proxy Endpoints (Server)
These endpoints are exposed by genro-mail-proxy for client applications to consume.
Authentication levels:
Public: No authentication required
Auth: Requires
X-API-Tokenheader (admin or tenant token)Admin: Requires admin token only
Tenant: Accepts admin or matching tenant token
Method |
Endpoint |
Auth |
Description |
|---|---|---|---|
GET |
|
Public |
Health check, returns |
GET |
|
Public |
Prometheus metrics (text format) |
GET |
|
Auth |
Service status with scheduler state |
POST |
|
Tenant |
Trigger immediate dispatch cycle |
POST |
|
Tenant |
Suspend sending for a tenant |
POST |
|
Tenant |
Resume sending for a tenant |
POST |
|
Tenant |
Queue messages for delivery |
POST |
|
Tenant |
Remove messages from queue |
POST |
|
Tenant |
Cleanup old reported messages |
GET |
|
Tenant |
List queued/sent messages |
POST |
|
Tenant |
Add/update SMTP account |
GET |
|
Tenant |
List SMTP accounts for tenant |
DELETE |
|
Tenant |
Delete an SMTP account |
POST |
|
Admin |
Create new tenant |
GET |
|
Admin |
List all tenants |
GET |
|
Admin |
Sync status for all tenants |
GET |
|
Tenant |
Get tenant configuration |
PUT |
|
Tenant |
Update tenant configuration |
DELETE |
|
Admin |
Delete tenant and all data |
POST |
|
Admin |
Generate new API key for tenant |
DELETE |
|
Admin |
Revoke tenant’s API key |
GET |
|
Admin |
Get instance configuration |
PUT |
|
Admin |
Update instance configuration |
POST |
|
Admin |
Reload bounce detection rules |
GET |
|
Admin |
Query command audit log |
GET |
|
Admin |
Export command log as JSON lines |
Client Endpoints (Required)
These endpoints must be implemented by client applications to receive callbacks from the proxy.
Method |
Endpoint |
Description |
|---|---|---|
POST |
|
Delivery reports callback. Receives JSON array of message statuses
(sent, error, bounced). Must return HTTP 200 with JSON response.
Can optionally return |
POST |
|
Attachment fetcher (optional). Called when |
Sync Endpoint Details
The sync endpoint receives delivery reports in this format:
{
"reports": [
{
"tenant_id": "acme",
"id": "msg-123",
"pk": "uuid-...",
"sent_ts": 1706000000.0,
"recipient_email": "user@example.com"
},
{
"tenant_id": "acme",
"id": "msg-456",
"error_ts": 1706000001.0,
"error": "Connection refused",
"recipient_email": "bad@example.com"
}
]
}
Expected response:
{
"ok": true,
"next_sync_after": 1706003600
}
The next_sync_after field is optional. If provided, the proxy will not
call this tenant’s sync endpoint until after that Unix timestamp (Do Not Disturb).
Attachment Endpoint Details
When a message includes an attachment with fetch_mode: "endpoint", the proxy
calls the attachment endpoint:
{
"storage_path": "document_id=12345"
}
The endpoint must return the file content with appropriate Content-Type
and optionally Content-Disposition headers.
Configuration
Client endpoints are configured per-tenant:
client_base_url: Base URL (e.g.,https://app.example.com)client_sync_path: Sync endpoint path (default:/mail-proxy/sync)client_attachment_path: Attachment endpoint path (default:/mail-proxy/attachments)client_auth: Authentication (bearer token or basic auth)
See Multi-tenancy Architecture for complete configuration details.