---
id: deployment-create
title: "Create a deployment"
description: "Create a new deployment in an existing scope"
sidebar_label: "Create a deployment"
hide_title: true
hide_table_of_contents: true
api: eJzdWW1z27gR/isYfEpmaFvyW3uc8Qef42vdaR2Po9xLHQ9nRa4kXECAAUDZiob/vbMAKYGSEivX3rXTLxJfAOyD3WdfsFzyAm1uROWEVjzlVwbBIQOm8IkVWEm9KFE5JhQDxfBZWCfUlNlcV8gTris0QFNvCp7y9fg09+vwhDuYWp4+8Derd/wx4QY/1Wjd97pY8HTJc60cvUmXHKpKityvefSrJUxLbvMZlkBXblEhT7ke/4q54wmvDCFwAm0YpyvMRBGNFMrhFA1PNvY5miG7ecP0hLkZhu2wpxka9PfRxp+ElGyMLGyoOOQJx2coK4k8HR6fnDa0GYlgf5PgdioDa3UuSAB7Em62AaIn9Oz8T39umqBCYbAg5a423gPzuCn7PmidjXWxYBNtwqbInlv2JhRkc2YrzMVE5EFHhMQJRzgiawfS8KYhXBbz2gi34OnDko8RDJrL2s14+vDYeMvbSisbDHY8GNLftoZWvGJPYJmt8xytndSS5P+HyLK3tWolPtXeaKSyr1hmSLv/HSg4RqnV1P6PUC/h1oGrbSTQOiPUlEaquiQ+drzKoKqMnoMks20+ywpUAovoFU/4Ewg/aKJNJpR1oHK0ROtaqTBiIhRI8bl3E1ahsVKGF+2NfzEBES6M9q+zMeQf21ssursCJbYg/CXucCDSYF4bQ1YJWui0+QWNrXCv1JYJlYXouUN/29K+JKVzUOHs2jPXYi+vRjc/XgepBhxOF/uJiwR0E9kYKULUtg1+rYmFEk54w45ljdnUICpS2BpD9DzCkRXgdnrnRh7SaiKmdRsEaM4O71thPNxOBU/C5TMsMmdgMhH5Hu5x1Rq2QpOjcjBFr/Ywn2nlhVOYnKOxhOrV4GA4GLzuaf5k0Ph1KTJnvwHECMwU3UpqhKXbfoSg75wkGUpdK7f2nMzpjFxqD8n3bT5hqi7HaGjvq2XYGCfaIKuMzhEL4oPTLZpnMgNWfSxNwmcI0s0WkRfvb4Kcdk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BIk1V1YMK9d5UAoLFaUjhncNMFDznZ5yLug/k0PEaHI9X0kxYS1NXbHpcu7G2ZFgf9nrmFjRbRkOCPXOBsc08/J642j2X/NK2izRoHMwqAsqOwP84+bVjxrqXNNY4Kn0BORU00FcxCSVt1ymJ3Tf1fXuVSsVvhcYU7pJWxJ577nUxyyu9Ayc2bBYApCMQkOTec1HpebaWqFV9r6oh6o88mPogxEHVLajPUVVW2onpo5V9n06AgqcahqKSsJjjz2MNclp65p11R9R04SuB23VldaoIV8WqdhFBT9IGrS+IsfutPX334a+YKAnO9+3Yu/7vQQ99Kp1djvNLZ9QKEmmoa23Qie8uHh4HAQJd51WWjJaqSUEry3U70Sf27oKahnwujrwLd+nWiV4vDZHVUShG9EeY0vW8s8xLXBY8JnZLb0gS+XY7D43simocefajTU0H5M+ByMIK76frbvchRovCk/4iI0rgjswWjhIcxB1r5m3Ix4TdLNuMxzrNxXxz5GzLp7+25EBm0/nZShrjbwRJESnnjK/XcZmu154p8tuQQ1rUOxHtYk80OfPRts8bvqTspqESFcLsOIEZV0TcOTdiuhxGsem6b5Fzy5LSo=
sidebar_class_name: "post api-method"
info_path: docs/api/deployments
custom_edit_url: null
---

import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
import ParamsDetails from "@theme/ParamsDetails";
import RequestSchema from "@theme/RequestSchema";
import StatusCodes from "@theme/StatusCodes";
import OperationTabs from "@theme/OperationTabs";
import TabItem from "@theme/TabItem";
import Heading from "@theme/Heading";

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Create a deployment"}
>
</Heading>

<MethodEndpoint
  method={"post"}
  path={"/deployment"}
  context={"endpoint"}
>
  
</MethodEndpoint>



Create a new deployment in an existing scope

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
  children={"Request"}
>
</Heading>

<ParamsDetails
  parameters={undefined}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={{"content":{"application/json":{"schema":{"type":"object","properties":{"scope_id":{"type":"integer","description":"The ID of the scope where the deployment will be created.","example":1234},"release_id":{"type":"integer","description":"The ID of the release associated with the deployment.","example":5678}},"required":["scope_id","release_id"],"description":"Request body for creating a new deployment within a specific scope.","title":"deploymentCreate"}}}}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"201":{"description":"The operation was successful.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","description":"The unique ID for the deployment.","example":1},"scope_id":{"type":"integer","description":"The ID of the scope where the deployment belongs.","example":1234},"release_id":{"type":"integer","description":"The ID of the release associated with the deployment.","example":5678},"status":{"type":"string","enum":["creating_approval","creating_approval_denied","creating","waiting_for_instances","running","finalizing","finalized","cancelling","cancelled","failed","rolling_back","rolled_back","deleting","deleted"],"description":"The current status of the deployment.","example":"running"},"status_in_scope":{"type":"string","description":"The status of the deployment within its scope.","example":"ACTIVE"},"strategy":{"type":"string","description":"The deployment strategy being used.","enum":["initial","blue_green"],"example":"blue_green"},"strategy_data":{"type":"object","description":"Configuration data for the deployment strategy.","properties":{"switched_traffic":{"type":"integer","description":"Current percentage of traffic on the new version (0-100).","example":30},"desired_switched_traffic":{"type":"integer","description":"Target traffic percentage for the new version.","example":50},"amount_instances_to_wait":{"type":"integer","description":"Required number of instances before proceeding to the next step.","example":5},"healthy_instances":{"type":"integer","description":"Current count of healthy instances.","example":3},"launched_instances":{"type":"integer","description":"Total number of instances launched.","example":5},"switch_traffic_step":{"type":"boolean","description":"Indicates whether the deployment is in the active traffic switching phase.","example":true}}},"created_at":{"type":"string","format":"date-time","description":"The timestamp when the deployment was created.","example":"2023-10-01T12:34:56Z"},"updated_at":{"type":"string","format":"date-time","description":"The timestamp when the deployment was last updated.","example":"2023-10-01T12:34:56Z"},"messages":{"type":"array","description":"A list of messages associated with the deployment (e.g., logs, errors, or status updates).","items":{"type":"object","properties":{"level":{"type":"string","description":"The severity level of the message (e.g., INFO, WARNING, ERROR).","example":"INFO"},"message":{"type":"string","description":"The content of the message.","example":"Deployment started successfully"},"code":{"type":"string","description":"A unique code identifying the type of message.","example":"DEPLOYMENT_STARTED"},"timestamp":{"type":"integer","description":"The Unix timestamp when the message was generated.","example":1696166096}},"required":["level","message","timestamp"],"description":"Represents a message associated with a deployment, such as logs or status updates.","title":"deployment_message"},"example":[{"level":"INFO","message":"Deployment started successfully","code":"DEPLOYMENT_STARTED","timestamp":1696166096}]},"deployment_token":{"type":"string","description":"A unique token associated with the deployment for authentication or tracking purposes.","example":"abc123xyz"},"nrn":{"type":"string","description":"The resource name (NRN) uniquely identifying the deployment.","example":"organization=1:account=2:namespace=4:application=4:scope=5"}},"required":["id","scope_id","release_id","status","strategy","strategy_data","created_at","updated_at","messages","deployment_token","nrn"],"description":"Represents a deployment object with all its associated metadata and configuration.","title":"deployment"}}}},"4XX":{"description":"Client error responses due to invalid input or missing parameters.","content":{"application/json":{"schema":{"type":"object","required":["statusCode","error","message"],"properties":{"statusCode":{"type":"integer","description":"HTTP status code representing the specific client error (e.g., 400, 401, 403, 404).","example":400},"code":{"type":"string","description":"A machine-readable error code that categorizes the server failure.","example":"bad_request"},"error":{"type":"string","description":"A brief, human-readable description of the error type (e.g., \"Bad Request\", \"Unauthorized\").","example":"Bad Request"},"message":{"type":"string","description":"Additional details about the error.","example":"The request was malformed or contained invalid parameters."}}}}}},"5XX":{"description":"Server error responses indicating an issue on the API side.","content":{"application/json":{"schema":{"type":"object","required":["statusCode","error","message"],"properties":{"statusCode":{"type":"integer","description":"HTTP status code representing the specific server error (e.g., 500, 502, 503).","example":500},"code":{"type":"string","description":"A machine-readable error code that categorizes the server failure.","example":"internal_server_error"},"error":{"type":"string","description":"A brief, human-readable description of the error type (e.g., \"Internal Server Error\", \"Service Unavailable\").","example":"Internal Server Error"},"message":{"type":"string","description":"Additional details about the error.","example":"An unexpected error occurred. Please try again later."}}}}}}}}
>
  
</StatusCodes>


      