# Snapshots

## What are Snapshots?

{% hint style="info" %}
Think Git commits
{% endhint %}

Stoobly snapshots are point-in-time copies of your mock requests. They are a collection of request and scenario events along with meta needed to create or delete them. Snapshots can be useful for restoring to a previous state or can be used to share mock requests with others.

## Why use Snapshots?

* Save and backup requests and scenarios
* Share requests and scenarios
  * Version control requests and scenarios with Git

## Folder Structure

```
/home/user/.stoobly/snapshots
└── history
  └── 170052330
├── log
└── requests
    └── 4a
        └── 4a449553-b074-4782-809f-e52d8358da78
└── scenarios
    └── ea320e50-3a46-41ac-a8fc-a021402c22d6
    └── requests
        └── ea320e50-3a46-41ac-a8fc-a021402c22d6
└── VERSION
   
```

<details>

<summary>history</summary>

The `history` folder contains event bucket files such as `170052330` . These event bucket files contain events that occurred during a timeframe. These events are used to rebuild the mock state when snapshots are applied.

</details>

<details>

<summary>log</summary>

The `log` file contains events that were last applied. It should not be added to version control.

</details>

<details>

<summary>requests</summary>

The `requests` folder contains request bucket folders such as `4a` . These request bucket folders contain files such as `4a449553-b074-4782-809f-e52d8358da78` that contain the latest snapshot of a request.

</details>

<details>

<summary>scenario</summary>

The `scenarios` folder contains files such as `ea320e50-3a46-41ac-a8fc-a021402c22d6` that contain the latest **name** and **description** of a scenario. The folder also contains a `requests` folder that contains files such as `ea320e50-3a46-41ac-a8fc-a021402c22d6` that contain a list of requests that belong to the scenario.

</details>

<details>

<summary>VERSION</summary>

The `VERSION` file contains the uuids of events that were last applied. It should not be added to version control.

</details>

## Next Steps

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


---

# Agent Instructions: 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:

```
GET https://docs.stoobly.com/core-concepts/mock-api/snapshots.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
