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

# Get Document With Chunks

> Fetch a document with all its chunks.

Useful for highlighting specific chunks in the source view.



## OpenAPI

````yaml /openapi.json get /v1/documents/{document_id}/with-chunks
openapi: 3.1.0
info:
  title: Ontora API
  description: >-
    Ontora's public API. Covers interview campaigns, transcripts, synthesis
    reports, graph queries, webhooks, and workspace management. 


    **Authentication**: endpoints accept either a Clerk JWT (`Authorization:
    Bearer <token>`) or a workspace API key (`X-API-Key: ont_...`). Workspace
    keys are managed via `/v1/api-keys`.
  version: 0.1.0
servers: []
security:
  - ClerkJWT: []
  - WorkspaceApiKey: []
tags:
  - name: interviews
    description: Campaign CRUD, lifecycle, contacts, question sets.
  - name: campaign-insights
    description: Synthesis outputs — cartography, roadmap, personas, conversations.
  - name: interview-query
    description: Graph RAG query over campaign data.
  - name: interview-export
    description: Markdown / ZIP exports of transcripts and reports.
  - name: api-keys
    description: Manage workspace-scoped API keys for programmatic access.
  - name: webhook-endpoints
    description: Outbound webhook endpoints for automation.
  - name: booking
    description: Public self-scheduling endpoints for interview participants.
  - name: workspaces
    description: Workspace and membership management.
  - name: vaults
    description: Context vault management.
paths:
  /v1/documents/{document_id}/with-chunks:
    get:
      tags:
        - documents
      summary: Get Document With Chunks
      description: |-
        Fetch a document with all its chunks.

        Useful for highlighting specific chunks in the source view.
      operationId: get_document_with_chunks_v1_documents__document_id__with_chunks_get
      parameters:
        - name: document_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Document Id
        - name: workspace_id
          in: query
          required: true
          schema:
            type: string
            format: uuid
            title: Workspace Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentWithChunksResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    DocumentWithChunksResponse:
      properties:
        document:
          $ref: '#/components/schemas/DocumentResponse'
        chunks:
          items:
            $ref: '#/components/schemas/ChunkResponse'
          type: array
          title: Chunks
          default: []
      type: object
      required:
        - document
      title: DocumentWithChunksResponse
      description: Document with its chunks.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DocumentResponse:
      properties:
        id:
          type: string
          title: Id
        workspace_id:
          type: string
          title: Workspace Id
        source_type:
          type: string
          title: Source Type
        external_id:
          type: string
          title: External Id
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        author_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Author Name
        author_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Author Email
        content_text:
          anyOf:
            - type: string
            - type: 'null'
          title: Content Text
        created_at:
          type: string
          title: Created At
        updated_at:
          type: string
          title: Updated At
      type: object
      required:
        - id
        - workspace_id
        - source_type
        - external_id
        - created_at
        - updated_at
      title: DocumentResponse
      description: Full document details for source viewing.
    ChunkResponse:
      properties:
        id:
          type: string
          title: Id
        idx:
          type: integer
          title: Idx
        text:
          type: string
          title: Text
        start_offset:
          type: integer
          title: Start Offset
        end_offset:
          type: integer
          title: End Offset
      type: object
      required:
        - id
        - idx
        - text
        - start_offset
        - end_offset
      title: ChunkResponse
      description: Document chunk details.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ClerkJWT:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Clerk-issued RS256 JWT.
    WorkspaceApiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: 'Workspace-scoped API key (prefix: `ont_`).'
    HTTPBearer:
      type: http
      scheme: bearer

````