> ## Documentation Index
> Fetch the complete documentation index at: https://koreai.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create release

> Build an immutable release from a project snapshot or a Git source. The build runs asynchronously.

[Back to the Project deployment APIs overview](https://koreai.mintlify.site/agent-platform/api-reference/cicd-overview.md)

Use this endpoint to build an immutable release of a project. The call starts an asynchronous build that produces compiled IR, pinned entity versions, an integrity hash, and an encrypted `.ablenc` bundle. The response returns a `releaseId` and a `statusUrl`. Poll [Get release](https://koreai.mintlify.site/agent-platform/api-reference/cicd-releases-get) until the status is `ready`.

Set `source.kind` to choose the content source. Use `project_snapshot` to capture the project's current content without a Git integration. Use `git`, or omit the field, to build from a branch, tag, or commit. The build is independent of the environment. It needs the `cicd.release.create` scope and project membership, but not environment authority. If an identical versioned release exists, the API reuses it and returns `200` with `reused: true`. It can requeue a failed build and then sets `requeued: true`. Otherwise it returns `202` with `releaseId`, `jobId`, and `statusUrl`.

The optional `version` field sets a release label in the format `X.Y.Z` when versioning is enabled. The optional `lob` and `developer` fields add a line-of-business tag and an attribution.

The API returns these errors:

* `409 RELEASE_VERSION_CONFLICT`: The version exists with different content.
* `409 RELEASE_SOURCE_EXPIRED`: A failed snapshot source expired.
* `409 AGENTIC_DRAFT_NOT_ACKNOWLEDGED`: You requested `project_snapshot` while the draft holds an unacknowledged agentic state.
* `503 PROJECT_SNAPSHOT_UNAVAILABLE` or `503 AGENTIC_HOLD_UNAVAILABLE`: The service is temporarily unavailable. You can retry.
* `503 RELEASE_STORAGE_NOT_SHARED`: This deployment can't build a `project_snapshot`. Don't retry.


## OpenAPI

````yaml agent-platform/api-specs/project-deploy-promote.yaml post /api/cicd/v1/projects/{projectId}/releases
openapi: 3.1.0
info:
  title: Public Project Deploy & Promote API
  version: 1.0.0
  description: >-
    The public, platform-API-key-usable path to deploy a project's CURRENT
    content to an environment and promote it through higher environments, with
    no Studio/user login and no Git dependency. Canonical source:
    docs/api/artemis-cicd-openapi.yaml (full CI/CD API — git, webhooks, eval
    gates, rollback, audit packs). This file is a focused subset for the "import
    -> release -> deploy -> promote" flow:

      1. Move project content between workspaces with the Public Project
         Import/Export API (docs/specs/public-project-import-export-api.openapi.yaml).
      2. Build an immutable release from the imported project's CURRENT content
         with source.kind="project_snapshot".
      3. Deploy that release to an environment, then promote it to a higher one.

    Auth differs from the Import/Export API: there is no raw `x-api-key``
    header. A platform key (`client_secret``) is exchanged for a short-lived
    Bearer JWT via the OAuth2 client-credentials grant below, and that JWT is
    sent as `Authorization: Bearer <token>` on every other call.
servers:
  - url: /
security: []
paths:
  /api/cicd/v1/projects/{projectId}/releases:
    post:
      summary: >-
        Build an immutable release from Git, a project snapshot, or a
        cross-tenant transfer.
      description: >-
        Starts an async build (compiled IR, pinned entity versions, integrity
        hash, encrypted .ablenc bundle). `source.kind="project_snapshot"`
        captures the project's CURRENT content — no Git integration required;
        `source.kind="git"` (or omitted) builds from a branch/tag/commit The
        build is environment-agnostic: it needs `cicd.release.create` plus
        project membership, NOT environment authority (authority is enforced at
        deploy/promote, not here).
      operationId: createRelease
      parameters:
        - $ref: '#/components/parameters/ProjectId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateReleaseRequest'
      responses:
        '200':
          description: >-
            An identical versioned release was reused (reused:true); a failed
            build may have been requeued.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReusedReleaseResponse'
        '202':
          description: Build started
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateReleaseResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          description: >-
            RELEASE_VERSION_CONFLICT (same version, different content),
            RELEASE_SOURCE_EXPIRED (a failed snapshot source expired), or
            AGENTIC_DRAFT_NOT_ACKNOWLEDGED (project_snapshot requested while the
            draft holds an unacknowledged agentic state).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CicdErrorResponse'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          description: >-
            PROJECT_SNAPSHOT_UNAVAILABLE (snapshot source temporarily down),
            AGENTIC_HOLD_UNAVAILABLE (retryable), or RELEASE_STORAGE_NOT_SHARED
            (per-server release storage — a project_snapshot cannot be built on
            this deployment; not retryable).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CicdErrorResponse'
      security:
        - BearerAuth: []
components:
  parameters:
    ProjectId:
      name: projectId
      in: path
      required: true
      schema:
        type: string
      description: UUID v7; must be in the key/token's projectIds.
  schemas:
    CreateReleaseRequest:
      type: object
      additionalProperties: false
      properties:
        source:
          $ref: '#/components/schemas/ReleaseSource'
          default: {}
        lob:
          type: string
          description: Optional line-of-business tag.
        developer:
          type: string
          description: Optional free-text attribution.
        version:
          type: string
          description: Durable human release label (X.Y.Z), when versioning is enabled.
    ReusedReleaseResponse:
      type: object
      required:
        - success
        - releaseId
        - statusUrl
        - reused
      properties:
        success:
          type: boolean
          const: true
        releaseId:
          type: string
        status:
          type: string
        version:
          type: string
        statusUrl:
          type: string
        reused:
          type: boolean
          const: true
        requeued:
          type: boolean
    CreateReleaseResponse:
      type: object
      required:
        - success
        - releaseId
        - jobId
        - statusUrl
      properties:
        success:
          type: boolean
        releaseId:
          type: string
        jobId:
          type: string
          description: '`release-build-<releaseId>`.'
        statusUrl:
          type: string
    CicdErrorResponse:
      type: object
      required:
        - success
        - error
      description: Standard CI/CD error envelope, used for 400/403/404/409/503.
      properties:
        success:
          type: boolean
          const: false
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: >-
                Codes relevant to this flow: PROJECT_NOT_FOUND,
                VALIDATION_ERROR, TRANSFER_SOURCE_INVALID,
                PROJECT_SNAPSHOT_UNAVAILABLE, RELEASE_STORAGE_NOT_SHARED,
                RELEASE_ARTIFACT_UNAVAILABLE, AGENTIC_DRAFT_NOT_ACKNOWLEDGED,
                AGENTIC_HOLD_UNAVAILABLE, RELEASE_SOURCE_EXPIRED,
                RELEASE_NOT_FOUND, RELEASE_NOT_READY, RELEASE_NOT_DEPLOYABLE,
                RELEASE_VERSION_CONFLICT, CONTENT_INTEGRITY_MISMATCH,
                DEPLOYMENT_NOT_FOUND, DEPLOYMENT_NOT_PROMOTABLE,
                QUALIFICATION_GATE_FAILED, BYPASS_REASON_REQUIRED,
                ENV_SCOPE_VIOLATION, SCOPE_VIOLATION, FORBIDDEN, NOT_FOUND,
                RATE_LIMITED, INTERNAL_ERROR. Full enum in
                docs/api/artemis-cicd-openapi.yaml.
            message:
              type: string
            details:
              nullable: true
            retryable:
              type: boolean
            requestId:
              type: string
              description: Correlates with the `X-Request-ID` response header.
    ReleaseSource:
      type: object
      additionalProperties: false
      description: >-
        Where the release content comes from. Omitted kind is the legacy Git
        contract.
      properties:
        kind:
          type: string
          enum:
            - git
            - project_snapshot
        ref:
          type: object
          additionalProperties: false
          description: A git ref to build from (kind=git only).
          properties:
            branch:
              type: string
            tag:
              type: string
        commitSha:
          type: string
          description: Optional exact commit; must resolve within the branch.
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
      description: Plain error envelope used for 401/500 across this API.
  responses:
    BadRequest:
      description: VALIDATION_ERROR
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CicdErrorResponse'
    Unauthorized:
      description: Authentication failure
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: Not authorized for the project or missing scope (FORBIDDEN).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CicdErrorResponse'
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.