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

# Update a file by externalId



## OpenAPI

````yaml /deploy/api/openapi.json patch /api/v1/appuid/{appUid}/contexts/{contextUid}/files/externalId/{externalId}
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/externalId/{externalId}:
    patch:
      tags:
        - Context Files
      summary: Update a file by externalId
      operationId: updateContextFilesByExternalId
      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
        - name: externalId
          in: path
          description: Unique externalId of the file
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  maxLength: 100
                  type: string
                  description: Name of the file
                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
                viewOriginalSource:
                  type: boolean
                  description: Instruct agent UI to launch the externalUrl provided
                labels:
                  maxItems: 10
                  type: array
                  description: Array of label uids (max 10)
                  items:
                    maxLength: 128
                    minLength: 20
                    type: string
                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.
        required: false
      responses:
        '200':
          description: Successful update
          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
        '404':
          description: Context or File not found
          content: {}
        '422':
          description: Unprocessable Entity
          content: {}
      security:
        - APIKeyHeader: []
components:
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      name: x-api-key
      in: header

````