---
title: "Resend inbound email webhook"
method: POST
path: "/webhooks/resend-inbound"
tags: ["Webhooks"]
---

# Resend inbound email webhook

`POST /webhooks/resend-inbound`

## Request

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

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`.

## Request body

- ResendInboundPayload: Payload sent by Resend for inbound email routing.
  - `to` string[]: Recipient email addresses. Should include receipts@<slug>.frihet.io
  - `from` string: Sender email address
  - `subject` string: Email subject line
  - `text` string: Plain text body
  - `html` string: HTML body
  - `attachments` object[]
    - `filename` string: Original filename of the attachment
    - `content` string: Base64-encoded file content
    - `content_type` string: MIME type of the attachment

## Response `200`

Email processed. Returns count of queued attachments.

- object
  - `queued` integer: Number of attachments queued for OCR
  - `skipped` integer: Number of attachments skipped (unsupported type or no content)

## Other responses

- `400`: Invalid destination address format
- `401`: Missing or invalid Svix signature headers
- `404`: Workspace slug not found
- `500`: Internal server error

---

[API](https://skmtc.dev/frihet/apis/frihet-api.md) · [All operations](https://skmtc.dev/frihet/apis/frihet-api/llms.txt) · [OpenAPI document](https://skmtc.dev/frihet/apis/frihet-api/revisions/3dd37f6a72d1?raw)
