# Changes

The ordered change feed of a Space, and a summary of recent activity.

API reference. Base URL: `https://api.mirabase.dev`

## See who changed what recently

`GET /v2/spaces/{space_id}/activity`

Summarize the change feed of the last `days` days per principal and per Entry. Read it before planning work in a shared Space to see what others are doing and avoid editing the same file. It scans at most the last 1000 changes (`truncated` is `true` when the period held more) and lists at most 50 Entries per principal. It shows only what `changes` would show you: a member with a `read_root` sees only changes under it. Main only. Needs `knowledge:read`.

**Capability** `knowledge:read`

Guide: [Sync, snapshots, and export](https://mirabase.io/developers/sync.md#activity)

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `space_id` | Path | `DevSpaceRef` | Required | A Space id; `default` for your default Space (your own, or the only Space you can see); or `ext:<external_id>` for the Space that carries your own id for it, such as `ext:user-42`. All three work in a path, in `?space_id=`, and in `space_ids`. An `external_id` that no visible Space carries returns 404. length 1..256 |
| `days` | Query | `integer` | Optional | How many days to look back, 1 to 30. 1..30, default: 7 |

### Responses

- `200` `application/json` `DevSpaceActivity`

### Error statuses

`400` `401` `403` `404` `422` `429` `500` `503` See [Errors](https://mirabase.io/developers/conventions.md#errors) for the error shape and [Error codes](https://mirabase.io/developers/errors.md) for what each code means.

### Example request

```bash
curl "https://api.mirabase.dev/v2/spaces/$SPACE_ID/activity" \
  -H "Authorization: Bearer $MIRABASE_API_KEY"
```

### Example response

```json
{
  "since": "2026-11-06T00:00:00Z",
  "truncated": false,
  "data": [
    {
      "last_changed_at": "2026-11-06T00:00:00Z",
      "change_count": 1,
      "files": [
        {
          "entry_id": "<entry_id>",
          "op": "create",
          "changed_at": "2026-11-06T00:00:00Z",
          "change_count": 1
        }
      ]
    }
  ]
}
```

## Read the change feed

`GET /v2/spaces/{space_id}/changes`

Read the ordered change feed, kept for 90 days. An expired cursor returns 410 `cursor_expired`; use `tree` to resync. With `branch`, the response is `DevBranchChangeFeed` and takes that branch's own cursors from `tree?branch=`. For a member with a `read_root`, only events under it appear: a file moved in is `create`, and a file moved out is `delete` without `path`. A page reads at most `limit` events before filtering, so `data` can be shorter or empty while `has_more` is `true`; with `wait`, a page emptied by filtering keeps waiting. Needs `knowledge:read`.

**Capability** `knowledge:read`

Guide: [Sync, snapshots, and export](https://mirabase.io/developers/sync.md)

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `space_id` | Path | `DevSpaceRef` | Required | A Space id; `default` for your default Space (your own, or the only Space you can see); or `ext:<external_id>` for the Space that carries your own id for it, such as `ext:user-42`. All three work in a path, in `?space_id=`, and in `space_ids`. An `external_id` that no visible Space carries returns 404. length 1..256 |
| `branch` | Query | `DevBranchRef` | Optional | The branch to use instead of main: its id, or the name of an active branch. For a member with a `read_root` in this Space, any branch returns 403 `outside_read_root`. |
| `cursor` | Query | `DevCursor` | Optional | Where to continue from: the `cursor` of the previous response, or a `changes_cursor` from `tree` or from a snapshot. Omit it to start from now. length 1..1024 |
| `wait` | Query | `integer` | Optional | Long-poll timeout in seconds when no events are ready. A key can hold at most 4 waiting requests at once; one more returns 429 `too_many_waiters`. 0..30 |
| `limit` | Query | `integer` | Optional | How many events to read at most: 1 to 100, 100 by default. 1..100, default: 100 |

### Responses

- `200` `application/json` `DevChangeFeed | DevBranchChangeFeed`

### Error statuses

`400` `401` `403` `404` `410` `422` `429` `500` `503` See [Errors](https://mirabase.io/developers/conventions.md#errors) for the error shape and [Error codes](https://mirabase.io/developers/errors.md) for what each code means.

### Example request

```bash
curl "https://api.mirabase.dev/v2/spaces/$SPACE_ID/changes" \
  -H "Authorization: Bearer $MIRABASE_API_KEY"
```

### Example response

```json
{
  "data": [
    {
      "seq": 1,
      "op": "create",
      "entry_id": "<entry_id>",
      "created_at": "2026-11-06T00:00:00Z"
    }
  ],
  "cursor": "<cursor>",
  "has_more": false
}
```
