---
title: "Deploy stack"
method: POST
path: "/api/stacks/{stackName}/deploy"
tags: ["Stacks"]
---

# Deploy stack

`POST /api/stacks/{stackName}/deploy`

Runs `docker compose up -d` for the stack using atomic deployment
with automatic rollback on failure. Requires `stack:deploy` permission.

## Path parameters

- `stackName` string, required

## Headers

- `x-node-id` integer

## Response `200`

Stack deployed successfully.

- object
  - `message` string, required
  - `healthGateId` string, nullable — Id of the post-deploy health gate observation started for this deploy, for use with the health-gate endpoint. Null when the health gate is disabled on the node.

## Other responses

- `403` — Insufficient permissions or license tier.
- `409` — Deploy blocked before Compose ran. Common codes include a stack operation already in progress, a scan-policy block, or missing external networks (`code: missing_external_networks`).
- `500` — Deployment failed.
- `503` — Deploy blocked because Sencho could not render the Compose model or read Docker networking state to verify required external networks.

## Changes

- **2026-07-17** `40ec058393a3` — 2 info
  - added the non-success response with the status `409`
  - added the non-success response with the status `503`
- **2026-06-11** `0c52a6705499` — 2 info
  - added the optional property `failure` to the response with the `500` status
  - added the optional property `healthGateId` to the response with the `200` status
- **2026-06-04** `d58cf9d6195b` — 1 info
  - removed the `ADMIRAL_REQUIRED` enum value from the `code` response property for the response status `403`
- **2026-04-05** `7464894ea582` — 1 warning, 1 info
  - added the new `PAID_REQUIRED` enum value to the `code` response property for the response status `403`
  - removed the `PRO_REQUIRED` enum value from the `code` response property for the response status `403`
- **2026-04-01** `c62bbceae824` — 1 breaking
  - added the pattern `^[a-zA-Z0-9_-]+$` to the `path` request parameter `stackName`

[Change history](https://skmtc.dev/studio-saelix/apis/sencho-api/changes/api/stacks/:stackName/deploy/post.md)

---

[API](https://skmtc.dev/studio-saelix/apis/sencho-api.md) · [All operations](https://skmtc.dev/studio-saelix/apis/sencho-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/studio-saelix/sencho-api/revisions/bebbb1754cdc/schema)
