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

# Transform Folder into Stack

> Turns the applications and databases of a folder into a stack, optionally injecting the connection variables.

Creates a stack from every application and database in a folder. The folder stays. With `inject_variables: true` the platform adds the connection variables and the certificates to the applications; with `false` the applications are assumed to connect on their own. Needs the `stacks:write` scope when called with an API key.

**folder\_id** `string` *required*

The folder to take the resources from.

**workspace\_id** `string`

The workspace of the folder. Absent means your own folder.

**name** `string`

The stack name. Optional.

**inject\_variables** `boolean` *required*

Whether the platform creates the connections and injects the variables and certificates.

**bindings** `object[]`

Connections to create when `inject_variables` is `true`. Each item has `app_id`, `database_id` and an optional `env_map` (see [Create Connection](https://docs.vertracloud.app/api-reference/endpoint/stacks/bindings/create.md)).

### Response

`201` with the stack, the same as [Create Stack](https://docs.vertracloud.app/api-reference/endpoint/stacks/create.md), including `restart_required` and `apps_to_restart`.

### Errors

| Status | Code | When |
| - | - | - |
| 400 | `STACK_TRANSFORM_EMPTY` | The folder has no application, or no database, to put in a stack. |
| 409 | `STACK_MEMBER_CONFLICT` | A resource of the folder is already in another stack. |
| 403 | `WORKSPACE_OWNER_ONLY` | You are a workspace member, not the owner. |


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