Webhook Payload Formats

Reference for the inbound webhook payloads sent by Resend and SendGrid when your domain receives an email.

Resend Inbound Webhook

Resend sends inbound emails as JSON with Svix signature verification.

Headers

svix-id: msg_abc123
svix-timestamp: 1234567890
svix-signature: v1,g0hM9SsE+OTPJTGt/...
Content-Type: application/json

Payload

{
  "type": "email.received",
  "created_at": "2025-01-15T10:30:00Z",
  "data": {
    "email_id": "em_abc123",
    "from": "sender@example.com",
    "to": "inbox@your-domain.com",
    "subject": "Hello World",
    "text": "Plain text body",
    "html": "<p>HTML body</p>"
  }
}

Authentication Methods

  1. Svix signature (primary) — Verified using the webhook's shared secret
  2. Bearer token (fallback) — Authorization: Bearer <shared-secret>
  3. Legacy header (fallback) — x-webhook-secret: <shared-secret>

SendGrid Inbound Parse

SendGrid sends inbound emails as multipart/form-data.

FieldDescription
fromSender (e.g., Name <email>)
toRecipient address
subjectEmail subject
textPlain text body
htmlHTML body
envelopeJSON with sender/recipients

Authentication Header

x-webhook-secret: <shared-secret>
# or
Authorization: Bearer <shared-secret>

Webhook URL Format

After creating a webhook in the dashboard, use these URLs in your email provider:

Resend:   https://your-domain.com/api/webhooks/<token>/resend
SendGrid: https://your-domain.com/api/webhooks/<token>/sendgrid

The <token> is auto-generated and shown after webhook creation.