> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meetdarwin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Erase or export a person's data

> Answer data subject requests with the Darwin API: export everything held about one person by email, or erase their contact, transcripts and booking details for good. What is removed and what is kept.

When someone asks what you hold about them, or asks you to delete it, the Darwin API answers for everything Darwin keeps about them in one call. Both calls take the person's email address and need a key with the `privacy:write` scope. Create a key just for this and keep it with whoever handles privacy requests.

Both are `POST` requests, so the email address never appears in a URL or a server log.

## Export what Darwin holds

```bash theme={null}
curl https://api.meetdarwin.ai/v1/privacy/exports \
  -H "Authorization: Bearer $PRIVACY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email": "jordan@example.com"}'
```

The answer is one JSON document:

| Field | What it holds |
| - | - |
| `object` | `privacy_export` |
| `email` | The address, lowercased |
| `generated_at` | When the export was made |
| `contact` | Their contact record, or `null` |
| `conversations` | Every conversation that names them, with the page, times, the name and email they gave, booking and handoff details, and the full transcript |
| `booking_attempts` | Native booking attempts linked to them or their conversations |
| `link_bookings` | Bookings made through a booking link, with the provider's details |

Hand it to the person as it is, or turn it into your own format. An export is a heavy request for [rate limits](/api-reference/rate-limits).

## Erase a person

<Warning>
  Erasure is permanent. Darwin cannot restore what it removes, and neither can Darwin support. Export first if you need a copy.
</Warning>

```bash theme={null}
curl https://api.meetdarwin.ai/v1/privacy/erasures \
  -H "Authorization: Bearer $PRIVACY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: erase-jordan-2026-10-12" \
  -d '{"email": "jordan@example.com"}'
```

If you already have their contact id, `DELETE /v1/contacts/{id}` does the same and returns the same receipt inside `erasure`.

The `201` response is a receipt:

```json theme={null}
{
  "object": "privacy_erasure",
  "id": "era_k2m9q1x7z3c5v8b4",
  "email_hash": "9a3f…",
  "conversations": 3,
  "booking_attempts": 1,
  "link_bookings": 0,
  "events": 4,
  "contact_deleted": true
}
```

The counts say how many records were changed. Darwin keeps this receipt with a hash of the address, never the address itself, so you can show an erasure took place without keeping what was erased.

**It worked if** `GET /v1/contacts?email=jordan@example.com` returns an empty list and the conversations counted in the receipt have no transcript.

### What erasure removes

In one step, everywhere Darwin keeps it:

* **The contact** is deleted.
* **Every conversation that names them** loses its transcript, the lead's name and email, the booker's email and the handoff note. Darwin's grading notes on those conversations go too.
* **Booking attempts** lose their details. **Link bookings** lose the name, email and the provider's details.
* **Chat API sessions** lose the identity and external id you passed.
* **Events** about them keep their type and time and lose their payload. Webhooks for those events that have not gone out yet send `"data": { "erased": true }`.

### What erasure keeps

* Each conversation's row and timestamps, so last month's counts, opening-test results and billing don't change.
* The receipt described above.

### What it can't reach

* **Emails already sent** to your team about a booking or a lead are in their inboxes.
* **Your calendar provider's copy** of the meeting. Remove it in Calendly or Google Calendar.
* **Systems you sent data to**: your CRM, Slack, warehouse or anything else that received webhooks or API reads. Erase it there too.

## Running both from code

<CodeGroup>
  ```javascript Node theme={null}
  async function privacyRequest(kind, email) {
    // kind: "exports" or "erasures"
    const res = await fetch(`https://api.meetdarwin.ai/v1/privacy/${kind}`, {
      method: "POST",
      headers: { Authorization: `Bearer ${process.env.PRIVACY_API_KEY}`, "Content-Type": "application/json" },
      body: JSON.stringify({ email }),
    });
    if (!res.ok) throw new Error((await res.json()).detail);
    return res.json();
  }

  const copy = await privacyRequest("exports", "jordan@example.com");
  const receipt = await privacyRequest("erasures", "jordan@example.com");
  ```

  ```python Python theme={null}
  import os, requests

  def privacy_request(kind, email):  # kind: "exports" or "erasures"
      res = requests.post(
          f"https://api.meetdarwin.ai/v1/privacy/{kind}",
          json={"email": email},
          headers={"Authorization": f"Bearer {os.environ['PRIVACY_API_KEY']}"},
      )
      res.raise_for_status()
      return res.json()

  copy = privacy_request("exports", "jordan@example.com")
  receipt = privacy_request("erasures", "jordan@example.com")
  ```
</CodeGroup>

An address that isn't a usable email returns `400` [`invalid_request`](/api-reference/errors#invalid_request) with `param: "email"`. An address Darwin holds nothing about still succeeds, with zero counts and `contact_deleted: false`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.