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

# Complete an upload

> Tells ROOTKey the bytes are uploaded. ROOTKey checks them against the SHA-256 you declared, then anchors the hash and creates the file. For a `single` upload the answer is `200`, with the same fields as [Create file](/api-reference/platform/endpoint/files/create-file) plus `fileId`. For a `multipart` upload the answer is `202`: the whole file is verified first, and you poll [the upload](/api-reference/platform/endpoint/files/get-file-upload) until it is `COMPLETED`. This is the call that consumes one file and one API request from your plan. Repeating it is safe: a completed upload answers with its file again, and an upload that is being completed is never anchored twice.



## OpenAPI

````yaml post /platform/files/uploads/{uploadId}/complete
openapi: 3.0.3
info:
  title: ROOTKey Documentation
  description: >-
    Your API of choice for creating, managing, and validating information easily
    and securely!
  termsOfService: https://www.rootkey.ai/legal/privacy-policy
  contact:
    name: ROOTKey
    url: https://www.rootkey.ai/contact
    email: support@rootkey.ai
  version: 1.0.0
servers:
  - description: Production
    url: https://api.rootkey.ai/api-v1/
security:
  - x-api-key: []
tags:
  - name: api-v1-public
    description: Unauthenticated top-level /api-v1 endpoints (health, plans, annual report)
  - name: api-v1-files
    description: >-
      File anchoring, versioning, validation and compliance reporting
      (/api-v1/platform/files)
  - name: api-v1-records
    description: Structured-data record anchoring (/api-v1/platform/records)
  - name: api-v1-vaults
    description: 'Vault lifecycle: create / update / delete (/api-v1/platform/vaults)'
  - name: api-v1-recovery-points
    description: >-
      Backup archives created from vault contents
      (/api-v1/platform/recovery-point)
paths:
  /platform/files/uploads/{uploadId}/complete:
    post:
      tags:
        - api-v1-files
      summary: Complete an upload
      description: >-
        Tells ROOTKey the bytes are uploaded. ROOTKey checks them against the
        SHA-256 you declared, then anchors the hash and creates the file. For a
        `single` upload the answer is `200`, with the same fields as [Create
        file](/api-reference/platform/endpoint/files/create-file) plus `fileId`.
        For a `multipart` upload the answer is `202`: the whole file is verified
        first, and you poll [the
        upload](/api-reference/platform/endpoint/files/get-file-upload) until it
        is `COMPLETED`. This is the call that consumes one file and one API
        request from your plan. Repeating it is safe: a completed upload answers
        with its file again, and an upload that is being completed is never
        anchored twice.
      parameters:
        - name: uploadId
          in: path
          required: true
          description: >-
            The `uploadId` returned by [Start an
            upload](/api-reference/platform/endpoint/files/start-file-upload).
          schema:
            type: string
            pattern: ^upl_[0-9a-f]{32}$
            example: upl_3f2b8c1e5a7d4e9b9c2a1d6e8f0a4b7c
      responses:
        '200':
          description: The file was created and its anchor submitted (`single` uploads).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompleteFileUploadResponse'
        '202':
          description: >-
            Accepted (`multipart` uploads): the whole file's SHA-256 is being
            verified before anything is anchored.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompleteFileUploadAccepted'
        '400':
          description: >-
            A plan limit (`usage_limit_exceeded`) or a paused vault. The upload
            stays open, so you can repeat the call once it is resolved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DomainErrorResponse'
        '401':
          description: Unauthenticated
        '404':
          description: '`file_upload_not_found`'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DomainErrorResponse'
        '409':
          description: >-
            `file_upload_incomplete` (the bytes are not all there yet),
            `file_upload_finalizing` (the upload is already being completed:
            check its status, then try again), `file_upload_not_open` (it is
            finished, failed or aborted), or `no_promotable_version`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DomainErrorResponse'
        '410':
          description: '`file_upload_expired`: the upload expired. Start a new one.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DomainErrorResponse'
        '422':
          description: >-
            `file_upload_checksum_mismatch` or `file_upload_size_mismatch`: what
            was stored is not what you declared. The upload fails and what was
            stored is deleted. Start a new one.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DomainErrorResponse'
        '500':
          description: >-
            `creation_outcome_unknown` (the anchor may or may not exist: do not
            repeat the upload, see
            [Errors](/api-reference/errors#creation_outcome_unknown)) or
            `internal_error`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DomainErrorResponse'
      security:
        - x-api-key: []
components:
  schemas:
    CompleteFileUploadResponse:
      type: object
      properties:
        chainId:
          type: number
          example: 137
        transactionHash:
          type: string
          description: On-chain transaction hash of the anchoring transaction
          example: 0xabc123...
        fileId:
          type: string
      required:
        - chainId
        - transactionHash
        - fileId
    CompleteFileUploadAccepted:
      type: object
      properties:
        uploadId:
          type: string
        status:
          type: string
          enum:
            - VERIFYING
    DomainErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            requestId:
              type: string
            message:
              type: string
            errorCode:
              type: string
            docUrl:
              type: string
            timestamp:
              type: string
              format: date-time
  securitySchemes:
    x-api-key:
      type: apiKey
      name: x-api-key
      in: header
      description: >-
        ROOTKey API key (rk_live_... for production, rk_test_... for the test
        network).

````

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