create_deployment
Create a deployment for a stack in APPLY, PLAN, or DRY_RUN mode. For AWS-hosted stacks, pass a chosen hosting target to set infrastructure ownership; the deployment is prepared but not started.
Instructions
Create a new deployment for a stack. This prepares the deployment but does NOT start it — call start_deployment next. Default type is APPLY (creates real resources). Use PLAN for a dry-run preview.
For an AWS-hosted stack, call list_aws_hosting_targets with the stackId first and pass the selected option's exact value as targetAccountId. That value DECIDES infrastructure ownership: the managed value means Staticbot-managed hosting and a customer account value means customer-managed hosting. Never invent an account id or send infrastructureOwnership.
Do not set cloudflareChoice or cloudflareHostname unless the user has chosen to host a Cloudflare Workers app in their OWN Cloudflare account: call list_cloudflare_hosting_targets, let the user pick, then preflight_cloudflare_hosting, and pass that choice plus the hostname. Omit both to use the stack's existing hosting, which is the normal case — Staticbot hosts it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stackId | Yes | Stack ID to deploy | |
| deploymentType | No | APPLY creates real infrastructure (default). PLAN shows what would change without creating anything. DRY_RUN validates the template. | |
| targetAccountId | No | AWS-hosted stacks only. The exact `value` selected from list_aws_hosting_targets. This value is the ownership choice: the managed value means Staticbot-managed infrastructure; a customer account value means customer-managed infrastructure. Never invent an account id or pass infrastructureOwnership. | |
| cloudflareChoice | No | Optional, Cloudflare Workers apps deployed into the user's own account only. The `value` of a choice from list_cloudflare_hosting_targets. Omit to use the stack's existing hosting (Staticbot's account by default) — that is the normal case. | |
| cloudflareHostname | No | Optional. The hostname the app will serve, e.g. 'example.com' or 'app.example.com'. Required together with a customer cloudflareChoice, and one of the hostnames that account's zones cover. Apex is supported. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes | Parsed JSON response from the Staticbot public API |