---
title: "Save final project deployment configuration for review"
method: POST
path: "/platform/deployments/custom/plans/{plan_id}/prepare-deployment"
tags: ["Platform"]
---

# Save final project deployment configuration for review

`POST /platform/deployments/custom/plans/{plan_id}/prepare-deployment`

## Request

- Base URL: `https://api.imprezahost.com/v1`
- URL: `https://api.imprezahost.com/v1/platform/deployments/custom/plans/{plan_id}/prepare-deployment`
- Auth: API key in header `X-API-Key` and API key in header `X-API-Secret`

Deploy scope. Freezes effective configuration and generated recipe; encrypts environment values and returns names only. Review configuration_digest before applying. No resource reservation; expires no later than source plan / 24 hours. At most 20 pending records.

## Path parameters

- `plan_id` string, required

## Request body

- object
  - `option_index` integer, required
  - `build_secrets` object: Build-only credentials for Dockerfile or npm recipes; encrypted in the prepared configuration, with names only in summaries. Requires agent 0.6.11+ advertising build-secrets-v1. Total UTF-8 values are limited to 256 KiB. Secret builds bypass cached layers.
  - `name` string, required: Per-account-unique deploy name (3-100 chars, [a-z0-9_-]).
  - `agent_id` string, required: Target VPS agent_id (from impreza_list_servers).
  - `domain` string: Hostname to use, or omit to propose a managed subdomain. No DNS record is created until apply. Omit with onion=true for onion-only.
  - `vars` object: Runtime environment values, encrypted in the prepared record. Do not use reserved system/routing names. Summaries show names only.
  - `cpus` number: CPU limit; effective default is captured for review.
  - `memory_mb` integer: Memory limit in MiB; effective default is captured for review.
  - `target_port` integer: Optional container port; defaults to the selected recipe.
  - `volumes` string[]: Absolute container paths to persist as named Docker volumes (data survives redeploys), e.g. ["/var/lib/app/data","/app/uploads"]. Ignored for mode=manifest (declare volumes in your compose).
  - `onion` boolean: Also publish a Tor v3 hidden service. Default false.
  - `healthcheck_path` string: node_npm, python_pip or php_composer only. Optional HTTP path such as /health (200 ASCII characters max). Checks 127.0.0.1 on target_port and requires 2xx without redirects. Omit for /: Python/PHP require 2xx; legacy Node accepts status below 500. Saved at creation; previews and redeploys retain it. A failed replacement recovers a verified healthy previous release; first installs keep the agent startup warning policy.
  - `tor_egress` boolean: Opt-in custom image/source runtime through Tor SOCKS5h. Requires agent 0.6.20+, local MCP 0.42.0+, tor-egress-v1 and Docker 28+. The application must use the Tor SOCKS5h proxy; existing servers require an explicit agent update. No direct fallback; builds/source retrieval are not anonymized. Imported manifests, catalog installs and external service bindings are unsupported.
  - `require_healthy_start` boolean: node_npm, python_pip or php_composer only. Require an explicit healthcheck_path to become healthy before deployment succeeds, including the first install. Requires agent 0.6.3+. Failed first installs remove containers and preserve volumes; eligible previous releases recover. Omit or false keeps legacy behavior. Saved at creation and inherited by previews/redeploys.
  - `startup_timeout_seconds` integer: Required healthy start only: startup observation budget in seconds, default 60. Separate from source/build and recovery time.

## Response `201`

Prepared configuration saved without creating an app, job or DNS record.

## Other responses

- `400`: Invalid configuration.
- `404`: Owned plan or target not found.
- `409`: Source, target or plan preconditions changed.
- `429`: Pending prepared-deployment quota reached.

---

[API](https://skmtc.dev/imprezahost/apis/impreza-host-public-api.md) · [All operations](https://skmtc.dev/imprezahost/apis/impreza-host-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/imprezahost/apis/impreza-host-public-api/revisions/db86511f604f?raw)
