> ## 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.

# Prepare current context or safely rebootstrap a prior capsule

> Returns freshly authorized context. Workspace capsule sources share a database snapshot; entity packs can include separate goal-frame reads. Opt into delivery_mode=delta for exact byte reconstruction against an acknowledged context version. Unknown bases rebootstrap. Transport identity never grants action authority. Model input usage remains separate from optional pinned payload-token accounting. Preparation reads current sources on every call.



## OpenAPI

````yaml /openapi/v1.yaml post /context-pack
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: Controllers
    description: Shadow-only domain controller status and reconciliation
  - 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:
  /context-pack:
    post:
      tags:
        - Projections
      summary: Prepare current context or safely rebootstrap a prior capsule
      description: >-
        Returns freshly authorized context. Workspace capsule sources share a
        database snapshot; entity packs can include separate goal-frame reads.
        Opt into delivery_mode=delta for exact byte reconstruction against an
        acknowledged context version. Unknown bases rebootstrap. Transport
        identity never grants action authority. Model input usage remains
        separate from optional pinned payload-token accounting. Preparation
        reads current sources on every call.
      operationId: prepareContext
      parameters:
        - $ref: '#/components/parameters/IdempotencyKeyOptional'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace_id:
                  type: string
                  format: uuid
                initiative_id:
                  type: string
                  format: uuid
                workstream_id:
                  type: string
                  format: uuid
                task_id:
                  type: string
                  format: uuid
                acknowledged_capsule_id:
                  type: string
                  pattern: ^capsule_[0-9a-f]{24}$
                response_profile:
                  type: string
                  enum:
                    - full
                    - prepared
                  default: full
                  description: >-
                    Prepared returns one scoped capsule with an 8 KiB serialized
                    data bound. Oversized output fails explicitly. Use the full
                    profile for delta transfer.
                delivery_mode:
                  type: string
                  enum:
                    - full
                    - delta
                acknowledged_context_version:
                  type: string
                  pattern: ^sha256:[a-f0-9]{64}$
                reader_tokenizer:
                  type: string
                  enum:
                    - o200k_base
                    - cl100k_base
                max_payload_tokens:
                  type: integer
                  minimum: 1
                  description: >-
                    Requires reader_tokenizer. Oversized required context fails
                    explicitly.
              anyOf:
                - required:
                    - workspace_id
                - required:
                    - initiative_id
                - required:
                    - workstream_id
                - required:
                    - task_id
            example:
              workspace_id: 10000000-0000-4000-8000-000000000001
      responses:
        '200':
          description: >-
            Full context or an opt-in transport delta; absent guarantees remain
            unknown
          content:
            application/json:
              schema:
                type: object
                required:
                  - ok
                  - data
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    additionalProperties: true
                    required:
                      - context_delivery
                    properties:
                      context_delivery:
                        type: object
                        required:
                          - schema_version
                          - mode
                          - consistency
                          - completeness
                          - base_verified
                          - accounting
                        properties:
                          schema_version:
                            type: string
                            enum:
                              - orgx.context-delivery/v1
                          mode:
                            type: string
                            enum:
                              - full
                              - delta
                          consistency:
                            type: string
                            enum:
                              - best_effort_multi_read
                              - database_snapshot
                          completeness:
                            type: string
                            enum:
                              - incomplete
                              - unknown
                          base_verified:
                            type: boolean
                            description: Exact transport base only; not action authority.
                          reusable_for_consequential_action:
                            type: boolean
                            enum:
                              - false
                          rebootstrap_required:
                            type: boolean
                          accounting:
                            type: object
                            description: >-
                              Serialized data bytes include metadata. Model
                              input and expansion tokens are unmeasured (null).
                            additionalProperties: true
              example:
                ok: true
                data:
                  context_delivery:
                    schema_version: orgx.context-delivery/v1
                    mode: full
                    consistency: best_effort_multi_read
                    completeness: unknown
                    base_verified: false
                    reusable_for_consequential_action: false
                    rebootstrap_required: false
                    accounting:
                      model_input_tokens: null
                      tokenizer: null
                      source_expansion_tokens: null
                    performance_profile: unqualified_best_effort
        '400':
          description: Invalid scope or acknowledged capsule ID
        '401':
          description: Authentication required
        '404':
          description: Scoped entity or workspace is unavailable
        '413':
          description: Request body exceeds the supported bound
        '500':
          description: Context preparation failed
      security:
        - bearerAuth: []
components:
  parameters:
    IdempotencyKeyOptional:
      name: Idempotency-Key
      in: header
      required: false
      schema:
        type: string
        minLength: 1
        maxLength: 200
        pattern: ^[A-Za-z0-9][A-Za-z0-9._:/-]{0,199}$
      description: >-
        Accepted for forward compatibility. Replay safety for this operation
        comes from its own state checks, described on the operation.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'OrgX API key, sent as `Authorization: Bearer oxk_...`'

````