> ## 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.

# Queue a platform build

> Ask Ankra to build the application's image on platform infrastructure (the M2 build lane). Idempotent on (component, head_sha) while a request is live: a redelivery, a retry press and a demo request for the same commit converge on one build, and already_requested reports the join. Answers 404 for every organisation without the platform_builds flag - the surface stays invisible during the dark rollout. 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}/builds
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://platform.ankra.app
security: []
paths:
  /org/applications/{application_id}/builds:
    post:
      tags:
        - applications
      summary: Queue a platform build
      description: >-
        Ask Ankra to build the application's image on platform infrastructure
        (the M2 build lane). Idempotent on (component, head_sha) while a request
        is live: a redelivery, a retry press and a demo request for the same
        commit converge on one build, and already_requested reports the join.
        Answers 404 for every organisation without the platform_builds flag -
        the surface stays invisible during the dark rollout. Browser session
        authentication with the X-Ankra-CSRF double-submit header only (no
        bearer twin).
      operationId: start_application_platform_build
      parameters:
        - in: path
          name: application_id
          required: true
          schema:
            title: Application Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StartPlatformBuildRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StartPlatformBuildResponse'
          description: Successful Response
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DemoDetailError'
          description: >-
            Not found ("Application not found", or the organisation lacks the
            platform_builds flag)
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DemoDetailError'
          description: The request names no commit, or a reason this lane does not know
components:
  schemas:
    StartPlatformBuildRequest:
      properties:
        head_sha:
          title: Head Sha
          type: string
          description: >-
            The commit to build. The queue deduplicates on it, so a request
            without one has no identity.
        ref:
          title: Ref
          type: string
          description: >-
            The branch or tag the commit came from, as a label - the build is of
            the commit.
        component:
          title: Component
          type: string
          description: >-
            The monorepo component to build; empty for the repository's single
            application.
        reason:
          title: Reason
          type: string
          description: >-
            Why the platform wants this image: first_onboard, push, retry (the
            default), or demo.
      required:
        - head_sha
      title: StartPlatformBuildRequest
      type: object
    StartPlatformBuildResponse:
      properties:
        request_id:
          title: Request Id
          type: string
        build_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Build Id
          description: >-
            The build the live request was claimed into, when it was; null for a
            request still waiting.
        already_requested:
          title: Already Requested
          type: boolean
          description: >-
            True when a live request for the same commit already existed and
            this call joined it instead of queueing a rival.
      required:
        - request_id
        - build_id
        - already_requested
      title: StartPlatformBuildResponse
      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

````