# archiveDeal

Archive or RESTORE one deal by id (isArchived true or false); archiveDeals archives many. Reversible: archiving takes the deal off the pipeline BOARD and deletes nothing. findDeals finds archived ones with isArchived: true. Archiving triggers no workflow, so it never sends a message. The deal must be in a pipeline owned by or shared with your organization.

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

## Variables

- `dealId`: `ID!` (required)
- `isArchived`: `Boolean!` (required)

## Response (data, an example)

```json
{
  "dealMutation": {
    "changeArchiveStatus": {
      "id": "<ID>",
      "title": "…",
      "isArchived": true
    }
  }
}
```

## 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": "archiveDeal",
    "variables": {
      "dealId": "<dealId>",
      "isArchived": true
    }
  }'
```
