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

# List Datastores

> Retrieve a list of `Datastores`.

Performs `cursor`-based pagination if the number of `Datastores` exceeds the requested `limit`. The returned `cursor` can be passed to the next `GET /datastores` call to retrieve the next set of `Datastores`.



## OpenAPI

````yaml api-reference/openapi.json get /datastores
openapi: 3.1.0
info:
  title: Endpoints
  version: '1.0'
servers:
  - url: https://api.contextual.ai/v1
security:
  - BearerAuth: []
paths:
  /datastores:
    get:
      tags:
        - /datastores
      summary: List Datastores
      description: >-
        Retrieve a list of `Datastores`.


        Performs `cursor`-based pagination if the number of `Datastores` exceeds
        the requested `limit`. The returned `cursor` can be passed to the next
        `GET /datastores` call to retrieve the next set of `Datastores`.
      operationId: list_datastores_datastores_get
      parameters:
        - name: agent_id
          in: query
          required: false
          schema:
            type: string
            format: uuid
            description: >-
              ID of the agent used to filter datastores. If provided, only
              datastores linked to this agent will be returned.
            title: Agent Id
          description: >-
            ID of the agent used to filter datastores. If provided, only
            datastores linked to this agent will be returned.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            description: Maximum number of datastores to return
            default: 1000
            title: Limit
          description: Maximum number of datastores to return
        - name: cursor
          in: query
          required: false
          schema:
            type: string
            description: >-
              Cursor from the previous call to list datastores, used to retrieve
              the next set of results
            title: Cursor
          description: >-
            Cursor from the previous call to list datastores, used to retrieve
            the next set of results
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatastoreOutputList'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    DatastoreOutputList:
      properties:
        next_cursor:
          type: string
          title: Next Cursor
          description: >-
            Next cursor to continue pagination. Omitted if there are no more
            datastores to retrieve.
        datastores:
          items:
            $ref: '#/components/schemas/DatastoreOutputEntry'
          type: array
          title: Datastores
          description: List of all datastores
      type: object
      required:
        - datastores
      title: DatastoreOutputList
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DatastoreOutputEntry:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: ID of the datastore
        name:
          type: string
          title: Name
          description: Name of the datastore
        datastore_type:
          type: string
          const: UNSTRUCTURED
          title: Datastore Type
          description: Type of the datastore
        configuration:
          $ref: '#/components/schemas/UnstructuredDatastoreConfigModel'
          title: Configuration
          description: Configuration of the datastore
          default: {}
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Timestamp of when the datastore was created, in ISO format
      type: object
      required:
        - id
        - name
        - datastore_type
        - created_at
      title: DatastoreOutputEntry
      description: Datastore output entry with additional fields for public API.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    UnstructuredDatastoreConfigModel:
      properties:
        parsing:
          $ref: '#/components/schemas/DatastoreParseConfiguration'
          description: Configuration for document parsing
        chunking:
          $ref: '#/components/schemas/ChunkingConfiguration'
          description: Configuration for document chunking
        html_config:
          $ref: '#/components/schemas/HtmlConfiguration'
          description: Configuration for HTML Extraction
      additionalProperties: false
      type: object
      title: UnstructuredDatastoreConfigModel
      description: Configuration for unstructured datastores.
    DatastoreParseConfiguration:
      properties:
        figure_captioning_prompt:
          type: string
          title: Figure Captioning Prompt
          description: >-
            Prompt to use for generating image captions. Must be non-empty if
            `figure_caption_mode` is `custom`. Otherwise, must be null.
        figure_caption_mode:
          $ref: '#/components/schemas/DatastoreFigureCaptionMode'
          title: Figure Caption Mode
          description: >-
            Mode for figure captioning. Options are `default`, `custom`, or
            `ignore`. Set to `ignore` to disable figure captioning. Set to
            `default` to use the default figure prompt, which generates a
            detailed caption for each figure. Set to `custom` to use a custom
            prompt.
                    
          default: default
        enable_split_tables:
          type: boolean
          title: Enable Split Tables
          description: >-
            Whether to enable table splitting, which splits large tables into
            smaller tables with at most `max_split_table_cells` cells each. In
            each split table, the table headers are reproduced as the first
            row(s). This is useful for preserving context when tables are too
            large to fit into one chunk.
                    
          default: false
        max_split_table_cells:
          type: integer
          title: Max Split Table Cells
          description: >-
            Maximum number of cells for split tables. Ignored if
            `enable_split_tables` is False.
          default: 100
        ingestion_tier:
          anyOf:
            - $ref: '#/components/schemas/IngestionTier'
            - type: 'null'
          description: >-
            Ingestion tier for preset extraction configurations. Options:
            STANDARD, ADVANCED, PREMIUM, or None. When None (default), uses
            explicit config values or system defaults. When set, applies
            tier-based presets that can be overridden by explicit config.
      type: object
      title: DatastoreParseConfiguration
      description: >-
        Configuration for data extraction settings from documents at datastore
        level. Controls settings for document parsing. Includes those from
        `/parse` API along with some extra ingestion-only ones.
    ChunkingConfiguration:
      properties:
        chunking_mode:
          $ref: '#/components/schemas/ChunkingMode'
          title: Chunking Mode
          description: >-
            Chunking mode to use. Options are: `hierarchy_depth`,
            `hierarchy_heading`, `static_length`, `page_level`.
            `hierarchy_depth` groups chunks of the same hierarchy level or
            below, additionally merging or splitting based on length
            constraints. `hierarchy_heading` splits chunks at every heading in
            the document hierarchy, additionally merging or splitting based on
            length constraints. `static_length` creates chunks of a fixed
            length. `page_level` creates chunks that cannot run over page
            boundaries.
          default: hierarchy_depth
        max_chunk_length_tokens:
          type: integer
          maximum: 4096
          minimum: 512
          title: Max Chunk Length Tokens
          description: >-
            Target maximum length of text tokens chunks for chunking. Chunk
            length may exceed this value in some edge cases.
          default: 768
        min_chunk_length_tokens:
          type: integer
          maximum: 3712
          minimum: 128
          title: Min Chunk Length Tokens
          description: >-
            Target minimum length of chunks in tokens. Must be at least 384
            tokens less than `max_chunk_length_tokens`. Chunk length may be
            shorter than this value in some edge cases. Ignored if
            `chunking_mode` is `page_level`.
          default: 384
        enable_hierarchy_based_contextualization:
          type: boolean
          title: Enable Hierarchy Based Contextualization
          description: Whether to enable section-based contextualization for chunking
          default: true
      type: object
      title: ChunkingConfiguration
      description: Configuration for document chunking settings.
    HtmlConfiguration:
      properties:
        max_chunk_length_tokens:
          type: integer
          maximum: 4096
          minimum: 512
          title: Max Chunk Length Tokens
          description: >-
            Target maximum length of text tokens chunks for chunking. Chunk
            length may exceed this value in some edge cases.
          default: 768
      type: object
      title: HtmlConfiguration
      description: Configuration for HTML document ingestion settings.
    DatastoreFigureCaptionMode:
      type: string
      enum:
        - default
        - custom
        - ignore
      title: DatastoreFigureCaptionMode
      description: >-
        Mode for figure captioning.


        - `default`: Use the default figure prompt, which generates a detailed
        caption for each figure.


        - `custom`: Use a custom prompt.


        - `ignore`: Disable figure captioning.
    IngestionTier:
      type: string
      enum:
        - STANDARD
        - ADVANCED
        - PREMIUM
      title: IngestionTier
      description: Ingestion tier levels that determine extraction quality and cost.
    ChunkingMode:
      type: string
      enum:
        - hierarchy_depth
        - hierarchy_heading
        - static_length
        - page_level
      title: ChunkingMode
      description: >-
        Defines available chunking strategies.


        - `hierarchy_depth`: Creates a new chunk whenever a higher-level section
        heading is encountered.


        - `hierarchy_heading`: Creates a new chunk whenever any section heading
        is encountered.


        - `static_length`: Creates chunks of a fixed length.

        - `page_level`: Creates chunks that cannot run over page boundaries.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````