---
title: "email.message.failed"
method: POST
path: "email.message.failed"
---

# email.message.failed

`POST email.message.failed` (webhook)

Sent to every active endpoint subscribed to this event. Endpoints without a secret receive no signing header. When a secret is configured, verify `X-Custodo-Signature` before trusting the body: it is `t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<raw body>" keyed with the endpoint’s whsec_… secret>`; reject a `t` more than five minutes away. Answer any 2xx to acknowledge; anything else is retried with backoff.

## Headers

- `X-Custodo-Event` string, required
- `X-Custodo-Delivery` string, required
- `X-Custodo-Signature` string

## Payload

- object
  - `id` string, uuid, required: The delivery id.
  - `event` 'email.message.failed', required
  - `tenant_id` string, uuid, required
  - `created_at` string, date-time, required
  - `data` object, required: The event’s own payload: ids and scalars, never content.
    - `outboxId` string, required
    - `accountId` string, required
    - `subject` string, required
    - `contextType` string, nullable, required
    - `contextId` string, nullable, required
    - `error` string, required
    - `sentByUserId` string, nullable, required
    - `attempts` number, required
    - `stage` 'pec'
    - `pecOutcome` 'accettazione' | 'presa-in-carico' | 'avvenuta-consegna' | 'mancata-consegna' | 'rilevazione-virus' | 'errore'

## Acknowledgement `2XX`

Acknowledged; nothing is retried.

---

[API](https://skmtc.dev/custodo/apis/custodo-integrazioni.md) · [All operations](https://skmtc.dev/custodo/apis/custodo-integrazioni/llms.txt) · [OpenAPI document](https://skmtc.dev/custodo/apis/custodo-integrazioni/revisions/16d336d3ec2a?raw)
