> ## 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 Chunk Content

> Edit the content of a specific chunk in a datastore. This operation updates the chunk's text content and regenerates its embeddings.



## OpenAPI

````yaml api-reference/openapi.json put /datastores/{datastore_id}/chunks/{content_id}/content
openapi: 3.1.0
info:
  title: Endpoints
  version: '1.0'
servers:
  - url: https://api.contextual.ai/v1
security:
  - BearerAuth: []
paths:
  /datastores/{datastore_id}/chunks/{content_id}/content:
    put:
      tags:
        - /datastores/{id}/documents
      summary: Edit Chunk Content
      description: >-
        Edit the content of a specific chunk in a datastore. This operation
        updates the chunk's text content and regenerates its embeddings.
      operationId: >-
        edit_chunk_content_datastores__datastore_id__chunks__content_id__content_put
      parameters:
        - name: datastore_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: Datastore ID of the datastore containing the chunk
            title: Datastore Id
          description: Datastore ID of the datastore containing the chunk
        - name: content_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: Content ID of the chunk to edit
            title: Content Id
          description: Content ID of the chunk to edit
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EditChunkContentRequest'
              description: Request body containing the new content text
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmptyResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    EditChunkContentRequest:
      properties:
        content:
          type: string
          title: Content
          description: The new content text for the chunk
      additionalProperties: false
      type: object
      required:
        - content
      title: EditChunkContentRequest
      description: >-
        This class contains all editable content associated with an update to a
        chunk.
    EmptyResponse:
      properties: {}
      type: object
      title: EmptyResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````