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

# Edit a BuildSpec

> Replace the definition and bump its version. Datasets are addressed by name.



## OpenAPI

````yaml /api-reference/openapi.yml put /build-specs/{buildSpecId}
openapi: 3.0.3
info:
  title: DataLinks
  version: 2.22.1
servers:
  - url: https://api.datalinks.com/api/v1
    description: production server
security:
  - bearerAuth: []
  - openId:
      - implicit
paths:
  /build-specs/{buildSpecId}:
    put:
      tags:
        - buildspecs
      summary: Edit a BuildSpec
      description: >-
        Replace the definition and bump its version. Datasets are addressed by
        name.
      operationId: editBuildSpec
      parameters:
        - name: buildSpecId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BuildSpecRequest'
        required: true
      responses:
        '200':
          description: The updated BuildSpec.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BuildSpecResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/UnprocessableContent'
components:
  schemas:
    BuildSpecRequest:
      required:
        - code
        - destination
        - sources
      type: object
      properties:
        sources:
          minItems: 1
          type: array
          items:
            $ref: '#/components/schemas/DatasetCoordinate'
        destination:
          $ref: '#/components/schemas/DatasetCoordinate'
        code:
          $ref: '#/components/schemas/BuildSpecCode'
    BuildSpecResponse:
      required:
        - code
        - createdAt
        - destination
        - id
        - owner
        - sources
        - updatedAt
        - version
      type: object
      properties:
        id:
          type: string
          format: uuid
        owner:
          type: string
          description: Username of the BuildSpec's owner.
        version:
          type: integer
        sources:
          type: array
          items:
            $ref: '#/components/schemas/DatasetCoordinate'
        destination:
          $ref: '#/components/schemas/DatasetCoordinate'
        code:
          $ref: '#/components/schemas/BuildSpecCode'
        createdAt:
          type: string
        updatedAt:
          type: string
    DatasetCoordinate:
      required:
        - datasetName
        - namespace
        - owner
      type: object
      properties:
        owner:
          type: string
          description: Owner username of the dataset's namespace.
        namespace:
          type: string
        datasetName:
          type: string
    BuildSpecCode:
      required:
        - payload
      type: object
      properties:
        payload:
          type: string
          description: Opaque code payload; jvmRest never interprets it.
    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'
    UnprocessableContent:
      description: The request could not be processed.
      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

````