Webhooks

Resend inbound email webhook

Receives inbound emails forwarded to receipts@<workspace-slug>.frihet.io via Resend. Verifies the Svix webhook signature, extracts PDF/image attachments, and queues each one in receipt_queue/{workspaceUid}/items/{id} for downstream OCR processing.

This endpoint is called by Resend's inbound routing — not by API consumers. Signature verification uses HMAC-SHA256 with the RESEND_INBOUND_WEBHOOK_SECRET environment variable. Header format follows Svix: svix-id, svix-timestamp, svix-signature.

Supported attachment MIME types: application/pdf, image/jpeg, image/png, image/webp, image/heic, image/heif, image/tiff.

post/webhooks/resend-inbound

Request

  • Base URL: https://api.frihet.io
  • URL: https://api.frihet.io/webhooks/resend-inbound
  • Auth: none required

Request body

tostring[]

Recipient email addresses. Should include receipts@<slug>.frihet.io

fromstring

Sender email address

subjectstring

Email subject line

textstring

Plain text body

htmlstring

HTML body

Example request

{
  "to": [
    "receipts@myworkspace.frihet.io"
  ],
  "from": "vendor@example.com",
  "subject": "Invoice #1234 from Acme Corp",
  "attachments": [
    {
      "filename": "invoice.pdf",
      "content_type": "application/pdf"
    }
  ]
}

Response

Email processed. Returns count of queued attachments.

queuedinteger

Number of attachments queued for OCR

skippedinteger

Number of attachments skipped (unsupported type or no content)

Example response

{
  "queued": 2
}

Changes

No recorded changes to this operation across all 1 revision of this API.