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

# Edit Datastore Configuration



## OpenAPI

````yaml api-reference/openapi.json put /datastores/{datastore_id}
openapi: 3.1.0
info:
  title: Endpoints
  version: '1.0'
servers:
  - url: https://api.contextual.ai/v1
security:
  - BearerAuth: []
paths:
  /datastores/{datastore_id}:
    put:
      tags:
        - /datastores
      summary: Edit Datastore Configuration
      operationId: edit_datastore_configuration_datastores__datastore_id__put
      parameters:
        - name: datastore_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: ID of the datastore to edit
            title: Datastore Id
          description: ID of the datastore to edit
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EditDatastoreInput'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EditDatastoreOutput'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    EditDatastoreInput:
      properties:
        name:
          type: string
          title: Name
          description: Name of the datastore
        configuration:
          $ref: '#/components/schemas/UnstructuredDatastoreConfigModel'
          title: Configuration
          description: >-
            Configuration of the datastore. If not provided, current
            configuration is retained.
          default: {}
      type: object
      title: EditDatastoreInput
      description: Input model for editing a datastore.
    EditDatastoreOutput:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: ID of the datastore
      type: object
      required:
        - id
      title: EditDatastoreOutput
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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.
    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
    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

````