Create a deployment
POST /api/v1/projects/{projectId}/environments/{environmentId}/deployments
Validates the Release's artifacts, then atomically claims the Idempotency-Key and queues the Deployment for asynchronous execution. A replay with the same key and payload returns the original Deployment regardless of later activations. 404: missing Project, Environment, Release, or configuration pins. 409: expected-active-deployment-mismatch, idempotency_key_reused, or an invalid Release snapshot. 422: artifact diagnostics. 503: the execution could not be queued (Retry-After).
Parameters
path
| Name | Type | Required | Description |
|---|---|---|---|
projectId | string | required | Identifies the Project that owns the addressed resource. Applies to Create a deployment. |
environmentId | string | required | Identifies the Project environment addressed by the operation. Applies to Create a deployment. |
header
| Name | Type | Required | Description |
|---|---|---|---|
Idempotency-Key | string | required |
Request body
Required — Submit an existing Release and explicit Environment configuration revision for asynchronous Deployment execution. Promotion and rollback are new Deployments of an existing Release; expectedActiveDeploymentId optionally guards them against a concurrent activation change.
application/json
| Name | Type | Required | Description |
|---|---|---|---|
releaseId | string | required | Immutable Release whose exact Agent and Definition revision pins will be deployed. |
configurationRevisionId | string | required | Existing immutable configuration revision head for this Project Environment. |
expectedActiveDeploymentId | string | optional | Compare-and-set guard: the ready Deployment the Environment must currently activate. |
Responses
| Status | Description | Body |
|---|---|---|
201 | Response for status 201 | application/json — object — type: "deployment" (required); id: string (required); projectId: string (required); environmentId: string (required); releaseId: string | null (required); configurationRevisionId: string (required); status: "queued" | "validating" | "provisioning" | "materializing" | "ready" | "failed" | "canceled" (required); diagnostics: object | null (required); createdAt: string (required); updatedAt: string (required) |
400 | The request is malformed or cannot be processed. | application/json — PublicApiError — error: object (required) |
401 | Authentication failed. The Authorization header is missing, or the credential is invalid or expired. | application/json — PublicApiError — error: object (required) |
403 | Access denied. The authenticated user does not have permission to perform this action. | application/json — PublicApiError — error: object (required) |
404 | Resource not found. | application/json — PublicApiError — error: object (required) |
409 | Request conflicts with current state of the resource, including safe deployment conflict classifications. | application/json — PublicApiError — error: object (required) |
422 | Request validation failed. Check the request body, query parameters, or path parameters. | application/json — PublicApiError — error: object (required) |
429 | Too many requests. | application/json — PublicApiError — error: object (required) |
500 | The server could not complete the request. | application/json — PublicApiError — error: object (required) |
503 | Service temporarily unavailable (e.g. execution capacity exhausted). The response carries a Retry-After header; retry with backoff. | application/json — PublicApiError — error: object (required) |