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

# Upload Documents

> Upload documents to an agent knowledge base.



## OpenAPI

````yaml POST /agent-documents
openapi: 3.0.1
info:
  title: Phonely API
  description: API for Phonely services including agent management and call summaries
  version: 1.0.0
servers:
  - url: https://app.phonely.ai/api
security: []
paths:
  /agent-documents:
    post:
      summary: Upload documents
      description: >-
        Upload documents to an agent's knowledge base. Maximum 10 files, each
        under 10MB. Supports PDF, DOCX, and TXT files.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - uid
                - agentId
                - files
              properties:
                uid:
                  type: string
                  description: User ID
                agentId:
                  type: string
                  description: Agent ID
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                  maxItems: 10
                  description: Documents to upload
      responses:
        '200':
          description: Files uploaded successfully
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                  - documentIds
                properties:
                  message:
                    type: string
                  documentIds:
                    type: array
                    items:
                      type: string
        '400':
          description: Invalid request or file validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error code or identifier
        message:
          type: string
          description: Detailed error message
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Authorization

````