Routes
Manage routing rules that connect recipient patterns to webhook endpoints.
List Routes
GET /routes
Returns all configured routes.
Response 200 OK
json
[
{
"id": "r-1710806400",
"domain": "yourdomain.com",
"recipient_pattern": "*@yourdomain.com",
"webhook_url": "https://yourapp.com/webhook",
"webhook_secret": "your-secret",
"created_at": "2025-03-19T00:00:00Z"
}
]INFO
The webhook_secret field is omitted from the response when it is not set.
Create Route
POST /routes
Create a new routing rule.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
domain | string | Yes | Domain this route applies to |
recipient_pattern | string | Yes | Matching pattern (exact, wildcard, plus-addressing, or regex) |
webhook_url | string | Yes | Destination webhook URL |
webhook_secret | string | No | HMAC-SHA256 signing secret |
json
{
"domain": "yourdomain.com",
"recipient_pattern": "*@yourdomain.com",
"webhook_url": "https://yourapp.com/webhook",
"webhook_secret": "optional-signing-secret"
}Response 201 Created
json
{
"id": "r-1710806400",
"domain": "yourdomain.com",
"recipient_pattern": "*@yourdomain.com",
"webhook_url": "https://yourapp.com/webhook",
"webhook_secret": "optional-signing-secret",
"created_at": "2025-03-19T00:00:00Z"
}Errors
| Status | Reason |
|---|---|
400 | Missing or empty webhook_url |
401 | Invalid or missing API key |
Delete Route
DELETE /routes/{id}
Remove a routing rule.
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | Route ID |
Response 204 No Content
Errors
| Status | Reason |
|---|---|
401 | Invalid or missing API key |
404 | Route not found |
Route Object
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier (format: r-{timestamp}) |
domain | string | Associated domain |
recipient_pattern | string | Matching pattern |
webhook_url | string | Destination URL |
webhook_secret | string | Signing secret (omitted if empty) |
created_at | string (ISO 8601) | Creation timestamp |