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

# Upload File

> Upload an image or PDF file for a conversation. Returns a unique file ID that can be used to reference the file in the conversation.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/convai/conversations/{conversation_id}/files
openapi: 3.1.0
info:
  title: Threetone API Documentation
  description: >-
    This is the documentation for the Threetone API. You can use this API to use
    our service programmatically with API keys sent in the x-api-key header. You
    can create and manage API keys in the dashboard at
    https://threetone.in/app/developers/api-keys.
  version: '1.0'
servers:
  - url: https://api.threetone.in
    description: Production
security: []
paths:
  /v1/convai/conversations/{conversation_id}/files:
    post:
      tags:
        - Agents Platform
      summary: Upload File
      description: >-
        Upload an image or PDF file for a conversation. Returns a unique file ID
        that can be used to reference the file in the conversation.
      operationId: upload_file_route
      parameters:
        - name: conversation_id
          in: path
          required: true
          schema:
            type: string
            title: Conversation Id
        - name: x-api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Your API key for programmatic access. Send it in the x-api-key
              header; you can create and manage keys from the Developers page.
            title: X-Api-Key
          description: >-
            Your API key for programmatic access. Send it in the x-api-key
            header; you can create and manage keys from the Developers page.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Body_Upload_file_v1_convai_conversations__conversation_id__files_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConvAIFileUploadResponseModel'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    Body_Upload_file_v1_convai_conversations__conversation_id__files_post:
      properties:
        file:
          type: string
          format: binary
          title: File
          description: Image or PDF file to upload
      type: object
      required:
        - file
      title: Body_Upload_file_v1_convai_conversations__conversation_id__files_post
    ConvAIFileUploadResponseModel:
      properties:
        file_id:
          type: string
          title: File Id
      type: object
      required:
        - file_id
      title: ConvAIFileUploadResponseModel
    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

````