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

# Save edits to a pipeline repo

> Commits an atomic set of file upserts and deletions to the default branch. Carries the base commit sha for optimistic concurrency; a stale base is rejected with 409. `.dvc/config` is platform-owned and cannot be written or deleted.



## OpenAPI

````yaml /api-reference/openapi.yml put /build-specs/{buildSpecId}/files
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}/files:
    put:
      tags:
        - buildspecs
      summary: Save edits to a pipeline repo
      description: >-
        Commits an atomic set of file upserts and deletions to the default
        branch. Carries the base commit sha for optimistic concurrency; a stale
        base is rejected with 409. `.dvc/config` is platform-owned and cannot be
        written or deleted.
      operationId: savePipelineFiles
      parameters:
        - name: buildSpecId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PipelineFilesSaveRequest'
        required: true
      responses:
        '200':
          description: The new commit sha.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PipelineFilesSaveResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: The base commit sha is stale; re-read and retry.
        '422':
          $ref: '#/components/responses/UnprocessableContent'
components:
  schemas:
    PipelineFilesSaveRequest:
      required:
        - baseSha
      type: object
      properties:
        baseSha:
          type: string
          description: The commit sha the edits are based on, for optimistic concurrency.
        upserts:
          type: object
          additionalProperties:
            type: string
          description: >-
            Map of file path to new content; each file is created or
            overwritten.
        deletions:
          type: array
          description: Paths to delete in the same commit.
          items:
            type: string
    PipelineFilesSaveResponse:
      required:
        - sha
      type: object
      properties:
        sha:
          type: string
          description: The new commit sha.
    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'
    NotFound:
      description: The requested resource was not found.
      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

````