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

# Upload Files

> Upload files for ingestion or item updates.

<Card title="Error Reference: Ingestion" icon="triangle-exclamation" href="/api-reference/general/errors#ingestion">
  Common errors: publisher org mismatch, publisher not found, file read errors, duplicate uploads in the response body.
</Card>

## Authentication

The API requires a JWT token with specific claims to authorize access. The token must be associated with a Client ID that has access to the specified publisher. The system validates that the organization associated with your Client ID has permission to access the publisher specified in your request.

### JWT Token Requirements

Your JWT must include the following claims:

* A `sub` claim containing your API Client ID.
* A `scope` claim that includes `api/access`.

<Info>
  You will only be able to send content to a publisher that belongs to your organization. Please double-check the `publisher_id` field in the request body for accuracy.
</Info>


## OpenAPI

````yaml post /ingestion/v2/files
openapi: 3.1.0
info:
  title: AI API
  description: |-
    Optimized for high-speed inference and scalability by Gloo AI

    [Swagger UI](./docs) | [ReDoc UI](./redoc)
  version: 1.0.0
servers:
  - url: https://platform.ai.gloo.com
security:
  - bearerAuth: []
tags:
  - name: Content Controls
  - name: Data Engine
  - name: Ingestion & Enrichment
  - name: answers
  - name: chat
  - name: completions
  - name: content
  - name: core
  - name: data
  - name: get-models
  - name: ingestion
  - name: sotc
paths:
  /ingestion/v2/files:
    post:
      tags:
        - Data Engine
        - Ingestion & Enrichment
      summary: Upload Files
      description: Upload files for ingestion or item updates.
      operationId: upload_files_ingestion_v2_files_post
      parameters:
        - name: update
          in: query
          required: false
          schema:
            type: string
          description: Optional item_id to update (replacing existing content)
        - name: producer_id
          in: query
          required: false
          schema:
            type: string
          description: >-
            Optional producer-specific identifier for the uploaded file. When
            provided, only one file may be uploaded in the request.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                publisher_id:
                  type: string
                  description: Publisher ID
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                  description: Files to upload
              required:
                - publisher_id
                - files
      responses:
        '200':
          description: File ingestion queued
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileQueuedResponse'
        '400':
          description: Bad Request - Invalid publisher, upload, or update request
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
              examples:
                publisher_not_found:
                  summary: Publisher not found
                  value:
                    detail:
                      code: publisher_not_found
                      message: Publisher not found
                too_many_files:
                  summary: Producer ID cannot be used with multiple files
                  value:
                    detail:
                      message: Too many files. Producer ID is pre-file only.
                      code: too_many_files
                file_read_error:
                  summary: Uploaded file could not be read
                  value:
                    detail:
                      message: >-
                        Could not read sermon.pdf: unable to decode uploaded
                        file
                      code: file_read_error
        '401':
          description: Unauthorized - Missing Authorization header
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
              example:
                error: Missing Authorization
                code: unauthorized_missing_authorization
        '403':
          description: Forbidden - Update target does not belong to the publisher
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
              example:
                detail:
                  message: Item does not belong to this publisher
                  code: publisher_mismatch
        '404':
          description: Item not found
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
              example:
                detail:
                  code: item_not_found
                  message: Item not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: >-
            Internal server error - Missing server configuration or processing
            failure
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
              examples:
                collection_not_configured:
                  summary: Collection name not configured
                  value:
                    detail:
                      message: Collection name not configured
                      code: collection_not_configured
                cluster_not_configured:
                  summary: Default cluster not configured
                  value:
                    detail:
                      message: Default cluster not configured
                      code: cluster_not_configured
                transfer_bucket_not_configured:
                  summary: Transfer bucket not configured
                  value:
                    detail:
                      message: >-
                        Server configuration error: transfer bucket not
                        configured
                      code: transfer_bucket_not_configured
                internal_server_error:
                  summary: Internal processing failure
                  value:
                    detail:
                      message: Internal server error
                      code: internal_server_error
      security:
        - HTTPBearer: []
components:
  schemas:
    FileQueuedResponse:
      properties:
        success:
          type: boolean
          title: Success
        message:
          type: string
          title: Message
        ingesting:
          items:
            type: string
          type: array
          title: Ingesting
        duplicates:
          items:
            type: string
          type: array
          title: Duplicates
      type: object
      required:
        - success
        - message
        - ingesting
        - duplicates
      title: FileQueuedResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form Bearer `<token>`, where
        `<token>` is your [auth token](/studio/manage-api-credentials).
    HTTPBearer:
      type: http
      scheme: bearer

````