> For the complete documentation index, see [llms.txt](https://docs.stoobly.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stoobly.com/guides/how-to-update-requests/editing-with-snapshots.md).

# Editing with Snapshots

## Prerequisites

1. [Snapshot requests](/guides/how-to-mock-apis/how-to-snapshot-requests.md)
2. (Optional) Use a version tool such as Git to backup changes

## Updating Requests by Editing Snapshots

{% stepper %}
{% step %}
**Find request snapshots that match a pattern**

Run the following CLI command:

```bash
stoobly-agent snapshot list --search <PATTERN> --select snapshot --select uuid
```

For example:

```bash
$ stoobly-agent snapshot list --search /api --select snapshot --select uuid
snapshot                                                             uuid
.stoobly/snapshots/requests/19/19cfd765-80bc-4a2c-ad36-c59e7dbb9c92  cd99c578-3a97-11f0-98ef-51122b0b22b6
```

{% endstep %}

{% step %}
**Edit request snapshots**

For each file found, make the desired change to the request snapshot.

In the example from step 1, the request snapshot is stored in `.stoobly/snapshots/requests/19/19cfd765-80bc-4a2c-ad36-c59e7dbb9c92` .
{% endstep %}

{% step %}
**Create new snapshots for each updated request**

Run the following CLI command:

```bash
stoobly-agent snapshot update <SNAPSHOT-UUID>
```

In the example from step 1, the snapshot uuid is `cd99c578-3a97-11f0-98ef-51122b0b22b6`.
{% endstep %}

{% step %}
**Apply the snapshots**

Run the following CLI command:

```
stoobly-agent snapshot apply
```

{% endstep %}
{% endstepper %}


---

# 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://docs.stoobly.com/guides/how-to-update-requests/editing-with-snapshots.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.
