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

# Get Content Chunks

> Get all chunks/vectors for a specific content in a collection.

Returns all the chunks (text segments with embeddings) that were created
when processing this content in the specified collection. This is useful for:

- Debugging vector search results
- Analyzing how content was chunked
- Inspecting chunk metadata
- Retrieving embeddings for analysis

**Important:** The same content can have different chunks in different collections
(due to different chunking strategies, embedding models, etc.), so `collection_id`
is required to ensure you get the correct set of chunks.

Args:
    content_id: The unique identifier for the content
    collection_id: The collection ID (ensures correct chunks are retrieved)
    include_embeddings: Whether to include embedding vectors (default: false to save bandwidth)
    
Returns:
    ContentChunksResponse with list of chunks and metadata
    
Example:
    GET /contents/con_abc123/chunks?collection_id=col_xyz789&include_embeddings=false

Response:
    {
        "content_id": "con_abc123",
        "collection_id": "col_xyz789",
        "chunks": [
            {
                "id": "vec_chunk1",
                "content_id": "con_abc123",
                "content": "First chunk text...",
                "embedding": null,  // or array if include_embeddings=true
                "meta_data": {"page": 1, "section": "intro"},
                "collection_id": "col_xyz789",
                "workspace_id": "wsp_123"
            },
            ...
        ],
        "total_chunks": 42,
        "includes_embeddings": false
    }

Raises:
    404: If content not found or collection not accessible
    500: If error retrieving chunks



## OpenAPI

````yaml api-reference/openapi.json get /api/v1/contents/{content_id}/chunks
openapi: 3.1.0
info:
  title: FastAPI app
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/contents/{content_id}/chunks:
    get:
      tags:
        - Contents
      summary: Get Content Chunks
      description: >-
        Get all chunks/vectors for a specific content in a collection.


        Returns all the chunks (text segments with embeddings) that were created

        when processing this content in the specified collection. This is useful
        for:


        - Debugging vector search results

        - Analyzing how content was chunked

        - Inspecting chunk metadata

        - Retrieving embeddings for analysis


        **Important:** The same content can have different chunks in different
        collections

        (due to different chunking strategies, embedding models, etc.), so
        `collection_id`

        is required to ensure you get the correct set of chunks.


        Args:
            content_id: The unique identifier for the content
            collection_id: The collection ID (ensures correct chunks are retrieved)
            include_embeddings: Whether to include embedding vectors (default: false to save bandwidth)
            
        Returns:
            ContentChunksResponse with list of chunks and metadata
            
        Example:
            GET /contents/con_abc123/chunks?collection_id=col_xyz789&include_embeddings=false

        Response:
            {
                "content_id": "con_abc123",
                "collection_id": "col_xyz789",
                "chunks": [
                    {
                        "id": "vec_chunk1",
                        "content_id": "con_abc123",
                        "content": "First chunk text...",
                        "embedding": null,  // or array if include_embeddings=true
                        "meta_data": {"page": 1, "section": "intro"},
                        "collection_id": "col_xyz789",
                        "workspace_id": "wsp_123"
                    },
                    ...
                ],
                "total_chunks": 42,
                "includes_embeddings": false
            }

        Raises:
            404: If content not found or collection not accessible
            500: If error retrieving chunks
      operationId: get_content_chunks_api_v1_contents__content_id__chunks_get
      parameters:
        - name: content_id
          in: path
          required: true
          schema:
            type: string
            title: Content Id
        - name: collection_id
          in: query
          required: true
          schema:
            type: string
            description: Collection ID (required to ensure correct chunks)
            title: Collection Id
          description: Collection ID (required to ensure correct chunks)
        - name: include_embeddings
          in: query
          required: false
          schema:
            type: boolean
            description: Include embedding vectors (can be large)
            default: false
            title: Include Embeddings
          description: Include embedding vectors (can be large)
        - name: X-Workspace-Id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: The workspace ID
            title: X-Workspace-Id
          description: The workspace ID
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentChunksResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - DualAuthScheme: []
components:
  schemas:
    ContentChunksResponse:
      properties:
        content_id:
          type: string
          title: Content Id
          description: Content ID
        collection_id:
          type: string
          title: Collection Id
          description: Collection ID
        chunks:
          items:
            $ref: '#/components/schemas/ContentChunk'
          type: array
          title: Chunks
          description: List of chunks
        total_chunks:
          type: integer
          title: Total Chunks
          description: Total number of chunks
        includes_embeddings:
          type: boolean
          title: Includes Embeddings
          description: Whether embeddings are included
      type: object
      required:
        - content_id
        - collection_id
        - chunks
        - total_chunks
        - includes_embeddings
      title: ContentChunksResponse
      description: Schema for content chunks response.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ContentChunk:
      properties:
        id:
          type: string
          title: Id
          description: Chunk/vector ID
        content_id:
          type: string
          title: Content Id
          description: Parent content ID
        content:
          type: string
          title: Content
          description: Chunk text content
        embedding:
          anyOf:
            - items:
                type: number
              type: array
            - type: 'null'
          title: Embedding
          description: Embedding vector (optional, can be large)
        meta_data:
          additionalProperties: true
          type: object
          title: Meta Data
          description: Chunk metadata
        collection_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Collection Id
          description: Collection ID
        workspace_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Workspace Id
          description: Workspace ID
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Chunk name (standard PgVector only)
        filters:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Filters
          description: Filters (standard PgVector only)
        created_at:
          anyOf:
            - {}
            - type: 'null'
          title: Created At
          description: Creation timestamp (standard PgVector only)
      type: object
      required:
        - id
        - content_id
        - content
      title: ContentChunk
      description: Schema for a content chunk/vector.
    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:
    DualAuthScheme:
      type: http
      scheme: bearer

````