> ## 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 Stack Member

> Puts an application or database you already have into a stack, with optional connections.

Adds an application or a database to the stack. It must belong to the same account or workspace as the stack and not be in another stack. Needs the `stacks:write` scope 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.

**resource\_type** `string` *required*

`application` or `database`.

**resource\_id** `string` *required*

The application or database ID.

**bindings** `object[]`

Connections to create between the new member and the applications of the stack. May be empty. Each item has `app_id`, exactly one of `database_id` or `target_app_id`, and an optional `env_map` (see [Create Connection](https://docs.vertracloud.app/api-reference/endpoint/stacks/bindings/create.md)).

### Response

The updated stack with `restart_required` and `apps_to_restart`, as in [Create Stack](https://docs.vertracloud.app/api-reference/endpoint/stacks/create.md). Restart the listed applications to make them read the new variables.

### Errors

| Status | Code | When |
| - | - | - |
| 409 | `STACK_MEMBER_CONFLICT` | The resource is already in another stack, or is not in the same account or workspace. |
| 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. |
| 404 | `APP_NOT_FOUND` | The application does not exist or is not yours. |
| 404 | `DATABASE_NOT_FOUND` | The database does not exist or is not yours. |


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