---
title: "Discard email content"
method: POST
path: "/emails/{id}/discard-content"
tags: ["Emails"]
---

# Discard email content

`POST /emails/{id}/discard-content`

Permanently deletes the email's raw bytes, parsed body (text + HTML),
and attachments while preserving metadata (sender, recipient,
subject, timestamps, hashes, attachment manifest) for audit logs.
Idempotent: a second call returns success with
`already_discarded: true` and does no work.

**Gated** on the customer's discard-content opt-in (managed in the
dashboard at Settings > Webhooks). When the toggle is off, this
endpoint returns `403` with code `discard_not_enabled` and a
message pointing the human at the dashboard. There is intentionally
no API to flip this toggle. Opting in to a destructive,
non-reversible operation must be a deliberate human click in the
UI.

## Headers

- `Idempotency-Key` string

## Response `200`

Discard result

- object
  - `success` true, required
  - `data` object, required
    - `discarded` boolean, required — Always `true` on a 2xx response. The content is either now discarded as a result of this call, or was already discarded before this call ran.
    - `already_discarded` boolean, required — `true` if the email's content was already discarded before this call ran (no work was done). `false` if this call was the one that performed the discard.

## Other responses

- `400` — Invalid request parameters
- `401` — Invalid or missing API key
- `403` — Authenticated caller lacks permission for the operation
- `404` — Resource not found
- `429` — Rate limit exceeded
- `500` — Primitive encountered an internal error

---

[API](https://skmtc.dev/primitive/apis/primitive-api.md) · [All operations](https://skmtc.dev/primitive/apis/primitive-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/primitive/primitive-api/revisions/c2299d28022c/schema)
