> For the complete documentation index, see [llms.txt](https://wiki.crosswatch.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.crosswatch.app/crosswatch/advanced-and-api/api-reference/storage-and-operations.md).

# Storage and operations

Use these endpoints to manage local CrossWatch storage and operations.

### Files and logs

| Method | Endpoint            | Purpose                                |
| ------ | ------------------- | -------------------------------------- |
| `GET`  | `/api/files`        | List a configured storage path.        |
| `GET`  | `/api/logs/dump`    | Return buffered log lines.             |
| `GET`  | `/api/logs/stream`  | Stream one log channel using SSE.      |
| `GET`  | `/api/logs/watcher` | Stream Watcher log channels using SSE. |

### Captures and backups

| Endpoint group     | Purpose                                                                    |
| ------------------ | -------------------------------------------------------------------------- |
| `/api/snapshots/*` | Create, compare, restore, delete, and clear captures.                      |
| `/api/backups/*`   | Create, validate, download, restore, upload, schedule, and retain backups. |

Validate a backup before restore. Do not restore while synchronization or capture work is active.

### Maintenance

`/api/maintenance/*` manages local caches, state, tracker data, event storage, and process restarts.

These routes can clear local data or trigger a rebuild. They do not directly remove provider data. A later sync can still apply provider changes after rebuilding local state.

{% hint style="warning" %}
Run a dry run after clearing state or caches. Confirm destructive requests before sending them.
{% endhint %}

Examples of destructive endpoints include:

* `POST /api/maintenance/clear-state`
* `POST /api/maintenance/reset-all-default`
* `POST /api/maintenance/restart`
* `POST /api/maintenance/events-rebuild`
* `POST /api/snapshots/clear`
* `POST /api/backups/restore`

Use `GET /api/maintenance/action-status/{action}` to inspect background maintenance work.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://wiki.crosswatch.app/crosswatch/advanced-and-api/api-reference/storage-and-operations.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
