> 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/core-concepts/mock-api/scenarios.md).

# Scenarios

{% hint style="info" %}
**Use Cases:**

* Replaying or testing requests in a sequence
* Documenting common workflows
* Sharing those workflows with others
  {% endhint %}

## What is a Scenario?

Take for example in a new user registration flow for some hypothetical application, the following HTTP requests are sent:

1. `POST /user` to create the new user
2. `GET /user/{user_id}` to retrieve data about the user
3. `GET /products` to retrieve a store's list of products to present to the user

This sequence of requests is specific for that workflow, has a defined order and can tied together. This enables you to group requests together, share them with other engineers or even replay the whole sequence. This is what we define as a scenario.

## How To Create Scenarios

If using the UI, navigate to the Scenarios page and click on the **CREATE** button on the top left corner.

<figure><img src="/files/k2imLjoV24V1V7ThBVc9" alt=""><figcaption><p>Scenarios Create</p></figcaption></figure>

For our full guide, see [How to Create Scenarios ](#how-to-create-scenarios).

## Scenario Key

Every Scenario will have a unique identifier for your Stoobly context. This can be retrieved from the UI or the CLI.

### From the UI

Navigate to the scenarios page then click on a scenario. This will open the scenario details page from the right side. At the top there will be a **Key** field which is the scenario key.

<figure><img src="/files/wcv51BhrBYmSPOa4MLd9" alt=""><figcaption><p>Scenario Key in the details page</p></figcaption></figure>

### From the CLI

Run the following command to view your scenarios:

```
$ stoobly-agent scenario list

  id  name                  requests_count  description      is_deleted  key
   1  My First Scenario                  1                            0  eyJwIjogMCwgImkiOiAzfQo=
```

Here in our example we have a single scenario. The scenario Key can be found in the `key` column which is `eyJwIjogMCwgImkiOiAzfQo=`.
