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

# Get Compile Document

> Get a single compile document. Use ?status_only=true for lightweight polling.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/compile/documents/{doc_id}
openapi: 3.1.0
info:
  title: faces
  version: 0.101.0
servers: []
security: []
paths:
  /v1/compile/documents/{doc_id}:
    get:
      tags:
        - Compile
        - Compile - Documents
      summary: Get Compile Document
      description: >-
        Get a single compile document. Use ?status_only=true for lightweight
        polling.
      operationId: get_compile_document_v1_compile_documents__doc_id__get
      parameters:
        - name: doc_id
          in: path
          required: true
          schema:
            type: string
            title: Doc Id
        - name: status_only
          in: query
          required: false
          schema:
            type: boolean
            description: Return only compile status fields (lightweight polling)
            default: false
            title: Status Only
          description: Return only compile status fields (lightweight polling)
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      responses:
        '200':
          description: >-
            The document, or with `status_only=true` only its compile status
            (`CompileStatusResponse`).
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/CompileDocumentResponse'
                  - $ref: '#/components/schemas/CompileStatusResponse'
                title: >-
                  Response 200 Get Compile Document V1 Compile Documents  Doc
                  Id  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CompileDocumentResponse:
      properties:
        rush_premium_usd:
          anyOf:
            - type: number
            - type: 'null'
          title: Rush Premium Usd
          description: >-
            While this compile is queued for its scheduled start: what a rush
            would cost you now, in USD, paid from credit (the difference from
            the standard rate when your plan covers the compile, the whole rush
            price when it is paid as you go). Null once it has started, when it
            is already a rush, or when there is no scheduled start.
        document_id:
          type: string
          title: Document Id
        alias:
          type: string
          title: Alias
        label:
          type: string
          title: Label
        source:
          type: string
          title: Source
        version:
          type: integer
          title: Version
        content:
          type: string
          title: Content
        token_count:
          type: integer
          title: Token Count
        tokens_used:
          type: integer
          title: Tokens Used
        tokens_limit:
          type: integer
          title: Tokens Limit
        synced:
          type: boolean
          title: Synced
        synced_version:
          anyOf:
            - type: integer
            - type: 'null'
          title: Synced Version
          description: >-
            Which revision the compile ran on. Null means this source has never
            been compiled. Lower than `version` means the text has been edited
            since.
        synced_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Synced At
          description: >-
            When this document was last compiled. Null means never, or compiled
            before the instant was recorded.
        read_only:
          type: boolean
          title: Read Only
          default: false
        perspective:
          type: string
          title: Perspective
          default: first-person
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        medium:
          anyOf:
            - type: string
            - type: 'null'
          title: Medium
        warnings:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Warnings
          description: >-
            Advice about the text just saved, as `{code, message}` entries.
            Empty when there is nothing to report.
        stall_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Stall Reason
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
        finishing:
          type: boolean
          title: Finishing
          default: false
        current_counts:
          anyOf:
            - items:
                type: integer
              type: array
            - type: 'null'
          title: Current Counts
        compilable:
          type: boolean
          title: Compilable
          default: true
        compile_blocked_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Compile Blocked Reason
        word_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Word Count
        compile_min_words:
          anyOf:
            - type: integer
            - type: 'null'
          title: Compile Min Words
        style:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Style
        status:
          type: string
          title: Status
          description: >-
            One of `not_compiled`, `transcribing`, `queued`, `compiling`,
            `compiled`,

            `paused`, `failed`.
          readOnly: true
        progress:
          type: number
          title: Progress
          description: How far the compile has got, from 0 to 1. 1 only when `compiled`.
          readOnly: true
        starts_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Starts At
          description: >-
            The compile's scheduled start, ISO 8601 UTC, or when it started.
            Null when it

            starts at once.
          readOnly: true
        rush:
          type: boolean
          title: Rush
          description: >-
            True when this compile was queued as a rush: it starts now, at the
            rush rate.
          readOnly: true
      type: object
      required:
        - document_id
        - alias
        - label
        - source
        - version
        - content
        - token_count
        - tokens_used
        - tokens_limit
        - synced
        - created_at
        - updated_at
        - status
        - progress
        - starts_at
        - rush
      title: CompileDocumentResponse
      description: Shared shape for submit, get, edit responses.
    CompileStatusResponse:
      properties:
        rush_premium_usd:
          anyOf:
            - type: number
            - type: 'null'
          title: Rush Premium Usd
          description: >-
            While this compile is queued for its scheduled start: what a rush
            would cost you now, in USD, paid from credit (the difference from
            the standard rate when your plan covers the compile, the whole rush
            price when it is paid as you go). Null once it has started, when it
            is already a rush, or when there is no scheduled start.
        id:
          type: string
          title: Id
        alias:
          type: string
          title: Alias
        label:
          anyOf:
            - type: string
            - type: 'null'
          title: Label
        stall_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Stall Reason
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
        finishing:
          type: boolean
          title: Finishing
          default: false
        current_counts:
          anyOf:
            - items:
                type: integer
              type: array
            - type: 'null'
          title: Current Counts
        synced:
          type: boolean
          title: Synced
          description: >-
            True when the compile is current with the source as it stands now.
            False covers never compiled AND compiled-then-edited; the pair below
            tells them apart.
          default: false
        version:
          type: integer
          title: Version
          description: The source's current revision.
          default: 1
        synced_version:
          anyOf:
            - type: integer
            - type: 'null'
          title: Synced Version
          description: >-
            The revision the compile read. Lower than `version` means the source
            has changed since. Null means never compiled for a document; for a
            thread, read it against `synced_at`: an instant with no revision is
            a compile from before the revision was recorded, which is unknown,
            not stale.
        synced_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Synced At
          description: >-
            When this source was last compiled. Null means never. For a thread,
            a message whose `timestamp` is later than this is one the compile
            has not read.
        compilable:
          type: boolean
          title: Compilable
          default: true
        compile_blocked_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Compile Blocked Reason
        word_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Word Count
        compile_min_words:
          anyOf:
            - type: integer
            - type: 'null'
          title: Compile Min Words
        status:
          type: string
          title: Status
          description: >-
            One of `not_compiled`, `transcribing`, `queued`, `compiling`,
            `compiled`,

            `paused`, `failed`.
          readOnly: true
        progress:
          type: number
          title: Progress
          description: How far the compile has got, from 0 to 1. 1 only when `compiled`.
          readOnly: true
        starts_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Starts At
          description: >-
            The compile's scheduled start, ISO 8601 UTC, or when it started.
            Null when it

            starts at once.
          readOnly: true
        rush:
          type: boolean
          title: Rush
          description: >-
            True when this compile was queued as a rush: it starts now, at the
            rush rate.
          readOnly: true
      type: object
      required:
        - id
        - alias
        - status
        - progress
        - starts_at
        - rush
      title: CompileStatusResponse
      description: Lightweight status-only response for polling. No messages or content.
    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
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````

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