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

# Get the Work Ledger

> Get work, evidence, and receipt totals for a time range.

### Boundaries
When `mode` is `scanned`, the API calculates results from the available ledger rows and
the counts are a lower bound.



## OpenAPI

````yaml /openapi/v1.yaml get /projections/work-ledger
openapi: 3.1.0
info:
  title: OrgX REST API v1
  version: '1'
  description: >-
    Build accountable work into your product with OrgX REST API v1.


    Create work with one field, attach evidence when it is complete, and keep
    the receipt. Every authenticated request is scoped to the workspace resolved
    from your credential.


    Start with `POST /work`. Human guide:
    https://docs.useorgx.com/docs/api/quickstart
  contact:
    name: OrgX Support
    url: https://useorgx.com/support
    email: support@useorgx.com
  license:
    name: Proprietary
    url: https://useorgx.com/terms
servers:
  - url: https://useorgx.com/api/v1
    description: Production
security: []
tags:
  - name: Work
    description: Create accountable work and complete it with evidence
  - name: Initiatives
    description: Organize related work around an outcome
  - name: Operating processes
    description: Evidence-backed company workflow/process lifecycle
  - name: Operating map
    description: Derived, rebuildable Operating Map projection over the process ledger
  - name: Discovery runs
    description: Wizard and deep-search workflow discovery over connected company sources
  - name: Handoffs
    description: Ledger-backed stage handoffs between operating-process stages
  - name: Events
    description: Replayable, workspace-scoped accepted ledger events
  - name: Projections
    description: Workspace-scoped, rebuildable read projections over OrgX sources
  - name: Episodes
    description: Mission-compatible Episode read adapters
  - name: Receipt validation
    description: Account-free Agent Work Receipt schema discovery and conformance
  - name: Receipt import
    description: Authenticated, workspace-scoped import into the hosted receipt ledger
  - name: Workload diagnosis
    description: >-
      Account-free evaluation of time, agents, systems, authority, and
      accountability boundaries
  - name: Content Studio
    description: >-
      Estimate, showcase, checkout, and payment event operations for Content
      Studio
  - name: Decisions
    description: Raise decisions for human ruling and read their state
  - name: Artifacts
    description: Register produced work against the entity it belongs to
  - name: Launches
    description: Preview and run an initiative launch through its spend gates
  - name: Runs
    description: Control agent runs with pause, resume, cancel, and rollback
  - name: Lifecycle
    description: Pause, resume, retry, or cancel work hierarchy nodes and runs
  - name: Deduplication
    description: Claim durable event fingerprints so duplicate triggers fire once
  - name: Credential
    description: >-
      Resolve the calling credential, the workspaces it reaches, and what it may
      do
  - name: API discovery
    description: Account-free error codes, request schemas, and closed vocabularies for v1
externalDocs:
  description: Human-readable OrgX REST API v1 reference
  url: https://docs.useorgx.com/docs/api/public-api
paths:
  /projections/work-ledger:
    get:
      tags:
        - Projections
      summary: Get the Work Ledger
      description: >-
        Get work, evidence, and receipt totals for a time range.


        ### Boundaries

        When `mode` is `scanned`, the API calculates results from the available
        ledger rows and

        the counts are a lower bound.
      operationId: getWorkLedger
      parameters:
        - $ref: '#/components/parameters/WorkspaceIdQuery'
        - name: from
          in: query
          required: false
          schema:
            type: string
            format: date-time
        - name: to
          in: query
          required: false
          schema:
            type: string
            format: date-time
        - name: granularity
          in: query
          required: false
          schema:
            type: string
            enum:
              - day
              - week
              - month
            default: day
        - name: timezone
          in: query
          required: false
          schema:
            type: string
            default: UTC
        - name: include_source_health
          in: query
          required: false
          schema:
            type: boolean
            default: true
      responses:
        '200':
          description: Rebuildable Work Ledger projection
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkLedgerResponse'
              example:
                data:
                  from: '2026-08-18T18:30:00.000Z'
                  to: '2026-08-18T18:30:00.000Z'
                  granularity: day
                  timezone: UTC
                  buckets:
                    - {}
                  clients:
                    - {}
                  initiatives:
                    - {}
                  totals:
                    toolCalls: 0
                    conversations: 0
                    sessions: 0
                    runs: 0
                    receipts: 0
                    decisions: 0
                    artifacts: 0
                    total: 0
                  peakBucketTotal: 0
                  sources:
                    - id: 2d4b7f66-3a2a-4e9d-9ad1-3b2d1b2e4101
                      label: Accepted work
                      table: work_ledger
                      rows: 0
                      unlinkedRows: 0
                      note: Counts reflect accepted work in the selected range.
                  mode: aggregated
                  truncated: false
                  queryMs: 0
                meta: {}
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
      security:
        - bearerAuth: []
        - cookieAuth: []
components:
  parameters:
    WorkspaceIdQuery:
      name: workspace_id
      in: query
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    WorkLedgerResponse:
      type: object
      additionalProperties: false
      required:
        - data
        - meta
      properties:
        data:
          $ref: '#/components/schemas/WorkLedger'
        meta:
          $ref: '#/components/schemas/WorkLedgerMeta'
    WorkLedger:
      type: object
      additionalProperties: false
      required:
        - from
        - to
        - granularity
        - timezone
        - buckets
        - clients
        - initiatives
        - totals
        - peakBucketTotal
        - sources
        - mode
        - truncated
        - queryMs
      properties:
        from:
          type: string
          format: date-time
        to:
          type: string
          format: date-time
        granularity:
          type: string
          enum:
            - day
            - week
            - month
        timezone:
          type: string
        buckets:
          type: array
          items:
            allOf:
              - $ref: '#/components/schemas/WorkLedgerCounts'
              - type: object
                required:
                  - start
                  - end
                  - key
                  - label
                  - longLabel
                  - clients
                  - initiatives
                properties:
                  start:
                    type: string
                    format: date-time
                  end:
                    type: string
                    format: date-time
                  key:
                    type: string
                  label:
                    type: string
                  longLabel:
                    type: string
                  clients:
                    type: array
                    items:
                      $ref: '#/components/schemas/WorkLedgerCounts'
                  initiatives:
                    type: array
                    items:
                      type: object
        clients:
          type: array
          items:
            type: object
        initiatives:
          type: array
          items:
            type: object
        totals:
          $ref: '#/components/schemas/WorkLedgerCounts'
        peakBucketTotal:
          type: integer
          minimum: 0
        sources:
          type: array
          items:
            $ref: '#/components/schemas/WorkLedgerSourceHealth'
        mode:
          type: string
          enum:
            - aggregated
            - scanned
        truncated:
          type: boolean
        queryMs:
          type: integer
          minimum: 0
    WorkLedgerMeta:
      allOf:
        - $ref: '#/components/schemas/ContractMeta'
        - type: object
          required:
            - projectionStatus
            - generatedAt
            - sourceCursor
            - sourceCursorStatus
            - mode
            - truncated
            - queryMs
            - freshness
          properties:
            projectionStatus:
              type: string
              const: derived_work_ledger
            generatedAt:
              type: string
              format: date-time
            sourceCursor:
              type:
                - string
                - 'null'
            sourceCursorStatus:
              type: string
              const: not_available
            mode:
              type: string
              enum:
                - aggregated
                - scanned
            truncated:
              type: boolean
            queryMs:
              type: integer
              minimum: 0
            freshness:
              type: object
              additionalProperties: false
              required:
                - generatedAt
                - windowFrom
                - windowTo
                - sourceHealthMeasured
              properties:
                generatedAt:
                  type: string
                  format: date-time
                windowFrom:
                  type: string
                  format: date-time
                windowTo:
                  type: string
                  format: date-time
                sourceHealthMeasured:
                  type: boolean
    ApiError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: object
            requestId:
              type: string
            timestamp:
              type: string
              format: date-time
            docsUrl:
              type: string
              format: uri
            retryAfter:
              type: integer
              description: Seconds until rate limit resets
    WorkLedgerCounts:
      type: object
      additionalProperties: false
      required:
        - toolCalls
        - conversations
        - sessions
        - runs
        - receipts
        - decisions
        - artifacts
        - total
      properties:
        toolCalls:
          type: integer
          minimum: 0
        conversations:
          type: integer
          minimum: 0
        sessions:
          type: integer
          minimum: 0
        runs:
          type: integer
          minimum: 0
        receipts:
          type: integer
          minimum: 0
        decisions:
          type: integer
          minimum: 0
        artifacts:
          type: integer
          minimum: 0
        total:
          type: integer
          minimum: 0
    WorkLedgerSourceHealth:
      type: object
      additionalProperties: false
      required:
        - id
        - label
        - table
        - rows
        - unlinkedRows
        - note
      properties:
        id:
          type: string
        label:
          type: string
        table:
          type: string
        rows:
          type: integer
          minimum: 0
        unlinkedRows:
          type:
            - integer
            - 'null'
          minimum: 0
        note:
          type:
            - string
            - 'null'
    ContractMeta:
      type: object
      additionalProperties: false
      required:
        - apiVersion
        - workspaceId
      properties:
        apiVersion:
          type: string
          const: '1'
        workspaceId:
          type: string
          format: uuid
        count:
          type: integer
          minimum: 0
  responses:
    BadRequest:
      description: Request validation failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Unauthorized:
      description: Authentication required
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    NotFound:
      description: Resource is unavailable to the caller
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    ServiceUnavailable:
      description: Ledger or workspace authorization is unavailable
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'OrgX API key, sent as `Authorization: Bearer oxk_...`'
    cookieAuth:
      type: apiKey
      in: cookie
      name: __session
      description: Session cookie from web authentication

````