# Changes

See what was changed, undo changes in Svanja and check actions in other services.

Web version: https://www.svanja.com/docs/api/changes/

Changes is the history of what the assistant, tasks, and people have modified, limited to what your key can see. In the app, it appears under the [Changes](https://app.svanja.com/tasks?view=changes) tab on Tasks. It covers changes made inside Svanja, like an edited note or contact, along with receipts for actions taken in other services. Use these endpoints to see what a task did and undo it. Reading requires the Changes area, which Full access and Read-only both include. Undoing requires Full access or Changes set to **Read and write**. See [Tasks](https://www.svanja.com/docs/tasks/).

`GET /changes` lists changes, and `GET /changes/{change_id}` returns a single one. The list comes back as one page. Use `limit` to set how many items to return, with 75 as the default and 200 as the maximum.

Not every change can be undone. Each one has `actions` with three flags: `undo`, `check`, and `reverse_external`. Only call an endpoint when its flag is `true`:

- `POST /changes/{change_id}/undo` undoes a change in Svanja while keeping later edits that don't conflict.
- `POST /changes/{change_id}/check` checks the current state of an action in another service.
- `POST /changes/{change_id}/reverse` asks the other service to take the action back.

From a terminal, use [svanja changes](https://www.svanja.com/docs/cli/changes/).

## Operations

| Operation | What it does | Effect | Endpoints |
| --- | --- | --- | --- |
| `changes.read` | Read Changes and receipts. | Reads only | `GET /changes`<br>`GET /changes/{change_id}` |
| `changes.reverse_external` | Reverse an external effect. | Acts outside Svanja | `POST /changes/{change_id}/check`<br>`POST /changes/{change_id}/reverse` |
| `changes.undo` | Undo a supported change. | Changes data in Svanja | `POST /changes/{change_id}/undo` |

## Endpoints

### GET /api/v1/changes

List Changes and receipts

Lists changes and receipts visible to the key visibility user. A key or hosted MCP grant limited to chosen Spaces sees Space changes only in those Spaces, and Mail and CRM changes only through the person's Mail delegation and its mailboxes, as on the Mail endpoints. Detail, undo, check and reverse follow the same rules.

### GET /api/v1/changes/{change_id}

Show a Change or receipt

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `change_id` | path | string | yes |  |

### POST /api/v1/changes/{change_id}/undo

Undo a supported Change

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `change_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | no | Optional key for unsafe bearer writes. Reusing the same key and same canonical body replays the original response for 24 hours; reusing it with a different body returns idempotency_conflict. |

### POST /api/v1/changes/{change_id}/check

Check an external Change outcome

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `change_id` | path | string | yes |  |

### POST /api/v1/changes/{change_id}/reverse

Reverse an external Change where supported

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `change_id` | path | string | yes |  |
| `Idempotency-Key` | header | string | no | Optional key for unsafe bearer writes. Reusing the same key and same canonical body replays the original response for 24 hours; reusing it with a different body returns idempotency_conflict. |
