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

# Ingest a new file



## OpenAPI

````yaml /deploy/api/openapi.json post /api/v1/appuid/{appUid}/contexts/{contextUid}/files
openapi: 3.0.1
info:
  title: Mindset API Gateway
  version: 1.2.0
servers:
  - url: https://a.api.mindset.ai
  - url: https://b.api.mindset.ai
  - url: https://c.api.mindset.ai
  - url: https://d.api.mindset.ai
security: []
tags:
  - name: Agent Configuration
  - name: Agent Sessions
  - name: AppStatus
  - name: Context Files
  - name: Contexts
  - name: DynamicComponents
  - name: Labels
  - name: SDK Users
  - name: Threads
  - name: Webhooks
  - name: Agent Management (deprecated)
paths:
  /api/v1/appuid/{appUid}/contexts/{contextUid}/files:
    post:
      tags:
        - Context Files
      summary: Ingest a new file
      operationId: createContextFiles
      parameters:
        - name: appUid
          in: path
          description: Your application's uid
          required: true
          schema:
            minLength: 1
            type: string
        - name: contextUid
          in: path
          description: Your context's uid
          required: true
          schema:
            minLength: 1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              required:
                - mimeType
                - name
              type: object
              properties:
                externalId:
                  type: string
                  description: Optional External ID of the file
                name:
                  maxLength: 100
                  minLength: 1
                  type: string
                  description: Name of the file
                mimeType:
                  type: string
                  description: mime type of the file to be ingested
                  enum:
                    - video/mp4
                    - audio/mpeg
                    - application/pdf
                    - >-
                      application/vnd.openxmlformats-officedocument.presentationml.presentation
                    - >-
                      application/vnd.openxmlformats-officedocument.wordprocessingml.document
                    - text/html
                    - text/plain
                    - application/zip
                zipType:
                  maxLength: 20
                  type: string
                  description: >-
                    When sending a scorm file set mimeType to application/zip
                    and specify 'scorm' here
                sourceUrl:
                  maxLength: 2048
                  type: string
                  description: Url to download the file from for ingestion
                documentContent:
                  maxLength: 15000000
                  type: string
                  description: >-
                    Content of the file, text (plain or markdown) or html to be
                    ingested directly. Supports up to ~10MB of Base64-encoded
                    content.
                autoPublish:
                  type: boolean
                  description: Automatically publish this file after successful ingestion
                hideContentSegments:
                  type: boolean
                  description: >-
                    Allows the agent to refer to knowledge ingested from this
                    document without ever revealing the source doc
                knownAs:
                  maxLength: 200
                  type: string
                  description: >-
                    How the agent can refer to this file. eg 'video',
                    'discussion', 'sales pitch'
                externalUrl:
                  maxLength: 2048
                  type: string
                  description: >-
                    An external URL to direct an end user to the file for this
                    document
                thumbnailUrl:
                  maxLength: 2048
                  type: string
                  description: >-
                    An external URL for a custom thumbnail for this file. It
                    must point to an image of less than 3MB
                thumbnail:
                  maxLength: 65536
                  type: string
                  description: A base64 encoded image to use as a thumbnail for this file.
                viewOriginalSource:
                  type: boolean
                  description: Instruct agent UI to launch the externalUrl provided
                contentHash:
                  maxLength: 200
                  type: string
                  description: Optional string to support spotting content change
                labels:
                  maxItems: 10
                  type: array
                  description: Array of label uids (max 10)
                  items:
                    maxLength: 128
                    minLength: 20
                    type: string
                runId:
                  maxLength: 200
                  type: string
                  description: Optional string to track id of triggering process
        required: true
      responses:
        '201':
          description: File accepted. Ingestion processing started
          content:
            application/json:
              schema:
                type: object
                properties:
                  uid:
                    type: string
                    description: Unique identifier
                  externalId:
                    type: string
                    description: Optional External ID of the file
                  createdAt:
                    type: string
                    description: Creation timestamp (ISO 8601)
                    format: date-time
                  name:
                    type: string
                    description: Name to display to the end user
                  status:
                    type: string
                    description: Status of the resource
                  statusMessage:
                    type: string
                    description: Human-readable status message (e.g., 'AI at work...')
                  runId:
                    type: string
                    description: Run identifier (if specified on ingestion)
                  mimeType:
                    type: string
                    description: MIME type of the file
                  autoPublish:
                    type: boolean
                    description: >-
                      Whether this file will be automatically made available
                      after successful ingestion
                  hideContentSegments:
                    type: boolean
                    description: >-
                      Flag to hide file segments in agent responses. Does not
                      hide the knowledge from the agent
                  labels:
                    maxItems: 10
                    type: array
                    description: Array of label UIDs to associate wth the file
                    items:
                      type: string
                  contentHash:
                    type: string
                    description: >-
                      Externally provided content hash string to enable
                      decisions on when to replace the file
                  knownAs:
                    type: string
                    description: >-
                      How the agent can refer to this item. Eg webinar,
                      presentation, paper, specification etc
                  externalUrl:
                    type: string
                    description: >-
                      External URL to launch when aa user wishes to view this
                      file
                    format: uri
                  viewOriginalSource:
                    type: boolean
                    description: >-
                      Flag to view using the provided externalUrl. Otherwise
                      inbuilt player will be used
                  thumbnailUpdatedByAdmin:
                    type: boolean
                    description: >-
                      If a thumbnail has been changed by an admin this boolean
                      will allow automated updates to skip replacing the
                      thumbnail
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Context does not exist
          content: {}
        '422':
          description: Unprocessable Entity
          content: {}
        '500':
          description: Internal Server Error
          content: {}
      security:
        - APIKeyHeader: []
components:
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      name: x-api-key
      in: header

````