---
title: "Create deployment"
method: POST
path: "/preview/v2/deployments"
tags: ["Deployments"]
---

# Create deployment

`POST /preview/v2/deployments`

> ⚠️ This endpoint is in [public preview](/preview/roadmap).

Create a generic deployment that uses capacity already owned in a pool, or a spot deployment that buys capacity for a specific instance SKU at or below a maximum rate.

## Request body

- union
  - object — Maintain the target number of instances using capacity already owned in the selected pool.
    - `name` string
    - `pool` string, required — A resource path like 'sfc:pool:acme:prod:my-pool' _or_ an ID. Resource paths are human-readable but not stable - they change when resources are renamed or moved. IDs are stable and permanent.
    - `instance_sku` union, required — Accepts the canonical prefix below; additional legacy prefixes are aliased for read compatibility. Writes always emit the canonical form.
      - string
      - string — Legacy alias prefix; accepted on read, never emitted on write.
    - `instance_template` string, required — A resource path like 'sfc:instance_template:acme:prod:my-instance_template' _or_ an ID. Resource paths are human-readable but not stable - they change when resources are renamed or moved. IDs are stable and permanent.
    - `target_instance_count` integer, required
    - `instance_name_template` string — A name template using {{variable}} syntax. Available variables: {{adjective}} (~128 random adjectives), {{noun}} (~128 random nouns), {{nanoid(N)}} (N-character alphanumeric identifier, 1 ≤ N ≤ 21). The template must produce enough unique combinations to avoid collisions — equivalent to at least the default template {{adjective}}-{{noun}}-{{nanoid(6)}} (~1 quadrillion possibilities). Must start with an alphanumeric character. Resolved names are limited to 255 characters.
    - `kind` 'generic', required
  - object — Buy capacity for a specific instance SKU at or below the maximum rate, then maintain the target number of instances on that capacity.
    - `name` string
    - `pool` string, required — A resource path like 'sfc:pool:acme:prod:my-pool' _or_ an ID. Resource paths are human-readable but not stable - they change when resources are renamed or moved. IDs are stable and permanent.
    - `instance_sku` union, required — Accepts the canonical prefix below; additional legacy prefixes are aliased for read compatibility. Writes always emit the canonical form.
      - string
      - string — Legacy alias prefix; accepted on read, never emitted on write.
    - `instance_template` string, required — A resource path like 'sfc:instance_template:acme:prod:my-instance_template' _or_ an ID. Resource paths are human-readable but not stable - they change when resources are renamed or moved. IDs are stable and permanent.
    - `target_instance_count` integer, required
    - `max_buy_price_dollars_per_node_hour` string, required — Price in dollars per node-hour, encoded as a decimal string. Prices are rounded to the nearest $0.000060/node-hour market tick. This is one microdollar per node-minute. Responses contain the rounded value with six decimal places. Inputs must contain a decimal point, be non-negative, and not exceed $500/node-hour.
    - `instance_name_template` string — A name template using {{variable}} syntax. Available variables: {{adjective}} (~128 random adjectives), {{noun}} (~128 random nouns), {{nanoid(N)}} (N-character alphanumeric identifier, 1 ≤ N ≤ 21). The template must produce enough unique combinations to avoid collisions — equivalent to at least the default template {{adjective}}-{{noun}}-{{nanoid(6)}} (~1 quadrillion possibilities). Must start with an alphanumeric character. Resolved names are limited to 255 characters.
    - `kind` 'spot', required

## Response `201`

Deployment created.

- union
  - DeploymentResponse
    - `id` string, required
    - `resource_path` string, required — A resource path for a deployment resource. Format: sfc:deployment:<account>:<workspace>:<name>.
    - `owner` string, required
    - `workspace` string, required
    - `workspace_id` string, required
    - `name` string, required
    - `object` 'deployment', required
    - `capacity` CapacitySummary, required
      - `id` union, required — Accepts the canonical prefix below; additional legacy prefixes are aliased for read compatibility. Writes always emit the canonical form.
        - string
        - string — Legacy alias prefix; accepted on read, never emitted on write.
      - `name` string, required
    - `pool` PoolSummary, required — A pool referenced by id and name.
      - `id` string, required
      - `name` string, required
    - `instance_sku` InstanceSkuSummary, required — A summary of an instance SKU - its `id` and human-recognizable `alias` - embedded on resources that reference a SKU.
      - `object` 'instance_sku', required
      - `id` union, required — Accepts the canonical prefix below; additional legacy prefixes are aliased for read compatibility. Writes always emit the canonical form.
        - string
        - string — Legacy alias prefix; accepted on read, never emitted on write.
      - `alias` string, required
    - `instance_template` InstanceTemplateSummary, required
      - `id` union, required — Accepts the canonical prefix below; additional legacy prefixes are aliased for read compatibility. Writes always emit the canonical form.
        - string
        - string — Legacy alias prefix; accepted on read, never emitted on write.
      - `name` string, required
    - `enabled` boolean, required
    - `target_instance_count` integer, required
    - `instance_name_template` string, required — A name template using {{variable}} syntax. Available variables: {{adjective}} (~128 random adjectives), {{noun}} (~128 random nouns), {{nanoid(N)}} (N-character alphanumeric identifier, 1 ≤ N ≤ 21). The template must produce enough unique combinations to avoid collisions — equivalent to at least the default template {{adjective}}-{{noun}}-{{nanoid(6)}} (~1 quadrillion possibilities). Must start with an alphanumeric character. Resolved names are limited to 255 characters.
    - `status` ReconciliationStatus, required
      - `state` 'info' | 'warning' | 'error', required
      - `message` string, required
    - `created_at` integer, required — Unix timestamp.
    - `updated_at` integer, required — Unix timestamp.
  - SpotDeploymentResponse — A spot deployment buys compute up to a maximum price and runs instances on the secured pool.
    - `id` string, required
    - `resource_path` string, required — A resource path for a spot_deployment resource. Format: sfc:spot_deployment:<account>:<workspace>:<name>.
    - `owner` string, required
    - `workspace` string, required
    - `workspace_id` string, required
    - `name` string, required
    - `object` 'spot_deployment', required
    - `pool` PoolSummary, required — A pool referenced by id and name.
      - `id` string, required
      - `name` string, required
    - `instance_template` InstanceTemplateSummary, required
      - `id` union, required — Accepts the canonical prefix below; additional legacy prefixes are aliased for read compatibility. Writes always emit the canonical form.
        - string
        - string — Legacy alias prefix; accepted on read, never emitted on write.
      - `name` string, required
    - `instance_sku` InstanceSkuSummary, required — A summary of an instance SKU - its `id` and human-recognizable `alias` - embedded on resources that reference a SKU.
      - `object` 'instance_sku', required
      - `id` union, required — Accepts the canonical prefix below; additional legacy prefixes are aliased for read compatibility. Writes always emit the canonical form.
        - string
        - string — Legacy alias prefix; accepted on read, never emitted on write.
      - `alias` string, required
    - `enabled` boolean, required
    - `target_instance_count` integer, required
    - `max_buy_price_dollars_per_node_hour` string, required — Price in dollars per node-hour, encoded as a decimal string. Prices are rounded to the nearest $0.000060/node-hour market tick. This is one microdollar per node-minute. Responses contain the rounded value with six decimal places. Inputs must contain a decimal point, be non-negative, and not exceed $500/node-hour.
    - `instance_name_template` string, required — A name template using {{variable}} syntax. Available variables: {{adjective}} (~128 random adjectives), {{noun}} (~128 random nouns), {{nanoid(N)}} (N-character alphanumeric identifier, 1 ≤ N ≤ 21). The template must produce enough unique combinations to avoid collisions — equivalent to at least the default template {{adjective}}-{{noun}}-{{nanoid(6)}} (~1 quadrillion possibilities). Must start with an alphanumeric character. Resolved names are limited to 255 characters.
    - `status` ReconciliationStatus, required
      - `state` 'info' | 'warning' | 'error', required
      - `message` string, required
    - `created_at` integer, required — Unix timestamp.
    - `updated_at` integer, required — Unix timestamp.

## Other responses

- `400` — Invalid request.
- `401` — Unauthorized.
- `403` — Forbidden.
- `409` — Pool and instance SKU already have an incompatible automation.
- `422` — Validation failed.
- `500` — Internal server error.

---

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