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

# Start or resume an application deploy run

> Hand the deploy wizard's whole ordered multi-stack deploy to the server. The run is persisted before anything is created - roles, drafts, and the stack name derived for each - and the maintenance supervisor creates each stack in turn, waiting for every stack that has another behind it to report up. Closing the browser tab no longer strands the remaining stacks. A request made while a run for the same application and cluster is already in flight joins that run and answers with resumed=true rather than starting a rival queue. Browser session authentication with the X-Ankra-CSRF double-submit header only (no bearer twin).



## OpenAPI

````yaml https://platform.ankra.app/openapi.json post /org/applications/{application_id}/deploy-runs
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://platform.ankra.app
security: []
paths:
  /org/applications/{application_id}/deploy-runs:
    post:
      tags:
        - Applications API
      summary: Start or resume an application deploy run
      description: >-
        Hand the deploy wizard's whole ordered multi-stack deploy to the server.
        The run is persisted before anything is created - roles, drafts, and the
        stack name derived for each - and the maintenance supervisor creates
        each stack in turn, waiting for every stack that has another behind it
        to report up. Closing the browser tab no longer strands the remaining
        stacks. A request made while a run for the same application and cluster
        is already in flight joins that run and answers with resumed=true rather
        than starting a rival queue. Browser session authentication with the
        X-Ankra-CSRF double-submit header only (no bearer twin).
      operationId: start_application_deploy_run
      parameters:
        - in: path
          name: application_id
          required: true
          schema:
            title: Application Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StartDeployRunRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeployRunResponse'
          description: Successful Response
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DemoDetailError'
          description: >-
            Not found ("Application not found", "Target cluster not found in
            this organisation.", or "Deploy run not found")
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    StartDeployRunRequest:
      properties:
        cluster_id:
          title: Cluster Id
          type: string
        roles:
          items:
            $ref: '#/components/schemas/DeployRunRoleRequest'
          title: Roles
          type: array
          description: >-
            The queue in deploy order: platform stacks first, the application
            stack last.
      required:
        - cluster_id
        - roles
      title: StartDeployRunRequest
      type: object
    DeployRunResponse:
      properties:
        id:
          title: Id
          type: string
        cluster_id:
          title: Cluster Id
          type: string
        status:
          title: Status
          type: string
          description: pending, running, succeeded, or failed.
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
        resumed:
          title: Resumed
          type: boolean
          description: >-
            True when the request joined a run that was already in flight
            instead of starting a new one.
        divergence:
          anyOf:
            - type: string
            - type: 'null'
          title: Divergence
          description: >-
            How a resumed run differs from the queue the request carried (a role
            not in the run, a role deploying a different stack name or draft, or
            a differing role count). Null when the request asked for what is
            already in flight, and always null on a run this request started.
        roles:
          items:
            $ref: '#/components/schemas/DeployRunRole'
          title: Roles
          type: array
      required:
        - id
        - cluster_id
        - status
        - message
        - resumed
        - divergence
        - roles
      title: DeployRunResponse
      type: object
    DemoDetailError:
      description: >-
        The FastAPI-style detail envelope the demo routes use for
        400/403/404/409/502 responses.
      properties:
        detail:
          type: string
      required:
        - detail
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    DeployRunRoleRequest:
      properties:
        role:
          title: Role
          type: string
        draft_id:
          title: Draft Id
          type: string
        stack_name:
          title: Stack Name
          type: string
      required:
        - role
        - draft_id
        - stack_name
      title: DeployRunRoleRequest
      type: object
    DeployRunRole:
      properties:
        role:
          title: Role
          type: string
        position:
          title: Position
          type: integer
        draft_id:
          title: Draft Id
          type: string
        stack_name:
          title: Stack Name
          type: string
        created_stack_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Created Stack Name
          description: The name the cluster used, present once the stack has been created.
        operation_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Operation Id
        status:
          title: Status
          type: string
          description: pending, creating, waiting, stalled, deployed, or failed.
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
          description: Why the role stopped, when it did.
      required:
        - role
        - position
        - draft_id
        - stack_name
        - created_stack_name
        - operation_id
        - status
        - message
      title: DeployRunRole
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object

````