> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bland.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# File Scenario in Folder

> Move one of your agents' scenarios into a folder, or take it out.

### Overview

Files one scenario in a folder. If the scenario is already in a folder, it moves to the new one. Set `folder_id` to `null` to take it out of its folder. Taking out a scenario that isn't filed still succeeds.

Create the folder first with [Create Folder](https://docs.bland.ai/api-v1/post/create_pathway_folder.md). For how folders work, see [List Scenario Folders](https://docs.bland.ai/api-v2/get/agents-library-scenario-folders.md).

Requires an admin, owner, operator, or prompter role. Restricted API keys can't call this endpoint. Use a full-access key.

### Headers

**authorization** `string` *required*

Your API key for authentication.

### Body Parameters

**agent\_id** `string` *required*

The agent the scenario belongs to. Returns `404 NOT_FOUND` if the agent isn't in your organization or has been deleted.

**node\_id** `string` *required*

The scenario's node ID: the `id` of a scenario from [List Library Scenarios](https://docs.bland.ai/api-v2/get/agents-library-scenarios.md). 1 to 200 characters. Bland doesn't check that the agent has a node with this ID, so check it before you send it.

**folder\_id** `string | null` *required*

The folder to file the scenario in, or `null` to take it out of its folder. Returns `404 NOT_FOUND` if the folder isn't in your organization.

A missing field, an `agent_id` or `folder_id` that isn't a UUID, or a `node_id` outside 1 to 200 characters returns `400 BAD_REQUEST`.

### Response

**data** `object`

The saved filing.

**properties**

**agent\_id** `string`

The agent the scenario belongs to.

**node\_id** `string`

The scenario's node ID.

**folder\_id** `string | null`

The folder the scenario is now in, or `null` if it was taken out.

**errors** `null | array`

`null` on success, or a list of error objects if the request failed.

```bash File a scenario theme={null}
curl -X PUT https://api.bland.ai/v2/agents/library/scenario-folders \
  -H "authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "b5154820-6f11-4886-8523-d896934528ae",
    "node_id": "00fa3bcf-56f5-45b9-8996-427d57b091b7",
    "folder_id": "6f0e2a6c-1d3b-4f6e-9a57-2c8d1e4b7a90"
  }'
```

```bash Take it out of its folder theme={null}
curl -X PUT https://api.bland.ai/v2/agents/library/scenario-folders \
  -H "authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "b5154820-6f11-4886-8523-d896934528ae",
    "node_id": "00fa3bcf-56f5-45b9-8996-427d57b091b7",
    "folder_id": null
  }'
```

```json Response theme={null}
{
  "data": {
    "agent_id": "b5154820-6f11-4886-8523-d896934528ae",
    "node_id": "00fa3bcf-56f5-45b9-8996-427d57b091b7",
    "folder_id": "6f0e2a6c-1d3b-4f6e-9a57-2c8d1e4b7a90"
  },
  "errors": null
}
```

```json Folder Not Found theme={null}
{
  "data": null,
  "errors": [
    {
      "error": "NOT_FOUND",
      "message": "Folder not found"
    }
  ]
}
```

***

Docs for agents: [llms.txt](https://docs.bland.ai/llms.txt)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.