{
  "schemaVersion": 1,
  "operation": {
    "operationId": "createRelease",
    "method": "POST",
    "path": "/api/v1/projects/{project}/releases",
    "summary": "Create a draft project release",
    "description": "",
    "tags": [
      "Releases"
    ],
    "effect": "write",
    "confirmation": "conditional",
    "authorization": {
      "mode": "privilege",
      "privilege": "DEPLOY"
    },
    "parameters": [
      {
        "name": "project",
        "in": "path",
        "required": true,
        "description": "",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "Idempotency-Key",
        "in": "header",
        "required": true,
        "description": "",
        "schema": {
          "maxLength": 200,
          "minLength": 1,
          "type": "string"
        }
      }
    ],
    "requestBody": {
      "required": true,
      "description": "",
      "content": [
        {
          "contentType": "application/json",
          "schema": {
            "$ref": "#/components/schemas/ReleaseCreateRequest"
          }
        }
      ]
    },
    "responses": [
      {
        "status": "201",
        "description": "The request has succeeded and a new resource has been created as a result.",
        "content": [
          {
            "contentType": "application/json",
            "schema": {
              "$ref": "#/components/schemas/ReleaseResponse"
            }
          }
        ]
      },
      {
        "status": "400",
        "description": "The server could not understand the request due to invalid syntax.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "401",
        "description": "Access is unauthorized.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "403",
        "description": "Access is forbidden.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "404",
        "description": "The server cannot find the requested resource.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "409",
        "description": "The request conflicts with the current state of the server.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "412",
        "description": "Precondition failed.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "413",
        "description": "Client error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "415",
        "description": "Client error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "422",
        "description": "Client error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "429",
        "description": "Client error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "500",
        "description": "Server error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "502",
        "description": "Server error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "503",
        "description": "Service unavailable.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      }
    ]
  },
  "schemas": {
    "ProblemDetails": {
      "example": {
        "code": "example",
        "detail": "example",
        "errors": [
          {
            "code": "example",
            "detail": "example",
            "field": "example"
          }
        ],
        "instance": "example",
        "requestId": "example",
        "status": 1,
        "title": "example",
        "type": "example"
      },
      "properties": {
        "code": {
          "example": "example",
          "type": "string"
        },
        "detail": {
          "example": "example",
          "type": "string"
        },
        "errors": {
          "example": [
            {
              "code": "example",
              "detail": "example",
              "field": "example"
            }
          ],
          "items": {
            "$ref": "#/components/schemas/ProblemFieldError"
          },
          "type": "array"
        },
        "instance": {
          "example": "example",
          "type": "string"
        },
        "requestId": {
          "example": "example",
          "type": "string"
        },
        "status": {
          "example": 1,
          "format": "int32",
          "type": "integer"
        },
        "title": {
          "example": "example",
          "type": "string"
        },
        "type": {
          "example": "example",
          "type": "string"
        }
      },
      "required": [
        "type",
        "title",
        "status",
        "detail",
        "instance",
        "code",
        "requestId",
        "errors"
      ],
      "type": "object"
    },
    "ProblemFieldError": {
      "example": {
        "code": "example",
        "detail": "example",
        "field": "example"
      },
      "properties": {
        "code": {
          "example": "example",
          "type": "string"
        },
        "detail": {
          "example": "example",
          "type": "string"
        },
        "field": {
          "example": "example",
          "type": "string"
        }
      },
      "required": [
        "field",
        "code",
        "detail"
      ],
      "type": "object"
    },
    "ReleaseConnectionPin": {
      "example": {
        "connection": "example",
        "revisionId": "example"
      },
      "properties": {
        "connection": {
          "example": "example",
          "type": "string"
        },
        "revisionId": {
          "example": "example",
          "type": "string"
        }
      },
      "required": [
        "connection",
        "revisionId"
      ],
      "type": "object"
    },
    "ReleaseCreateRequest": {
      "example": {
        "connections": [
          {
            "connection": "example",
            "revisionId": "example"
          }
        ],
        "projectDigest": "example",
        "workspaces": [
          {
            "artifactDigest": "example",
            "servingStateId": "example",
            "workspace": "example"
          }
        ]
      },
      "properties": {
        "connections": {
          "example": [
            {
              "connection": "example",
              "revisionId": "example"
            }
          ],
          "items": {
            "$ref": "#/components/schemas/ReleaseConnectionPin"
          },
          "type": "array"
        },
        "projectDigest": {
          "example": "example",
          "type": "string"
        },
        "workspaces": {
          "example": [
            {
              "artifactDigest": "example",
              "servingStateId": "example",
              "workspace": "example"
            }
          ],
          "items": {
            "$ref": "#/components/schemas/ReleaseWorkspaceManifest"
          },
          "type": "array"
        }
      },
      "required": [
        "projectDigest",
        "workspaces",
        "connections"
      ],
      "type": "object"
    },
    "ReleaseResponse": {
      "example": {
        "connections": [
          {
            "connection": "example",
            "revisionId": "example"
          }
        ],
        "createdAt": "2026-01-02T15:04:05Z",
        "createdBy": "example",
        "error": "example",
        "finalizedAt": "2026-01-02T15:04:05Z",
        "id": "example",
        "projectDigest": "example",
        "projectId": "example",
        "status": "draft",
        "workspaces": [
          {
            "artifactDigest": "example",
            "servingStateId": "example",
            "workspace": "example"
          }
        ]
      },
      "properties": {
        "connections": {
          "example": [
            {
              "connection": "example",
              "revisionId": "example"
            }
          ],
          "items": {
            "$ref": "#/components/schemas/ReleaseConnectionPin"
          },
          "type": "array"
        },
        "createdAt": {
          "example": "2026-01-02T15:04:05Z",
          "format": "date-time",
          "type": "string"
        },
        "createdBy": {
          "example": "example",
          "type": "string"
        },
        "error": {
          "example": "example",
          "type": "string"
        },
        "finalizedAt": {
          "example": "2026-01-02T15:04:05Z",
          "format": "date-time",
          "type": "string"
        },
        "id": {
          "example": "example",
          "type": "string"
        },
        "projectDigest": {
          "example": "example",
          "type": "string"
        },
        "projectId": {
          "example": "example",
          "type": "string"
        },
        "status": {
          "$ref": "#/components/schemas/ReleaseStatus"
        },
        "workspaces": {
          "example": [
            {
              "artifactDigest": "example",
              "servingStateId": "example",
              "workspace": "example"
            }
          ],
          "items": {
            "$ref": "#/components/schemas/ReleaseWorkspaceManifest"
          },
          "type": "array"
        }
      },
      "required": [
        "id",
        "projectId",
        "projectDigest",
        "status",
        "workspaces",
        "connections",
        "createdBy",
        "createdAt"
      ],
      "type": "object"
    },
    "ReleaseStatus": {
      "enum": [
        "draft",
        "validating",
        "ready",
        "failed"
      ],
      "example": "draft",
      "type": "string"
    },
    "ReleaseWorkspaceManifest": {
      "example": {
        "artifactDigest": "example",
        "servingStateId": "example",
        "workspace": "example"
      },
      "properties": {
        "artifactDigest": {
          "example": "example",
          "type": "string"
        },
        "servingStateId": {
          "example": "example",
          "type": "string"
        },
        "workspace": {
          "example": "example",
          "type": "string"
        }
      },
      "required": [
        "workspace",
        "artifactDigest"
      ],
      "type": "object"
    }
  }
}
