> 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.md).

# How to Update Requests

## Prerequisites

1. [Run the agent](/guides/how-to-run-the-agent.md)
2. [Configure the proxy](/guides/proxy-configuration.md)
3. [Record request(s)](/guides/how-to-record-requests.md)

## Why Update Requests?

At some point in time, API providers will change the contract of a request. For example, maybe a component in the request or its response needs to be updated. When this happens we should also update the Stoobly request.

## Updating Requests

{% hint style="warning" %}
Before updating a request, it is recommended to create a [snapshot](/core-concepts/mock-api/snapshots.md) in case changes need to be reverted.
{% endhint %}

There are three main strategies to update request(s):

### Editing

* [Edit individual requests from the UI](/guides/how-to-update-requests/editing-from-the-ui.md)
* [Edit request snapshots](/guides/how-to-update-requests/editing-with-snapshots.md)

### Replaying

* [Replay individual requests](/guides/how-to-replay-requests.md)
* [Replay scenarios](/guides/how-to-update-requests/how-to-update-scenarios/updating-with-replay.md)

### Overwriting

* [Overwriting scenarios](/guides/how-to-update-requests/how-to-update-scenarios/updating-with-overwrite.md)

## Persisting Changes

{% content-ref url="/pages/Tyk5SmKa5es0I3YjLQA0" %}
[How to Snapshot Requests](/guides/how-to-mock-apis/how-to-snapshot-requests.md)
{% endcontent-ref %}

## Reverting Changes

In case you update a request with unintended consequences, you can reset it to the last snapshot state. For more information see our documentation on the snapshots feature:

{% content-ref url="/pages/WFKkQFPE0l9Zauwmdgd6" %}
[Snapshots](/core-concepts/mock-api/snapshots.md)
{% endcontent-ref %}

### Command

```bash
stoobly-agent request reset "<REQUEST-KEY>"
```

### Options

```bash
$ stoobly-agent request reset --help

Usage: stoobly-agent request reset [OPTIONS] REQUEST_KEY

  Reset a request to its snapshot state

Options:
  --force     Toggles whether resources are hard deleted.
  -h, --help  Show this message and exit.
```
