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

# Upload files to an existing dataset



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/user/dataset/upload
openapi: 3.1.0
info:
  title: 4MINDS API
  version: v1
  description: >-
    OpenAPI spec for the 4MINDS-native API (`/api/v1`), generated from the
    Python client's request/response definitions. Successful responses use the
    envelope `{"status":"success","data": ...}`; errors use
    `{"status":"error","message": ...}`.
servers:
  - url: https://api.4minds.ai
security:
  - bearerAuth: []
tags:
  - name: Models
  - name: Conversations
  - name: Datasets
  - name: Evaluations
  - name: Inference
paths:
  /api/v1/user/dataset/upload:
    post:
      tags:
        - Datasets
      summary: Upload files to an existing dataset
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/DatasetUpload'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - data
                properties:
                  status:
                    type: string
                    enum:
                      - success
                  data:
                    $ref: '#/components/schemas/UploadReceipt'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
components:
  schemas:
    DatasetUpload:
      type: object
      required:
        - dataset_id
      properties:
        dataset_id:
          type: string
        files:
          type: array
          items:
            type: string
            format: binary
    UploadReceipt:
      additionalProperties: true
      description: >-
        Represents a successful data batch upload confirmation tracking
        metadata.
      properties:
        success:
          title: Success
          type: boolean
        dataset_id:
          title: Dataset Id
          type: integer
        failed_files:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          title: Failed Files
        files_uploaded:
          default: 0
          description: Count of successfully loaded files.
          title: Files Uploaded
          type: integer
        files_failed:
          default: 0
          description: Count of rejected or failed files.
          title: Files Failed
          type: integer
        total_size:
          default: 0
          description: Combined byte capacity of the upload payload batch.
          title: Total Size
          type: integer
      required:
        - success
        - dataset_id
      title: UploadReceipt
      type: object
    ErrorEnvelope:
      type: object
      required:
        - status
        - message
      properties:
        status:
          type: string
          enum:
            - error
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Static, non-expiring API key: `Authorization: Bearer
        <FOURMINDS_API_KEY>`.

````