# API: Privacy

| Method | Path | What it does | Scope |
|---|---|---|---|
| POST | `/v1/marketing/privacy/requests/erase` | Erase a person's data in every module (the address typed twice; an owner, in the web app). A hashed do-not-contact entry is kept so they aren't contacted again (web app only) | `settings:write` |
| POST | `/v1/marketing/privacy/requests/export` | A person's data as a JSON file, to answer their request for it (an owner, in the web app; audited without the address). A long history comes in parts of up to 25,000 records: send `next_cursor` back as `cursor` for the next one (web app only) | `settings:write` |
| POST | `/v1/marketing/privacy/requests/preview` | What's held on a person, found by email address: how many people, and rows per table (never the rows). An owner, in the web app (web app only) | `settings:write` |
| GET | `/v1/marketing/privacy/retention` | How long people's events are kept (null keeps them) | `settings:read` |
| PUT | `/v1/marketing/privacy/retention` | Set how many days people's events are kept (30 to 3,650; null keeps them). An owner, in the web app; a daily job deletes what's older (web app only) | `settings:write` |

## Examples

### GET /v1/marketing/privacy/retention

How long people's events are kept (null keeps them)

```bash
curl -s "https://api.scheeleworks.com/v1/marketing/privacy/retention" \
  -H "Authorization: Bearer $MA_API_KEY"
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/marketing/privacy/retention`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}` },
});
const data = await res.json();
```

Request and response schemas: [https://www.scheeleworks.com/openapi.json](https://www.scheeleworks.com/openapi.json). All resources: [API reference](https://www.scheeleworks.com/docs/api).
