MOLTED EMAIL

Alert Destinations

Configure webhook and Slack destinations to receive alerts when queue, send-failure, policy-block, bounce, complaint or SLA conditions fire.

Alert destinations let you route platform alerts to an external endpoint -- a webhook URL or a Slack incoming webhook. When an alert condition fires, Molted posts a notification to each active destination.

Alert conditions

Seven conditions are evaluated, each with a warning and a critical threshold (a value at or above the threshold sets the level):

ConditionMeasuresWarning atCritical at
queue_stale_countThreads in override queues with no update for over 30 minutes520
send_failures_24hApproved overrides that resulted in send failures in the last 24h310
policy_blocks_24hThreads blocked by policy in the last 24h1050
oldest_queue_item_age_minutesAge of the oldest item in an override queue, in minutes30120
bounce_rate_24hBounce rate in the last 24h, in percent515
complaint_count_24hComplaint events in the last 24h15
sla_breaches_24hThreads that breached their SLA deadline in the last 24h15

Account pauses (incidents) and mailbox reputation pauses don't notify alert destinations themselves; watch them with molted incidents list and the event stream.

Alerts are evaluated on a schedule (about once a minute) for every active tenant with at least one active destination (a tenant with deletion requested is skipped), so a firing alert reaches its destination without anyone needing to poll alert status first. Checking alert status still notifies too, so an in-progress incident is never more than a status check away.

A destination is notified when the set of firing conditions and their levels changes -- a new condition starts firing, one clears, or a condition's level goes up or down -- not on every evaluation. An unchanged firing state gets at most one reminder notification per day (by default). Recovery to ok never sends a notification itself, but resets the state so the next time something fires (even if it looks identical to before) notifies right away. This keeps one stuck condition from posting to your destination every few minutes all day, while still surfacing a real change immediately.

Notification payload

A webhook destination receives a POST with only a Content-Type: application/json header (no signature):

Webhook payload
{
  "event": "alert.fired",
  "severity": "warning",
  "mailbox_id": null,
  "details": {
    "checkedAt": "2026-03-31T12:00:00Z",
    "conditions": [
      { "name": "bounce_rate_24h", "value": 6.2, "level": "warning", "description": "..." }
    ]
  },
  "timestamp": "2026-03-31T12:00:00Z"
}

details.conditions lists only the firing conditions. A Slack destination gets a Block Kit message headed "Molted Alert - WARNING" (or CRITICAL). Each notification is tried twice, 5 seconds apart, with a 10-second timeout per try.

Create a destination

POST https://mailbox.molted.email/v1/agent/alerts/destinations
CLI
molted alerts destinations create --type webhook --url https://hooks.example.com/molted-alerts
curl
curl -X POST https://mailbox.molted.email/v1/agent/alerts/destinations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "webhook",
    "url": "https://hooks.example.com/molted-alerts"
  }'
Response
{
  "id": "6f1c2a9e-0b7d-4c1e-9a52-3d8e2f4b7c10",
  "tenant_id": "tenant_abc123",
  "type": "webhook",
  "url": "https://hooks.example.com/molted-alerts",
  "is_active": true,
  "created_at": "2026-03-31T12:00:00Z",
  "last_notified_at": null,
  "last_notified_fingerprint": null,
  "last_test_sent_at": null
}

The response is the stored row, with snake_case fields; id is a UUID.

FieldTypeRequiredDescription
typestringYeswebhook or slack.
urlstringYesPublic http:// or https:// URL to post alerts to.

For Slack, use the incoming webhook URL from your Slack app configuration.

url must be a public http:// or https:// address; it's rejected (400) if it embeds credentials or resolves -- as a literal IP or via DNS -- to a private, loopback, link-local, or otherwise internal/reserved address (including cloud metadata endpoints like 169.254.169.254). This is re-checked on every alert delivery, not just at creation. Redirects are not followed: a 3xx response is recorded as a failed delivery.

Creating, deleting and testing a destination need manage scope; listing destinations and deliveries needs read. All of them are an admin's or the owner's: a destination's URL is a credential (anyone holding a Slack webhook URL can post to that channel), so a member's or a viewer's key, or session, gets 403 role_required. Every destination route refuses a mailbox-scoped key. There are no MCP tools for alert destinations.

List destinations

GET https://mailbox.molted.email/v1/agent/alerts/destinations
CLI
molted alerts destinations list
curl
curl https://mailbox.molted.email/v1/agent/alerts/destinations \
  -H "Authorization: Bearer YOUR_API_KEY"

Returns the same rows as create, newest first.

Delete a destination

DELETE https://mailbox.molted.email/v1/agent/alerts/destinations/:id
CLI
molted alerts destinations delete DESTINATION_ID
curl
curl -X DELETE https://mailbox.molted.email/v1/agent/alerts/destinations/DESTINATION_ID \
  -H "Authorization: Bearer YOUR_API_KEY"

Returns { "deleted": true }, or 404 Alert destination not found.

A destination is how you hear about your agent, so deleting one is a person's decision: in a workspace in enforce mode (the default for new workspaces) an agent key (or an OAuth-connected agent) gets 403 human_decision_required with kind: "alert-destination" and the destination stays. The exception is a destination your own key created. In warn mode the call goes through with a Molted-Deprecation: human-gate header; with the gate off it simply works. There is no route to change a destination's URL.

Send a test alert

Send a clearly-labelled test alert to one destination, to verify it's reachable and configured correctly. This bypasses the change-based notification logic above -- a test send never gets suppressed by, and never suppresses, a real firing alert. It has its own short throttle instead to prevent abuse: one test send per destination every 30 seconds, and 10 test sends a minute across all of the workspace's alert destinations and webhook endpoints together. A request over either limit gets a 429 with { "error": "rate_limited", "message": "..." } and sends nothing. A workspace can have at most 20 alert destinations; adding a 21st gets a 409 with error: "alert_destination_limit_reached".

When the test request fails, error is one of a fixed set of codes and never carries an address or port: connection_refused, timeout, tls_error, blocked_destination, response_too_large, connection_failed, or http_<status> (for example http_503) when your endpoint answered with a non-2xx status. A destination URL has to be a public host name or address: a single-label name such as intranet, a reserved suffix such as .local or .internal, and a name that does not resolve are all refused with the same message when you add the destination.

POST https://mailbox.molted.email/v1/agent/alerts/destinations/:id/test
CLI
molted alerts destinations test DESTINATION_ID
curl
curl -X POST https://mailbox.molted.email/v1/agent/alerts/destinations/DESTINATION_ID/test \
  -H "Authorization: Bearer YOUR_API_KEY"

The test body is { "event": "alert.test", "message": "...", "timestamp": "..." }.

Response
{
  "success": true,
  "responseCode": 200,
  "error": null,
  "deliveryId": "..."
}

List delivery attempts

GET https://mailbox.molted.email/v1/agent/alerts/destinations/:id/deliveries
CLI
molted alerts destinations deliveries DESTINATION_ID
curl
curl "https://mailbox.molted.email/v1/agent/alerts/destinations/DESTINATION_ID/deliveries?limit=50" \
  -H "Authorization: Bearer YOUR_API_KEY"

Returns the most recent delivery attempts (real and test) for that destination, newest first (limit default 50, 1 to 200). Each has id, destinationId, overallLevel ("test" for a test send), isTest, status (success or failure), responseCode, error, and createdAt. Delivery attempts are kept for 30 days and then deleted, so the list is a recent history, not a permanent log.

Check alert status

Get the current level of every alert condition for your tenant.

GET https://mailbox.molted.email/v1/agent/alerts/status
CLI
molted overrides alerts
curl
curl https://mailbox.molted.email/v1/agent/alerts/status \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
{
  "checkedAt": "2026-03-31T12:00:00Z",
  "overallLevel": "warning",
  "conditions": [
    { "name": "bounce_rate_24h", "value": 6.2, "level": "warning", "description": "..." }
  ]
}

overallLevel is ok, warning or critical (the worst condition), and conditions always lists all seven. The key needs the operator scope (403 missing_scope:operator otherwise). molted doctor and the MCP check_send_health tool include the same status.

Portal management

The routes below are for a signed-in human in the portal (cookie session). They are human-only: an agent, including an agent-held cookie session, gets 403 human_required and should use the /v1/agent/alerts/destinations routes above with its API key instead.

MethodPathDescription
POST/v1/me/alerts/destinationsCreate a destination.
GET/v1/me/alerts/destinationsList destinations.
DELETE/v1/me/alerts/destinations/:idDelete a destination.
POST/v1/me/alerts/destinations/:id/testSend a test alert.
GET/v1/me/alerts/destinations/:id/deliveriesList delivery attempts.