> ## 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.

# Add Blob Folder to Stack

> Adds a folder of your Blob Storage to a stack, with a managed key restricted to it and variables injected into your applications.

Adds a folder of your [Blob Storage](https://docs.vertracloud.app/blob/overview.md) to the stack. The platform creates an API key **restricted to that folder**, keeps it in the stack, and injects the S3 connection variables into the applications you choose. The key is managed by the platform: it never shows its secret, and it is revoked when the Blob folder leaves the stack or the stack is dissolved or deleted. The files are kept unless you ask to delete them (see [Remove Stack Member](https://docs.vertracloud.app/api-reference/endpoint/stacks/members/remove.md) and [Delete Stack](https://docs.vertracloud.app/api-reference/endpoint/stacks/delete.md)).

The plan must include Blob Storage. Needs the `stacks:write` and `blob:write` scopes when called with an API key.

**stack\_id** `string` *required*

The stack ID.

**workspace\_id** `string`

The workspace the stack belongs to, when you act on it as the workspace owner.

**prefix** `string`

The folder of the Blob, ending in `/`. Without it, the platform picks a folder named after the stack, under `stacks/`. A folder with files of yours, or one already used by a stack, cannot be chosen.

**visibility** `string` (default: private)

`private` or `public`.

**bindings** `object[]`

The applications to connect it to. Each item has `app_id` and an optional `env_map` (see [Create Stack Connection](https://docs.vertracloud.app/api-reference/endpoint/stacks/bindings/create.md)).

### Response

**response** `object`

`201`.

**Toggle object**

**stack** `object`

The stack, as in [Get Stack](https://docs.vertracloud.app/api-reference/endpoint/stacks/get.md).

**blob** `object`

The new member, with `blob.prefix`, `blob.visibility`, `blob.used_bytes` and `blob.api_key_id`.

**restart\_required** `boolean`

`true` when an application must restart to read the new variables.

**apps\_to\_restart** `string[]`

The applications that need a restart.

### Errors

| Status | Code | When |
| - | - | - |
| 409 | `STACK_BLOB_PREFIX_TAKEN` | The folder is already used by a Blob folder of a stack, or has files. |
| 400 | `VALIDATION_ERROR` | The prefix is not valid. |
| 403 | `BLOB_NAMESPACE_SUSPENDED` | Blob Storage is suspended for the account. |
| 403 | `PLAN_RESTRICTED_FEATURE` | The plan does not include Blob Storage. |
| 403 | `WORKSPACE_OWNER_ONLY` | You are a workspace member, not the owner. |
| 404 | `STACK_NOT_FOUND` | The stack does not exist or belongs to another account. |


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