Skip to main content

POST /api/alerts/send

Sends email alerts via Resend. Supports health check alerts (pre-formatted HTML) and custom alerts.

Request body

Health alert

{
  "type": "health",
  "monitors": [
    {
      "name": "goshuin.com",
      "status": "down",
      "url": "https://goshuin.com"
    }
  ]
}

Custom alert

{
  "type": "custom",
  "subject": "Revenue dropped 20%",
  "html": "<p>Revenue has dropped significantly in the last 24 hours.</p>"
}

Response

Success

{ "sent": true, "id": "email-id-from-resend" }

Not configured

{ "configured": false }
Returns configured: false if Resend env vars are not set. This is not an error — it means alerts are simply disabled.