Skip to content

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

FieldTypeRequiredDescription
domainstringYesDomain this route applies to
recipient_patternstringYesMatching pattern (exact, wildcard, plus-addressing, or regex)
webhook_urlstringYesDestination webhook URL
webhook_secretstringNoHMAC-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

StatusReason
400Missing or empty webhook_url
401Invalid or missing API key

Delete Route

DELETE /routes/{id}

Remove a routing rule.

Parameters

ParameterInTypeRequiredDescription
idpathstringYesRoute ID

Response 204 No Content

Errors

StatusReason
401Invalid or missing API key
404Route not found

Route Object

FieldTypeDescription
idstringUnique identifier (format: r-{timestamp})
domainstringAssociated domain
recipient_patternstringMatching pattern
webhook_urlstringDestination URL
webhook_secretstringSigning secret (omitted if empty)
created_atstring (ISO 8601)Creation timestamp

Released under the Apache 2.0 License.