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

# Upload files and create data source

> Upload local files (multipart/form-data) or import from URLs (application/json) and immediately create a FILE data source. Returns the same response format as /sources/ endpoint.

Supported file types: CSV, TSV, Excel (.xls/.xlsx), SQLite (.sqlite/.db/.sqlite3), Parquet.
Limits: Max 10GB per file.

Security: URLs are validated to prevent SSRF attacks. Private IPs, localhost, and cloud metadata endpoints are blocked.



## OpenAPI

````yaml https://api.camelai.com/api/schema/ post /api/v1/uploads/upload/
openapi: 3.0.3
info:
  title: camelAI API
  version: 1.0.0 (v1)
  description: API for camelAI - AI-powered data analytics platform
servers:
  - url: https://api.camelai.com
    description: camelAI API server
security: []
paths:
  /api/v1/uploads/upload/:
    post:
      tags:
        - uploads
      summary: Upload files and create data source
      description: >-
        Upload local files (multipart/form-data) or import from URLs
        (application/json) and immediately create a FILE data source. Returns
        the same response format as /sources/ endpoint.


        Supported file types: CSV, TSV, Excel (.xls/.xlsx), SQLite
        (.sqlite/.db/.sqlite3), Parquet.

        Limits: Max 10GB per file.


        Security: URLs are validated to prevent SSRF attacks. Private IPs,
        localhost, and cloud metadata endpoints are blocked.
      operationId: uploads_upload_create
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/FileUploadRequest'
            examples:
              DirectFileUpload(multipart):
                value:
                  files:
                    - file1.csv
                    - file2.xlsx
                  account_name: My Sales Data
                summary: Direct file upload (multipart)
                description: Upload CSV and Excel from local disk and create a source
          application/json:
            schema:
              $ref: '#/components/schemas/URLUploadRequest'
            examples:
              URLImport(S3Presigned):
                value:
                  file_urls:
                    - url: >-
                        https://my-bucket.s3.amazonaws.com/data.csv?X-Amz-Signature=...
                      filename: data.csv
                    - url: https://storage.googleapis.com/public/inventory.parquet
                      filename: inventory.parquet
                  account_name: Cloud Data Import
                summary: URL import (S3 presigned)
                description: Import files from cloud URLs and create a source
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadBadRequest'
          description: ''
      security:
        - ApiKeyAuth: []
components:
  schemas:
    FileUploadRequest:
      type: object
      properties:
        files:
          type: array
          items:
            type: string
            format: binary
          description: >-
            Files to upload directly. Allowed:
            .csv,.tsv,.xls,.xlsx,.sqlite,.db,.sqlite3,.parquet (<=10GB each)
        account_name:
          type: string
          minLength: 1
          description: Name for the data source (auto-generated if not provided)
    URLUploadRequest:
      type: object
      properties:
        file_urls:
          type: array
          items:
            $ref: '#/components/schemas/FileUrlItemRequest'
          description: >-
            List of file URLs to import. Each item must include 'url' and
            'filename'.
        account_name:
          type: string
          minLength: 1
          description: Name for the data source (auto-generated if not provided)
      required:
        - file_urls
    UploadResponse:
      type: object
      properties:
        id:
          type: integer
          description: ID of the created data source
      required:
        - id
    UploadBadRequest:
      type: object
      properties:
        error:
          type: string
          description: Validation error message
      required:
        - error
    FileUrlItemRequest:
      type: object
      properties:
        url:
          type: string
          minLength: 1
          description: HTTP/HTTPS URL to download
        filename:
          type: string
          minLength: 1
          description: Filename to use (with extension)
      required:
        - filename
        - url
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: API key authentication using Bearer scheme

````