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

# Explicitly prepare or retry a Canvas round

> Requires an authenticated workspace editor and each source session's results
audience. Send retry=true to explicitly request preparation, including the
first manual request; otherwise returns explicit_retry_required. Signed
participant tokens do not authorize preparation. The platform also uses a
server-only internal dispatcher; its credential is not a user API credential.

Uses the selected round's current eligible group summary and server-captured
source identity. A claimed request makes a model call billed through that
source session's owner configuration; the editor need not be its payer.
This can incur cost. A current ready result or active pending claim returns
its status without another model call. Failed preparation requires an
explicit retry; an expired pending claim may be retried after six minutes.
No automatic retry is performed. A source change or newer accepted round
can reject the request. Summary readiness is not Canvas readiness or human
approval, and preparation never advances the chain.

Preparing a replacement after a source change updates the candidate; it
cannot replace an immutable snapshot already bound to an affected review
round. The host must restart that affected continuation in a fresh chain.
Access is rechecked before merging an editor's result. Responses use
private, no-store and never serialize provider prompt/error details.




## OpenAPI

````yaml /api-reference/openapi.yaml post /chains/{instanceId}/extract-bmc
openapi: 3.1.0
info:
  title: Harmonica API
  version: 1.0.0
  description: >
    REST API for the Harmonica structured deliberation platform.

    Provides access to sessions and their data, including creating, updating,
    and querying sessions, plus response submission for active sessions.
  contact:
    name: Harmonica
    url: https://harmonica.chat
servers:
  - url: https://app.harmonica.chat/api/v1
    description: Production
  - url: http://localhost:3000/api/v1
    description: Local development
security:
  - apiKey: []
paths:
  /chains/{instanceId}/extract-bmc:
    post:
      tags:
        - Chains
      summary: Explicitly prepare or retry a Canvas round
      description: >
        Requires an authenticated workspace editor and each source session's
        results

        audience. Send retry=true to explicitly request preparation, including
        the

        first manual request; otherwise returns explicit_retry_required. Signed

        participant tokens do not authorize preparation. The platform also uses
        a

        server-only internal dispatcher; its credential is not a user API
        credential.


        Uses the selected round's current eligible group summary and
        server-captured

        source identity. A claimed request makes a model call billed through
        that

        source session's owner configuration; the editor need not be its payer.

        This can incur cost. A current ready result or active pending claim
        returns

        its status without another model call. Failed preparation requires an

        explicit retry; an expired pending claim may be retried after six
        minutes.

        No automatic retry is performed. A source change or newer accepted round

        can reject the request. Summary readiness is not Canvas readiness or
        human

        approval, and preparation never advances the chain.


        Preparing a replacement after a source change updates the candidate; it

        cannot replace an immutable snapshot already bound to an affected review

        round. The host must restart that affected continuation in a fresh
        chain.

        Access is rechecked before merging an editor's result. Responses use

        private, no-store and never serialize provider prompt/error details.
      operationId: prepareBusinessModelCanvas
      parameters:
        - $ref: '#/components/parameters/chainInstanceId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BmcPrepareRequest'
            example:
              stepIndex: 0
              retry: true
      responses:
        '200':
          description: >-
            Existing claim status or completed preparation; revision is present
            only after a claimed extraction finishes.
          headers:
            Cache-Control:
              schema:
                type: string
              description: private, no-store
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BmcPrepareResponse'
        '400':
          description: Invalid body or missing explicit retry=true.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BmcError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: >-
            Workspace editor/source-results access denied, or a supplied
            internal credential is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BmcError'
        '404':
          description: Chain absent or not a BMC chain.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BmcError'
        '409':
          description: >-
            Current source summary is unavailable or changed, or a newer round
            already supplied the Canvas.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BmcError'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          description: Preparation could not begin due to an internal error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BmcError'
        '502':
          description: >-
            Claimed model preparation failed (bmc_extraction_failed). An
            explicit new retry is required and may incur cost.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BmcError'
components:
  parameters:
    chainInstanceId:
      name: instanceId
      in: path
      required: true
      schema:
        type: string
        minLength: 1
      description: Existing BMC chain instance ID; each chain has its own Canvas.
  schemas:
    BmcPrepareRequest:
      type: object
      additionalProperties: false
      required:
        - stepIndex
      properties:
        stepIndex:
          type: integer
          minimum: 0
        retry:
          type: boolean
          description: >-
            Must be explicitly true for an authenticated editor request,
            including first preparation. Missing or false returns
            explicit_retry_required.
    BmcPrepareResponse:
      type: object
      additionalProperties: false
      required:
        - status
      properties:
        status:
          type: string
          enum:
            - pending
            - ready
            - error
        revision:
          type: integer
          minimum: 0
          description: >-
            Current revision number after a claimed extraction finishes; omitted
            for an unchanged existing claim. Ready does not mean human approval.
    BmcError:
      type: object
      additionalProperties: false
      required:
        - error
        - code
      description: >-
        BMC operation errors use this flat envelope. Authenticator failures on
        writes and rate limits use the standard nested Error envelope.
      properties:
        error:
          type: string
        code:
          type: string
          enum:
            - unauthorized
            - forbidden
            - not_found
            - validation_error
            - explicit_retry_required
            - bmc_changed
            - bmc_invalid_edit
            - bmc_source_missing
            - bmc_extraction_pending
            - bmc_extraction_failed
            - bmc_source_changed
            - bmc_review_required
            - bmc_snapshot_missing
            - bmc_sharing_disabled
            - internal_error
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - unauthorized
                - forbidden
                - not_found
                - validation_error
                - rate_limited
                - payment_required
                - transcript_revision_changed
                - needs_rebuild
                - source_changed
                - internal_error
                - unprocessable
            message:
              type: string
          required:
            - code
            - message
      required:
        - error
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: unauthorized
              message: Invalid or missing API key
    RateLimited:
      description: Rate limit exceeded
      headers:
        Retry-After:
          schema:
            type: integer
          description: Seconds to wait before retrying
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: rate_limited
              message: Rate limit exceeded. Try again in 30 seconds.
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: |
        API key authentication. Pass your key as a Bearer token.
        Keys use the format `hm_live_<32 hex chars>`.
        Generate keys from your Harmonica dashboard settings.

````

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