# 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="" %}
[](https://docs.stoobly.com/guides/how-to-update-requests/how-to-update-scenarios)
{% 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](https://docs.stoobly.com/guides/how-to-update-requests/updating-with-replay/how-to-customize-replays/customizing-with-lifecycle-hooks).
{% 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 %}
