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

# Upload file

> Upload a workspace file for RAG and agent resources



## OpenAPI

````yaml https://api.getcargo.io/openapi.json post /content/files/upload
openapi: 3.1.0
info:
  title: Cargo API
  version: 1.0.0
  description: Cargo Platform API v1
servers:
  - url: https://api.getcargo.io/v1
    description: Cargo API
security:
  - bearerAuth: []
paths:
  /content/files/upload:
    post:
      tags:
        - Content - Files
      summary: Upload file
      description: Upload a workspace file for RAG and agent resources
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                folderUuid:
                  title: Folder UUID
                  description: Folder identifier to upload into.
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$
                uuid:
                  title: File UUID
                  description: >-
                    When set, replace this file's content in place (keeping its
                    uuid) instead of creating a new file. Ignored if no file
                    with this uuid exists.
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$
              additionalProperties: false
              title: Request body
              description: Request body schema.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  files:
                    type: array
                    items:
                      allOf:
                        - type: object
                          properties:
                            uuid:
                              type: string
                            workspaceUuid:
                              type: string
                            libraryUuid:
                              type: string
                            userUuid:
                              anyOf:
                                - type: string
                                - type: 'null'
                            name:
                              type: string
                            isTemporary:
                              type: boolean
                            folderUuid:
                              anyOf:
                                - type: string
                                - type: 'null'
                            s3Filename:
                              type: string
                            openAiFileId:
                              type: string
                            contentType:
                              type: string
                            size:
                              type: number
                            isIndexedInOpenAiVectorStore:
                              type: boolean
                            externalId:
                              anyOf:
                                - type: string
                                - type: 'null'
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                            deletedAt:
                              anyOf:
                                - type: string
                                - type: 'null'
                          required:
                            - uuid
                            - workspaceUuid
                            - libraryUuid
                            - userUuid
                            - name
                            - isTemporary
                            - folderUuid
                            - s3Filename
                            - openAiFileId
                            - contentType
                            - size
                            - isIndexedInOpenAiVectorStore
                            - externalId
                            - createdAt
                            - updatedAt
                            - deletedAt
                          additionalProperties: false
                        - anyOf:
                            - type: object
                              properties:
                                kind:
                                  type: string
                                  const: connector
                                connectorUuid:
                                  type: string
                              required:
                                - kind
                                - connectorUuid
                              additionalProperties: false
                            - type: object
                              properties:
                                kind:
                                  type: string
                                  const: native
                              required:
                                - kind
                              additionalProperties: false
                    title: Files
                    description: Uploaded files.
                required:
                  - files
                additionalProperties: false
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '404':
          description: Not found
        '500':
          description: Internal server error
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````