---
title: "Plan a deployment"
method: POST
path: "/v1/projects/{project_id}/deployments:plan"
---

# Plan a deployment

`POST /v1/projects/{project_id}/deployments:plan`

## Request

- Base URL: `https://app.ohmyho.st`
- URL: `https://app.ohmyho.st/v1/projects/{project_id}/deployments:plan`
- Auth: HTTP bearer

Resolves immutable inputs and estimates effects without provider mutation or billable work. The plan targets Dev unless `environment` is `prod`; a Prod plan builds straight into Prod, except that a project with shared data and a database only reaches Prod through promotion. Managed mail requires a confirmed Paid service period; it is checked again before build reservation. Selecting the managed Better Auth bridge does not require managed mail or Paid access. An old sender configuration is not Paid authority. A commit the platform does not admit answers 409 with a nonretryable problem code; for framework_conversion_required, detail is a fixed catalog sentence that names the file, the rule and the required change whenever the refusal is typed.

## Path parameters

- `project_id` string, required

## Headers

- `X-Request-Id` string

## Request body

- PlanDeploymentRequest
  - `commit_sha` string, required: Exact full Git commit object identifier; abbreviated or branch references are forbidden.
  - `environment` 'dev' | 'prod': The environment the deployment builds into. Prod skips Dev and switches Prod traffic once activated.

## Response `200`

A deployment plan valid for 24 hours.

- DeploymentPlan: Immutable pre-build deployment plan. It expires exactly 24 hours after creation.
  - `id` string, required
  - `project_id` string, required
  - `environment` 'dev' | 'prod', required: The environment this plan builds into.
  - `commit_sha` string, required: Exact full Git commit object identifier; abbreviated or branch references are forbidden.
  - `source_digest` string, required
  - `build_plan_digest` string, required
  - `application_root` string, required: Canonical repository-relative application root selected from immutable source evidence.
  - `artifact_digest` string
  - `runtime` 'cloudflare_workers_static_assets' | 'cloudflare_workers_edge_ssr', required
  - `route` string, uri, required: Server-derived project-isolated public deployment URL; clients cannot select its gateway host or target Worker.
  - `resource_effects` string[], required
  - `limits` string[], required
  - `estimated_cost` CostEstimate, required: Build-compute reservation quote, not the lifetime cost of the application. credits is the reserved amount in credits as a decimal (credit_micros divided by one million), the figure to show people. amount_micros is the customer USD equivalent of credit_micros; provider_cost_micros is the corresponding published provider-list basis. The versioned price is fixed by this immutable deployment plan. reserved_seconds is the reserved build time in seconds. The measured build seconds settle the reservation and unused credits are released. Storage, mail and runtime costs are separate.
    - `amount_micros` string, required
    - `currency` string, required
    - `rate_card_version` string, required
    - `credit_micros` string, required
    - `credits` string, required
    - `provider_cost_micros` string, required
    - `scope` 'build_compute', required
    - `reserved_seconds` string, required
  - `risks` string[], required
  - `destructive_effects` string[], required
  - `required_confirmations` string[], required
  - `created_at` string, date-time, required
  - `expires_at` string, date-time, required

## Other responses

- `400`: The request failed.
- `401`: The request failed.
- `402`: The request failed.
- `403`: The request failed.
- `404`: The resource does not exist or is not visible to the authenticated principal.
- `409`: The request failed.
- `429`: The request failed.
- `503`: The request failed.

---

[API](https://skmtc.dev/ohmyho/apis/ohmyho-st-api.md) · [All operations](https://skmtc.dev/ohmyho/apis/ohmyho-st-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ohmyho/apis/ohmyho-st-api/revisions/d069888c0017?raw)
