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

# Add context files to an existing agent

> Upload one or more context files (up to 10) to an existing agent. Supported file types include documents (txt, csv, pdf, xls, xlsx, docx, doc, ppt, pptx) and images (png, jpeg, jpg, tiff, heif, bmp).



## OpenAPI

````yaml post /agent-setup/{agentId}/context-file
openapi: 3.0.0
info:
  title: Public API
  description: Public endpoints to interact with agents and orchestrate tasks
  version: '1.0'
  contact: {}
servers:
  - url: https://api.beamstudio.ai
security: []
tags: []
paths:
  /agent-setup/{agentId}/context-file:
    post:
      tags:
        - Agent Setup
      summary: Add context files to an existing agent
      description: >-
        Upload one or more context files (up to 10) to an existing agent.
        Supported file types include documents (txt, csv, pdf, xls, xlsx, docx,
        doc, ppt, pptx) and images (png, jpeg, jpg, tiff, heif, bmp).
      operationId: BeamAgentController_uploadFile
      parameters:
        - name: agentId
          required: true
          in: path
          schema:
            type: string
        - name: current-workspace-id
          in: header
          required: true
          schema:
            type: string
      requestBody:
        required: true
        description: Context files to upload
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - files
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                  description: Array of context files to upload (maximum 10 files)
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UploadContextFileResponseDto'
      security:
        - x-api-key: []
components:
  schemas:
    UploadContextFileResponseDto:
      type: object
      properties:
        id:
          type: string
        createdAt:
          format: date-time
          type: string
        updatedAt:
          format: date-time
          type: string
        name:
          type: string
        src:
          type: string
        agentId:
          type: string
        fileKey:
          type: string
        uploadStatus:
          type: string
        uploadSource:
          enum:
            - file_upload
            - text_snippet
            - url_upload
          type: string
        taskId:
          type: string
      required:
        - id
        - createdAt
        - updatedAt
        - name
        - src
        - agentId
        - fileKey
        - uploadStatus
        - uploadSource
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key

````