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

# Schedule a build (create a BuildRun)

> Schedule a build of the BuildSpec. Re-checks the caller's access to the spec's datasets and
rejects the request if the spec already has an active run. Returns the new run in status `scheduled`.




## OpenAPI

````yaml /api-reference/openapi.yml post /build-specs/{buildSpecId}/run
openapi: 3.0.3
info:
  title: DataLinks
  version: 2.29.0
servers:
  - url: https://api.datalinks.com/api/v1
    description: production server
security:
  - bearerAuth: []
  - openId:
      - implicit
paths:
  /build-specs/{buildSpecId}/run:
    post:
      tags:
        - buildspecs
      summary: Schedule a build (create a BuildRun)
      description: >
        Schedule a build of the BuildSpec. Re-checks the caller's access to the
        spec's datasets and

        rejects the request if the spec already has an active run. Returns the
        new run in status `scheduled`.
      operationId: scheduleBuild
      parameters:
        - name: buildSpecId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '201':
          description: The created BuildRun.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BuildRunResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
components:
  schemas:
    BuildRunResponse:
      required:
        - buildSpecId
        - createdAt
        - id
        - kind
        - retries
        - specVersion
        - status
        - updatedAt
      type: object
      properties:
        id:
          type: string
          format: uuid
        buildSpecId:
          type: string
          format: uuid
        specVersion:
          type: integer
          description: >-
            The BuildSpec version this run executes (snapshotted at schedule
            time).
        status:
          type: string
          enum:
            - Scheduled
            - Exporting
            - Claimable
            - Running
            - Produced
            - Ingesting
            - Finished
            - Failed
        kind:
          type: string
          description: >-
            Whether this run ingests its output (Build) or presents it to the
            user (Preview).
          enum:
            - Build
            - Preview
        retries:
          type: integer
        errorMessage:
          type: string
        createdAt:
          type: string
          description: Timestamp of the BuildRun creation.
          format: date-time
          example: '2005-04-02T19:37:00.000Z'
        updatedAt:
          type: string
          description: Timestamp of the BuildRun last update.
          format: date-time
          example: '2005-04-02T19:37:00.000Z'
    ErrorResponse:
      required:
        - error_code
        - message
      type: object
      properties:
        error_code:
          type: string
          example: UNAUTHORIZED
        error_message:
          type: string
          example: ''
        message:
          type: string
          example: Missing authentication token
        sub_errors:
          type: array
          items:
            required:
              - code
              - message
            type: object
            properties:
              code:
                type: string
              message:
                type: string
  responses:
    Unauthorized:
      description: >-
        Unauthorized. This error occurs if the authentication token is missing
        or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: Forbidden. The user does not have access to this resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Conflict:
      description: >-
        Conflict. The request could not be completed due to a conflict with the
        current state of the resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      description: >
        Use a Bearer token for authentication. Submit the token using the
        `Authorization`

        header: `Authorization: Bearer <token>`.
      scheme: bearer
    openId:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: >-
            https://login.datalinks.com/realms/datalinks-realm/protocol/openid-connect/auth
          scopes:
            openid: openid

````