> ## 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.

# List files in a dataset

> Returns one page of a dataset's files. `total` counts the files that match the filters; with no filters it equals the dataset's `file_count`.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/user/dataset/{dataset_id}/files
openapi: 3.1.0
info:
  title: 4Minds API
  version: v1
  description: >-
    OpenAPI spec for the 4Minds-native API (`/api/v1`).


    Models, Conversations, Datasets and Inference endpoints return plain JSON
    objects or arrays, with no wrapper. Their errors return a `detail` field: a
    string, an object, or an array of validation errors (422).


    Evaluations endpoints use the envelope `{"status":"success","data": ...}`
    for successful responses and `{"status":"error","message": ...}` for errors.


    Every response except a 500 error includes rate-limit headers:
    `x-ratelimit-limit-minute`, `x-ratelimit-remaining-minute`,
    `x-ratelimit-limit-month` and `x-ratelimit-remaining-month`.
servers:
  - url: https://api.4minds.ai
security:
  - bearerAuth: []
tags:
  - name: Models
  - name: Conversations
  - name: Datasets
  - name: Evaluations
  - name: Inference
paths:
  /api/v1/user/dataset/{dataset_id}/files:
    get:
      tags:
        - Datasets
      summary: List files in a dataset
      description: >-
        Returns one page of a dataset's files. `total` counts the files that
        match the filters; with no filters it equals the dataset's `file_count`.
      operationId: listDatasetFiles
      parameters:
        - name: dataset_id
          in: path
          required: true
          schema:
            type: integer
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 200
            default: 50
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
        - name: search
          in: query
          required: false
          description: Case-insensitive match anywhere in the file name.
          schema:
            type: string
        - name: type
          in: query
          required: false
          description: File extension, case-insensitive (e.g. `csv`).
          schema:
            type: string
        - name: name
          in: query
          required: false
          description: >-
            Exact file name, case-insensitive. Repeat the parameter to match
            several names.
          schema:
            type: array
            items:
              type: string
          style: form
          explode: true
        - name: sort
          in: query
          required: false
          description: '`ord` is upload order.'
          schema:
            type: string
            enum:
              - ord
              - name
              - type
              - size
              - rows
              - uploaded_at
            default: ord
        - name: order
          in: query
          required: false
          schema:
            type: string
            enum:
              - asc
              - desc
            default: asc
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatasetFilePage'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/DatasetNotFound'
        '422':
          description: Invalid query parameter or `dataset_id`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                sort:
                  value:
                    detail: 'Unsupported sort key: bogus'
                limit:
                  value:
                    detail:
                      - type: less_than_equal
                        loc:
                          - query
                          - limit
                        msg: Input should be less than or equal to 200
                        input: '201'
                        ctx:
                          le: 200
components:
  schemas:
    DatasetFilePage:
      type: object
      required:
        - items
        - total
        - limit
        - offset
        - has_more
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/DatasetFile'
        total:
          type: integer
          description: Number of files matching the filters.
        limit:
          type: integer
        offset:
          type: integer
        has_more:
          type: boolean
    Error:
      type: object
      required:
        - detail
      properties:
        detail:
          description: An error message, or a list of validation errors.
          oneOf:
            - type: string
            - type: array
              items:
                $ref: '#/components/schemas/ValidationErrorItem'
    DatasetFile:
      type: object
      required:
        - id
        - name
        - type
        - size
        - rows
        - description
        - uploaded_at
      properties:
        id:
          type: integer
        name:
          type: string
        type:
          type: string
          description: File extension.
          examples:
            - csv
        size:
          type: number
          description: Size in bytes.
        rows:
          type: number
        description:
          type:
            - string
            - 'null'
        uploaded_at:
          type: string
          format: date-time
    ValidationErrorItem:
      type: object
      required:
        - type
        - loc
        - msg
      properties:
        type:
          type: string
          examples:
            - missing
        loc:
          type: array
          items:
            oneOf:
              - type: string
              - type: integer
          examples:
            - - body
              - model_name
        msg:
          type: string
        input: {}
        ctx:
          type: object
  responses:
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            detail: Authentication required
    DatasetNotFound:
      description: The dataset doesn't exist, or you don't have access to it.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            missing:
              value:
                detail: Dataset with ID 999999999 not found
            no_access:
              value:
                detail: Not found
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Static, non-expiring API key: `Authorization: Bearer
        <FOURMINDS_API_KEY>`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.