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

# confirm upload knowledge document

> Finish a direct upload started with `POST /v1/knowledge/groups/{id}/documents/presigned-upload`, after the file's bytes were `PUT` to its `uploadUrl`. Reads the uploaded file's real size from storage, checks it against the 50MB limit and the organization's monthly knowledge upload quota, and starts processing. A file that is missing from storage, over 50MB or over the quota is rejected and its document deleted (with the stored file); upload it again. The returned document starts in `PROCESSING` and becomes searchable once it reaches `READY`. Confirming is idempotent: a document already confirmed, and not deleted, is returned as it is, unchanged. A document deleted before it's confirmed gets a `404` and doesn't start; deleting one after it's confirmed doesn't stop its processing. Requires an API key with knowledge write access.



## OpenAPI

````yaml https://api.anam.ai/swagger.json post /v1/knowledge/documents/{id}/confirm-upload
openapi: 3.1.0
info:
  title: Anam AI API
  version: '1.0'
servers:
  - url: https://api.anam.ai
    description: Anam API
security:
  - BearerAuth: []
tags:
  - name: Sessions
  - name: Avatar Videos
  - name: Meetings
  - name: Watermark Checks
  - name: Personas
  - name: Avatars
  - name: Voices
  - name: Pronunciation Dictionaries
  - name: LLMs
  - name: Knowledge
  - name: Tools
  - name: Share Links
  - name: Engine
paths:
  /v1/knowledge/documents/{id}/confirm-upload:
    post:
      tags:
        - Knowledge
      summary: confirm upload knowledge document
      description: >-
        Finish a direct upload started with `POST
        /v1/knowledge/groups/{id}/documents/presigned-upload`, after the file's
        bytes were `PUT` to its `uploadUrl`. Reads the uploaded file's real size
        from storage, checks it against the 50MB limit and the organization's
        monthly knowledge upload quota, and starts processing. A file that is
        missing from storage, over 50MB or over the quota is rejected and its
        document deleted (with the stored file); upload it again. The returned
        document starts in `PROCESSING` and becomes searchable once it reaches
        `READY`. Confirming is idempotent: a document already confirmed, and not
        deleted, is returned as it is, unchanged. A document deleted before it's
        confirmed gets a `404` and doesn't start; deleting one after it's
        confirmed doesn't stop its processing. Requires an API key with
        knowledge write access.
      operationId: confirmKnowledgeDocumentUpload
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          description: The `documentId` from the presigned upload
        - in: header
          name: X-Upload-Token
          required: false
          schema:
            type: string
          description: >-
            Lab's short-lived upload token, which Lab's own uploader sends
            instead of an API key. API clients authenticate with `Authorization:
            Bearer <API key>` and leave this out.
      requestBody:
        required: false
        description: >-
          Not needed. A body is accepted for older clients and ignored,
          including any `fileSize`: the size is measured from storage.
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: >-
            The upload was confirmed and the document is processing, or it was
            confirmed before and is returned as it is.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeDocument'
              examples:
                default:
                  $ref: '#/components/examples/KnowledgeDocumentResponse'
        '400':
          description: >-
            The file isn't in storage, its measured size is over 50MB, or it
            would pass the organization's monthly knowledge upload quota. The
            document (and any stored file) is deleted.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
        '401':
          description: Unauthorized - Invalid or missing API key or upload token
        '403':
          description: Forbidden - API key lacks the required permission
        '404':
          description: Document not found, or deleted
        '409':
          description: >-
            Other uploads in progress hold the rest of the organization's
            monthly knowledge upload allowance, although the measured file fits
            beside this month's documents. The document and its file are kept;
            confirm again after `Retry-After` seconds.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
        '500':
          description: Server error
        '503':
          description: >-
            A temporary server problem: the API key couldn't be checked, or the
            monthly upload quota couldn't be. The upload is kept; confirm again
            after `Retry-After` seconds.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                  message:
                    type: string
components:
  schemas:
    KnowledgeDocument:
      type: object
      description: >-
        A single file uploaded into a knowledge group. Retrieved chunks
        reference it by ID.
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the document.
        knowledgeFolderId:
          type: string
          format: uuid
          description: ID of the knowledge group this document belongs to.
        filename:
          type: string
          description: Original filename as uploaded.
        fileType:
          type: string
          description: MIME type or extension-derived file type.
        fileSize:
          type: integer
          description: Size of the file in bytes.
        fileUrl:
          type: string
          format: uri
          description: Internal URL at which the file is stored.
        status:
          type: string
          enum:
            - UPLOADED
            - PROCESSING
            - READY
            - FAILED
          description: >-
            Current processing state. `UPLOADED` means a presigned upload is
            waiting for confirm-upload, and its file may not be stored yet. Only
            `READY` documents are searchable.
        errorMessage:
          type:
            - string
            - 'null'
          description: Failure reason when `status` is `FAILED`, otherwise `null`.
        chunkSize:
          type:
            - integer
            - 'null'
          description: >-
            Chunk size override set at upload, in tokens; null when not
            overridden. When both chunkSize and chunkOverlap are null, the
            document uses its group's settings. When only chunkOverlap is set, a
            null chunkSize means the default of 350.
        chunkOverlap:
          type:
            - integer
            - 'null'
          description: >-
            Chunk overlap override set at upload, in tokens; null when not
            overridden. When both chunkSize and chunkOverlap are null, the
            document uses its group's settings. When only chunkSize is set, a
            null chunkOverlap means the default of 0.
        appliedChunking:
          type:
            - object
            - 'null'
          description: >-
            Settings the last successful processing used. Null until the
            document has been processed.
          properties:
            strategy:
              type: string
            chunkSize:
              type:
                - integer
                - 'null'
            chunkOverlap:
              type:
                - integer
                - 'null'
            source:
              type: string
              enum:
                - document
                - folder
                - default
            appliedAt:
              type: string
              format: date-time
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the document was uploaded.
        updatedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: Timestamp when the document record was last updated.
  examples:
    KnowledgeDocumentResponse:
      summary: A single knowledge document
      value:
        id: 00000000-0000-0000-0000-000000000000
        knowledgeFolderId: 00000000-0000-0000-0000-000000000000
        filename: getting-started.pdf
        fileType: application/pdf
        fileSize: 248320
        fileUrl: https://cdn.anam.ai/knowledge/getting-started.pdf
        status: READY
        errorMessage: null
        chunkSize: null
        chunkOverlap: null
        appliedChunking:
          strategy: paragraph
          chunkSize: 800
          chunkOverlap: 100
          source: folder
          appliedAt: '2026-04-20T10:01:12.000Z'
        createdAt: '2026-04-20T10:00:00.000Z'
        updatedAt: '2026-04-20T10:01:12.000Z'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````

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