---
title: "Create a deployment"
method: POST
path: "/deployment"
tags: ["Deployment"]
---

# Create a deployment

`POST /deployment`

Create a new deployment in an existing scope

## Request body

- DeploymentCreate — Request body for creating a new deployment within a specific scope.
  - `scope_id` integer, required — The ID of the scope where the deployment will be created.
  - `release_id` integer, required — The ID of the release associated with the deployment.

## Response `201`

The operation was successful.

- Deployment — Represents a deployment object with all its associated metadata and configuration.
  - `id` integer, required — The unique ID for the deployment.
  - `scope_id` integer, required — The ID of the scope where the deployment belongs.
  - `release_id` integer, required — The ID of the release associated with the deployment.
  - `status` 'creating_approval' | 'creating_approval_denied' | 'creating' | 'waiting_for_instances' | 'running' | 'finalizing' | 'finalized' | 'cancelling' | 'cancelled' | 'failed' | 'rolling_back' | 'rolled_back' | 'deleting' | 'deleted', required — The current status of the deployment.
  - `status_in_scope` string — The status of the deployment within its scope.
  - `strategy` 'initial' | 'blue_green', required — The deployment strategy being used.
  - `strategy_data` object, required — Configuration data for the deployment strategy.
    - `switched_traffic` integer — Current percentage of traffic on the new version (0-100).
    - `desired_switched_traffic` integer — Target traffic percentage for the new version.
    - `amount_instances_to_wait` integer — Required number of instances before proceeding to the next step.
    - `healthy_instances` integer — Current count of healthy instances.
    - `launched_instances` integer — Total number of instances launched.
    - `switch_traffic_step` boolean — Indicates whether the deployment is in the active traffic switching phase.
  - `created_at` string, date-time, required — The timestamp when the deployment was created.
  - `updated_at` string, date-time, required — The timestamp when the deployment was last updated.
  - `messages` DeploymentMessage[], required — A list of messages associated with the deployment (e.g., logs, errors, or status updates).
    - `level` string, required — The severity level of the message (e.g., INFO, WARNING, ERROR).
    - `message` string, required — The content of the message.
    - `code` string — A unique code identifying the type of message.
    - `timestamp` integer, required — The Unix timestamp when the message was generated.
  - `deployment_token` string, required — A unique token associated with the deployment for authentication or tracking purposes.
  - `nrn` string, required — The resource name (NRN) uniquely identifying the deployment.

## Other responses

- `4XX` — Client error responses due to invalid input or missing parameters.
- `5XX` — Server error responses indicating an issue on the API side.

---

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