# Add suppressed email addresses

Source: https://kirora.io/docs/api/reference/addSuppressions

`POST /v1/suppressions`

Requires an API key with the `suppressions:write` scope. [About keys and scopes](https://kirora.io/docs/api/reference/authentication)

Works with integration and partner keys, not agent keys.

Safe to retry: a repeat sets the same values again. [About idempotency](https://kirora.io/docs/api/reference/idempotency)

Blocks email addresses: up to 10,000 per request, with reason `imported`, for example opt-outs carried over from another platform. An agent key cannot hold `suppressions:write`. Addresses are trimmed and lowercased; one already blocked keeps its reason, and an entry that is not an address is listed in `invalid` rather than refusing the request. Nothing is sent to anyone.

## Header parameters

- `Kirora-Workspace` (string, optional, pattern `^[A-Za-z0-9._:-]{1,128}$`) — Partner keys only: the child workspace to act in, by the external id the partner gave it. Without it, a partner key acts in its own workspace. Any other key that sends it is refused with 403, and an unknown workspace is 404.
- `Idempotency-Key` (string, optional, 8–255 characters) — Makes a retry safe: a repeat with the same key and body within 24 hours gets the first response again, with `Idempotency-Replay: true`. The same key with another request is 409 `IDEMPOTENCY_KEY_REUSED`; while the first is still running, 409 `IDEMPOTENCY_KEY_IN_USE`; after an `unsafe` first request failed or never returned, 409 `IDEMPOTENCY_KEY_OUTCOME_UNKNOWN`. Use a new key, such as a UUID, for each new request.

## Request body

- `emails` (string[], required, at least 1 item, at most 10,000 items) — Email addresses to block, up to 10,000; trimmed and lowercased.

## Returns

Returns `200 OK` with an `AddedSuppressions` in `data`. It can also return `409 Conflict`, `413 Payload Too Large` or `415 Unsupported Media Type`; see the statuses below. Otherwise returns an error; [Errors](https://kirora.io/docs/api/reference/errors) lists every code and which to retry.

- `addedCount` (integer, required, min 0) — Newly blocked addresses.
- `alreadySuppressedCount` (integer, required, min 0) — Already blocked, for any reason; their reason is left as it was.
- `invalid` (string[], required) — Entries that are not an email address, exactly as sent.

Statuses:

- `200 OK`: How many addresses were blocked, and how many already were.
- `409 Conflict`: The request conflicts with current state — a duplicate unique value, or a resource whose status does not allow this operation.
- `413 Payload Too Large`: The body is larger than this operation accepts (`PAYLOAD_TOO_LARGE`).
- `415 Unsupported Media Type`: The body is not JSON, or not the upload the operation takes (`UNSUPPORTED_MEDIA_TYPE`).

Headers on `200 OK`:

- `Idempotency-Replay` (string, optional, one of `true`) — `true` when this is the stored response to an earlier request with the same key.

## Example: Opt-outs carried over from another platform

```bash
curl -X POST https://api.kirora.io/v1/suppressions \
  -H "Authorization: Bearer $KIRORA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "emails": [
      "optout@example.com",
      "Old.Customer@Example.com",
      "not-an-address"
    ]
  }'
```

Response `200`:

```json
{
  "data": {
    "addedCount": 2,
    "alreadySuppressedCount": 0,
    "invalid": [
      "not-an-address"
    ]
  }
}
```
