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

# Complete a version upload from the client's part manifest

> Commits the version in a single S3 CompleteMultipartUpload call, using the ETags supplied in the request body. The server does not list the upload's parts, so the manifest must be complete: it verifies the part numbers cover 1..totalParts before calling S3, because S3 itself assembles exactly the parts it is given and would otherwise silently produce a truncated object.




## OpenAPI

````yaml /api-reference/openapi.yml post /data-assets/{username}/{namespace}/{assetId}/versions/{versionNo}/finish
openapi: 3.0.3
info:
  title: DataLinks
  version: 3.10.0
servers:
  - url: https://api.datalinks.com/api/v1
    description: production server
security:
  - bearerAuth: []
  - openId:
      - implicit
paths:
  /data-assets/{username}/{namespace}/{assetId}/versions/{versionNo}/finish:
    post:
      tags:
        - data-assets
      summary: Complete a version upload from the client's part manifest
      description: >
        Commits the version in a single S3 CompleteMultipartUpload call, using
        the ETags supplied in the request body. The server does not list the
        upload's parts, so the manifest must be complete: it verifies the part
        numbers cover 1..totalParts before calling S3, because S3 itself
        assembles exactly the parts it is given and would otherwise silently
        produce a truncated object.
      operationId: finishDataAssetVersion
      parameters:
        - name: username
          in: path
          description: The username associated with the request.
          required: true
          schema:
            type: string
        - name: namespace
          in: path
          description: Namespace for the dataset.
          required: true
          schema:
            type: string
          example: cinematography
        - name: assetId
          in: path
          description: The data asset's id.
          required: true
          schema:
            type: string
            format: uuid
        - name: versionNo
          in: path
          description: The version number.
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FinishDataAssetVersionRequest'
        required: true
      responses:
        '200':
          description: Version committed
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
components:
  schemas:
    FinishDataAssetVersionRequest:
      required:
        - parts
      type: object
      properties:
        parts:
          type: array
          description: >
            Every part of the upload, exactly once. Must cover part numbers
            1..totalParts with no gaps, duplicates or extras; otherwise the
            request is rejected with 422 and nothing is committed. Order does
            not matter - the server sorts by partNumber.
          items:
            $ref: '#/components/schemas/FinishPartInput'
        expectedVersion:
          type: integer
          description: >-
            Optimistic concurrency - fails with 409 if the asset is no longer at
            this version.
      description: >
        The complete part manifest for the upload. The server performs no S3
        listing, so this body is the only record of what was uploaded - see
        `parts` for where the ETags come from.
    FinishPartInput:
      required:
        - etag
        - partNumber
      type: object
      properties:
        partNumber:
          type: integer
          description: The 1-based part number, exactly as issued in a `next[]` entry.
        etag:
          type: string
          description: >
            WHERE THIS COMES FROM: the value of the `ETag` response header of
            the `PUT` that uploaded this part. There is no other source - the
            API never sees the part bytes and does not ask S3 what it stored, so
            a client that loses an ETag cannot finish the version and must abort
            and re-upload it.

            Capture it from each part `PUT` response and keep it until `finish`.
            Quotes may be included or stripped; both are accepted. For browser
            clients the bucket CORS must send `Access-Control-Expose-Headers:
            ETag`, or the header is unreadable from script and the ETag is
            silently lost.

            S3 validates every (partNumber, etag) pair when the upload is
            completed: a wrong ETag, or one for a part that was never uploaded,
            fails the whole `finish` with 422 and commits nothing. A forged ETag
            therefore cannot corrupt an asset.
          example: d41d8cd98f00b204e9800998ecf8427e
      description: >-
        One uploaded part, identified by its number and the ETag S3 returned for
        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'
    UnprocessableEntity:
      description: Invalid request (e.g. version out of retention, TTL above max).
      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

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.