# requestDirectMailCancellation

Ask the mail provider to cancel one letter (listContactDirectMail id). contactId must be the contact the letter is on: the `id` getContact returns, which differs from a merged-away id (this write does not follow merges). It reads Canceled only once the provider confirms; asking again returns the same open request. Refused once the provider is producing or mailing it. Needs permission to manage workflows and mail.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "requestDirectMailCancellation", "variables": {...} }`
- Scope: `WRITE`
- Type: mutation
- Idempotency: honors `Idempotency-Key` (24 h)
- Rate-limited: no

## Variables

- `contactId`: `ID!` (required)
- `pieceId`: `ID!` (required)

## Response (data, an example)

```json
{
  "contactMutation": {
    "requestDirectMailCancellation": {
      "id": "<ID>",
      "status": "QUEUED"
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "operationId": "requestDirectMailCancellation",
    "variables": {
      "contactId": "<contactId>",
      "pieceId": "<pieceId>"
    }
  }'
```
