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

# List Datasets

List all the datasets in your organization.


## OpenAPI

````yaml get /documents/v2/datasets
openapi: 3.1.0
info:
  title: Tensorlake API
  description: >-
    Tensorlake Cloud APIs for Sandboxes, Document Ingestion, and Serverless
    Workflows
  license:
    name: ''
  version: 0.1.0
servers:
  - url: https://api.tensorlake.ai/
security:
  - bearerAuth: []
tags:
  - name: Tensorlake Cloud API
    description: >-
      Tensorlake Cloud APIs for Sandboxes, Document Ingestion, and Serverless
      Workflows
paths:
  /documents/v2/datasets:
    get:
      tags:
        - datasets
      operationId: list_datasets_v2
      parameters:
        - name: cursor
          in: query
          description: |-
            Optional cursor for pagination.

            This is a base64-encoded string representing a timestamp.
            It is used to paginate through the results.
          required: false
          schema:
            oneOf:
              - type: 'null'
              - $ref: '#/components/schemas/Cursor'
        - name: direction
          in: query
          description: |-
            The direction of pagination.

            This can be either `next` or `prev`.

            The default is `next`, which means the next page of results will be
            returned.
          required: false
          schema:
            $ref: '#/components/schemas/PaginationDirection'
        - name: limit
          in: query
          description: |-
            The maximum number of results to return per page.

            The default is 25.
          required: false
          schema:
            type: integer
            minimum: 0
        - name: status
          in: query
          description: |-
            The status dataset to filter the results by.

            This is an optional parameter that can be used to filter the results
            by the status of the dataset.

            The possible values are `processing` and `idle``.
          required: false
          schema:
            oneOf:
              - type: 'null'
              - $ref: '#/components/schemas/DatasetStatus'
        - name: name
          in: query
          description: |-
            The name of the dataset to filter the results by.

            This is an optional parameter that can be used to filter the results
            by the name of the dataset.

            Because dataset names are not unique, this will return all datasets
            that match the provided name.
          required: false
          schema:
            type:
              - string
              - 'null'
      responses:
        '200':
          description: List of datasets retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResult_Dataset'
        '401':
          description: Unauthorized. Invalid or missing credentials
        '403':
          description: Forbidden. You do not have permission to access this resource
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
components:
  schemas:
    Cursor:
      type: string
    PaginationDirection:
      type: string
      enum:
        - next
        - prev
    DatasetStatus:
      type: string
      enum:
        - idle
        - processing
    PaginatedResult_Dataset:
      type: object
      required:
        - items
        - has_more
      properties:
        items:
          type: array
          items:
            type: object
            required:
              - name
              - dataset_id
              - status
              - created_at
              - updated_at
            properties:
              name:
                type: string
                description: |-
                  The name of the dataset.

                  This is a human-readable name that identifies the dataset.
                example: Invoices Dataset
              dataset_id:
                type: string
                description: >-
                  The unique identifier for the dataset.


                  This identifier is used to refer to the dataset in API
                  endpoints and

                  operations.


                  This value is automatically generated and is unique within the

                  organization and project context.
                example: dataset_12345
              description:
                type:
                  - string
                  - 'null'
                description: >-
                  An optional description of the dataset.


                  This description is the one provided during dataset creation
                  or update.
                example: This dataset contains invoices for the year 2023.
              status:
                $ref: '#/components/schemas/DatasetStatus'
                description: >-
                  The current status of the dataset.


                  This indicates whether the dataset is currently idle or
                  processing.
              created_at:
                type: string
                description: |-
                  The date and time when the dataset was created.

                  The data is in RFC 3339 format (e.g., "2023-10-01T12:00:00Z").
                example: '2023-10-01T12:00:00Z'
              updated_at:
                type: string
                description: |-
                  The date and time when the dataset was last updated.

                  The data is in RFC 3339 format (e.g., "2023-10-01T12:00:00Z").
                example: '2023-10-01T12:00:00Z'
              analytics:
                oneOf:
                  - type: 'null'
                  - $ref: '#/components/schemas/DatasetParseJobAnalytics'
                    description: >-
                      Understand the status of the dataset and its parse jobs.


                      This field provides insights into the dataset's processing
                      state,

                      including the number of parse jobs in various states
                      (processing,

                      pending, error, successful).


                      To retrieve detailed analytics, you can pass the
                      `include_analytics`

                      query parameter


                      This is useful for monitoring and analytics purposes.
        has_more:
          type: boolean
        next_cursor:
          type:
            - string
            - 'null'
        prev_cursor:
          type:
            - string
            - 'null'
    ApiError:
      type: object
      required:
        - message
        - code
        - timestamp
      properties:
        message:
          type: string
          description: A human-readable error message
        code:
          $ref: '#/components/schemas/ApiErrorCode'
          description: The error code, which can be used to programmatically handle errors
        timestamp:
          type: integer
          format: int64
          description: Millis since Unix epoch; easy to parse in every language
        trace_id:
          type:
            - string
            - 'null'
          description: Optional request correlation-id for distributed tracing
        details:
          description: Optional field-level validation errors, etc.
    DatasetParseJobAnalytics:
      type: object
      required:
        - total_processing_parse_jobs
        - total_pending_parse_jobs
        - total_error_parse_jobs
        - total_successful_parse_jobs
        - total_jobs
      properties:
        total_processing_parse_jobs:
          type: integer
          format: int64
          description: The total number of parse jobs that are on the `processing` state.
        total_pending_parse_jobs:
          type: integer
          format: int64
          description: >-
            The total number of parse jobs that are on the `pending` state.


            Pending parse jobs are those that have been created but not yet
            started

            processing.
        total_error_parse_jobs:
          type: integer
          format: int64
          description: >-
            The total number of parse jobs that have encountered an error during

            processing.


            These jobs have failed to complete successfully and require
            attention.
        total_successful_parse_jobs:
          type: integer
          format: int64
          description: >-
            The total number of parse jobs that have been successfully
            processed.


            These jobs have completed without errors and have produced results.
        total_jobs:
          type: integer
          format: int64
          description: >-
            The total number of parse jobs that have been created for the
            dataset.
    ApiErrorCode:
      oneOf:
        - type: string
          enum:
            - QUOTA_EXCEEDED
        - type: string
          enum:
            - INVALID_JSON_SCHEMA
        - type: string
          enum:
            - INVALID_CONFIGURATION
        - type: string
          enum:
            - INVALID_PAGE_CLASSIFICATION
        - type: string
          enum:
            - ENTITY_NOT_FOUND
        - type: string
          enum:
            - ENTITY_ALREADY_EXISTS
        - type: string
          enum:
            - INVALID_FILE
        - type: string
          enum:
            - INVALID_PAGE_RANGE
        - type: string
          enum:
            - INVALID_MIME_TYPE
        - type: string
          enum:
            - INVALID_DATASET_NAME
        - type: string
          enum:
            - INVALID_JOB_STATE
        - type: string
          enum:
            - INTERNAL_ERROR
        - type: string
          enum:
            - INVALID_MULTIPART
        - type: string
          enum:
            - MULTIPART_STREAM_END
        - type: string
          enum:
            - CLIENT_DISCONNECT
        - type: string
          enum:
            - INVALID_ID
        - type: object
          required:
            - INVALID_QUERY_PARAMS
          properties:
            INVALID_QUERY_PARAMS:
              type: object
              required:
                - property
              properties:
                property:
                  type: string
                message:
                  type:
                    - string
                    - 'null'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````