# Rights request: access, export, delete, correct, restrict, object, withdraw consent, appeal

URL: https://neattrim.com/docs/api/create-privacy-request

POST /v1/privacy/requests: Rights request: access, export, delete, correct, restrict, object, withdraw consent, appeal.

Endpoint: `POST /v1/privacy/requests`

Who can call it: An API key, or an OAuth token for an app.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | no | Required on POSTs that create a job, upload, checkout, plan change or top-up; stored 24 h per ledger subject; same key with a different body returns 409 IDEMPOTENCY_MISMATCH |

## Request body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `type` | any | yes |  (one of "access", "export", "delete", "correct", "restrict", "object", "withdraw_consent", "appeal", "child_data", "other") |
| `message` | string | no |  |
| `email` | string | no |  |

## Examples

Set NEATTRIM_API_KEY to your key, then copy an example. A tool that draws from your allowance reads an uploaded file: upload a sample file as in the quickstart and set VIDEO_FILE_ID (or AUDIO_FILE_ID, IMAGE_FILE_ID, SUBTITLES_FILE_ID) to its file_id. Any other id in an example, such as JOB_ID, is read from a variable of the same name.

### curl

```bash
curl -X POST "https://api.neattrim.com/v1/privacy/requests" \
  -H "Authorization: Bearer $NEATTRIM_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"type":"access"}'
```

### TypeScript

```ts
// @neattrim/sdk is not on npm yet: it arrives with the first client release. Use the curl example today.
import { api, Neattrim, unwrap } from "@neattrim/sdk";

const client = new Neattrim({ apiKey: process.env.NEATTRIM_API_KEY });
const result = unwrap(
  await api.createPrivacyRequest({
    client: client.client,
    body: {
      "type": "access"
    },
  }),
);
console.log(result);
```

### Python

```python
# neattrim is not on PyPI yet: it arrives with the first client release. Use the curl example today.
import os

from neattrim import Neattrim
from neattrim_generated.api.account import create_privacy_request
from neattrim_generated.models import CreatePrivacyRequestBody

with Neattrim(api_key=os.environ["NEATTRIM_API_KEY"], base_url="https://api.neattrim.com") as client:
    result = create_privacy_request.sync(client=client.client, body=CreatePrivacyRequestBody.from_dict({"type": "access"}))
    print(result)
```

## Response 202

Received; the response is the same whether or not the address exists

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `status` | any | no |  (one of "received", "verify_email_sent") |

## Errors

- `400`: BAD_REQUEST
- `429`: RATE_LIMITED
