# Erase contacts

`POST /v1/contacts/erase`

Requires an API key with the `contacts:delete` scope. [About keys and scopes](/docs/api/authentication)

Deletes up to 100 contacts by `contactId`, `email` or `externalId`, with their events, memberships, consent history and journey enrollments, and reports an outcome per identifier. Journey messages go with the enrollments; campaign and transactional messages are kept for campaign totals but anonymised: the address, content and provider ids are removed and nothing links them to the person. Address suppressions are kept, so an erased address that is imported again is still not mailed. `sendInProgress` means a message was being handed to the provider; retry that one shortly. Requires `contacts:delete`; agent keys are refused.

## Request body

- `contacts` (object[], required, at least 1 item, at most 100 items)
  - One of: **By contact id**
    - `contactId` (string, required, uuid)
  - One of: **By email**
    - `email` (string, required)
  - One of: **By external id**
    - `externalId` (string, required, 1–255 characters)

## Returns

Returns `200 OK` with a `EraseContactsResult` in `data`. Otherwise returns an error; [Errors](/docs/api/errors) lists every code and which to retry.

- `results` (object[], required)
  - `contact` (object, required) — The identifier as sent.
  - `outcome` (string, required, one of `erased`, `not_found`, `send_in_progress`) — `send_in_progress`: a message is being handed to the provider; retry shortly.

## Example

```bash
curl -X POST https://api.kirora.io/v1/contacts/erase \
  -H "Authorization: Bearer $KIRORA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contacts": [
      {
        "contactId": "018f2a4e-6b1c-7d3e-9f40-4db757ce5a6b"
      }
    ]
  }'
```

Response `200`:

```json
{
  "data": {
    "results": [
      {
        "contact": {},
        "outcome": "erased"
      }
    ]
  }
}
```
