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

# Read a document

> Returns the document's chunks in reading order, about `max_chars` characters per page. Use it for tables and matrices, which search returns only in part.



## OpenAPI

````yaml https://staging.soma.evarist.com/v1/openapi.json get /workspaces/{workspace_id}/documents/{document_id}
openapi: 3.1.0
info:
  title: Soma API
  summary: 'Your organization''s knowledge: documents, search, knowledge graph, answers.'
  description: >-
    Authenticate with `Authorization: Bearer <token>`: an OAuth access token
    (the Soma CLI and MCP clients get one by signing in) or an API key created
    in Soma under Account settings.
  version: 1.0.0
servers:
  - url: https://staging.soma.evarist.com/v1
security: []
paths:
  /workspaces/{workspace_id}/documents/{document_id}:
    get:
      tags:
        - Documents
      summary: Read a document
      description: >-
        Returns the document's chunks in reading order, about `max_chars`
        characters per page. Use it for tables and matrices, which search
        returns only in part.
      operationId: read_document_workspaces__workspace_id__documents__document_id__get
      parameters:
        - name: workspace_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Workspace Id
        - name: document_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Document Id
        - name: max_chars
          in: query
          required: false
          schema:
            type: integer
            maximum: 60000
            minimum: 2000
            default: 18000
            title: Max Chars
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Cursor
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentContent'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    DocumentContent:
      properties:
        id:
          type: string
          title: Id
        title:
          type: string
          title: Title
        total_chunks:
          type: integer
          title: Total Chunks
        chunks:
          items:
            $ref: '#/components/schemas/Chunk'
          type: array
          title: Chunks
        has_more:
          type: boolean
          title: Has More
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
      type: object
      required:
        - id
        - title
        - total_chunks
        - chunks
        - has_more
      title: DocumentContent
    Error:
      properties:
        error:
          $ref: '#/components/schemas/Body'
      type: object
      required:
        - error
      title: Error
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Chunk:
      properties:
        id:
          type: string
          title: Id
        document_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Document Id
        document_title:
          anyOf:
            - type: string
            - type: 'null'
          title: Document Title
        text:
          type: string
          title: Text
        type:
          type: string
          title: Type
          description: text, table or figure.
          default: text
        page:
          anyOf:
            - type: integer
            - type: 'null'
          title: Page
        source_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Url
          description: Link to the original, when it has one.
      type: object
      required:
        - id
        - text
      title: Chunk
    Body:
      properties:
        type:
          type: string
          title: Type
        message:
          type: string
          title: Message
      type: object
      required:
        - type
        - message
      title: Body
    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:
    HTTPBearer:
      type: http
      description: An OAuth access token (`soma_at_…`) or an API key (`scribe_mcp_…`).
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.