> 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/how-to-update-scenarios/updating-with-replay.md).

# Updating with Replay

There are two ways to update a scenario using the CLI.

* Replay a scenario's requests and update the request responses
* Overwrite the scenario with new requests and responses

## Background

{% content-ref url="/pages/WGDfUf8LR718Ltv79uSX" %}
[How to Update Scenarios](/guides/how-to-update-requests/how-to-update-scenarios.md)
{% endcontent-ref %}

## Replaying

{% hint style="warning" %}
If request(s) require authorization headers, they should be added dynamically.
{% endhint %}

The following command will replay the scenario and update the recorded responses with the newly received repsonses.

### Steps

{% stepper %}
{% step %}
**Decorate requests with credentials**

An authorization header or a cookie may be needed to be added to replayed requests. To do so, see the following guide on how to use [lifecycle hooks](/guides/how-to-update-requests/updating-with-replay/how-to-customize-replays/customizing-with-lifecycle-hooks.md).
{% endstep %}

{% step %}
**Replay the scenario**

```bash
stoobly-agent scenario replay --overwrite "<SCENARIO-KEY>"
```

{% endstep %}

{% step %}
**(Optional) Persist changes with a snapshot**

If you want to version control or share the updated scenario, create a snapshot:

```bash
stoobly-agent scenario snapshot "<SCENARIO-KEY>"
```

This allows you to:

* Version control your updated scenario via Git
* Share the updates with your team
* Revert to this snapshot if needed later
  {% 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/how-to-update-scenarios/updating-with-replay.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.
