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

# Command demo repo

> Requires the `settlements:write` scope (as an M2M scope or a user permission).

Take an action a snapshot offered, at the revision the caller read. In this release no action is offered and no command is accepted: once the credential, the actor and the repo are verified, every command answers 503 HTTP_ERROR `Repo execution is not qualified` and nothing is written. A 503 is not an accepted command.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/demo/repos/{repo_id}/commands
openapi: 3.1.0
info:
  title: Keystone API
  description: Settlement orchestration API for tokenized Real-World Assets (RWAs).
  version: 1.0.0
  x-keystone-api-contract-version: 0.9.0
  x-keystone-source-revision: d54830817b62960fa380d4f782f341effe7185b2
servers:
  - url: https://api-staging.keystoneos.xyz
    description: Staging (sandbox)
  - url: https://api.keystoneos.xyz
    description: Production
security:
  - bearerAuth: []
tags:
  - name: health
    description: Health and version checks.
  - name: platforms
    description: Register and manage your platform profile.
  - name: environments
    description: Manage platform environments (sandbox, production).
  - name: settlement-templates
    description: View and manage settlement templates.
  - name: settlements
    description: Initiate, monitor, and manage settlements.
  - name: sessions
    description: Create and manage browser-safe session tokens for frontend widgets.
  - name: instructions
    description: Submit and manage settlement instructions.
  - name: invitations
    description: Invite team members to your platform.
  - name: members
    description: Manage platform team members and roles.
  - name: webhooks
    description: Configure webhook endpoints for real-time event notifications.
  - name: security
    description: IP allowlisting and API access controls.
  - name: activity
    description: Audit trail of platform actions.
  - name: dashboard
    description: Dashboard metrics and statistics.
  - name: callbacks
    description: Provider callback handlers (internal).
  - name: alchemy-webhooks
    description: Alchemy blockchain event webhooks (internal).
  - name: chains
    description: Supported blockchain networks for settlement.
  - name: demo-repos
    description: >-
      The BitGo repo demo: an immutable record of one linked test-network repo.
      These routes exist only in a non-production deployment that carries the
      operator's trusted configuration; elsewhere the paths do not exist.
  - name: admin
    description: KeyStone internal administration endpoints.
  - name: admin-platforms
    description: Admin platform management.
  - name: admin-settlements
    description: Admin settlement oversight and intervention.
  - name: admin-compliance
    description: Admin compliance check management.
  - name: admin-activity
    description: Admin system-wide activity logs.
  - name: admin-webhooks
    description: Admin webhook diagnostics.
  - name: internal
    description: Keystone-internal worker endpoints.
  - name: internal-compliance
    description: Internal compliance engine endpoints.
paths:
  /v1/demo/repos/{repo_id}/commands:
    post:
      tags:
        - demo-repos
      summary: Command demo repo
      description: >-
        Requires the `settlements:write` scope (as an M2M scope or a user
        permission).


        Take an action a snapshot offered, at the revision the caller read. In
        this release no action is offered and no command is accepted: once the
        credential, the actor and the repo are verified, every command answers
        503 HTTP_ERROR `Repo execution is not qualified` and nothing is written.
        A 503 is not an accepted command.
      operationId: command_repo_v1_demo_repos__repo_id__commands_post
      parameters:
        - name: repo_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Repo Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DemoRepoCommandRequest'
      responses:
        '403':
          description: >-
            INSUFFICIENT_SCOPES: the credential lacks the scope, or its identity
            is not bound to a demo repo actor in its active environment, or the
            requested view is not granted. SESSION_WRITE_DENIED: a session token
            on a write. NO_ENVIRONMENT_CONTEXT: a user token without the
            X-Keystone-Environment header.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: >-
            HTTP_ERROR: `Repo not found` for an identity the caller's actor
            holds no role on.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: 'Validation failed: the body is not the closed camelCase shape.'
        '503':
          description: >-
            HTTP_ERROR: `Repo execution is not qualified`. Provider execution is
            not qualified; no command, event or revision is written.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    DemoRepoCommandRequest:
      properties:
        schemaVersion:
          type: string
          const: bitgo-repo-demo.v1
          title: Schemaversion
        actionId:
          type: string
          pattern: ^[\x21-\x7E]{1,255}$
          title: Actionid
        expectedRevision:
          type: string
          maxLength: 20
          pattern: ^(0|[1-9][0-9]*)$
          title: Expectedrevision
        idempotencyKey:
          type: string
          maxLength: 255
          minLength: 1
          title: Idempotencykey
          description: >-
            Your key for safe retries, unique within the environment. A retry
            with the same key and the same request body returns the existing
            resource with Idempotency-Replayed: true; the same key with a
            different body answers 409 IDEMPOTENCY_CONFLICT, and a key whose
            resource recorded no request digest answers 409
            IDEMPOTENCY_REPLAY_UNVERIFIABLE. Keys starting with 'match-' are
            reserved for keys KeyStone derives and are refused.
      additionalProperties: false
      type: object
      required:
        - schemaVersion
        - actionId
        - expectedRevision
        - idempotencyKey
      title: DemoRepoCommandRequest
      description: |-
        A request to take one of the actions a snapshot offered, at the
        revision the caller read. The action is named by the identifier the
        snapshot offered it under; a caller can name no state of its own.
    ErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: The rule that refused the request, naming no submitted value.
        code:
          $ref: '#/components/schemas/ErrorCode'
          description: The machine-readable error code to branch on.
        docs_url:
          type: string
          title: Docs Url
          description: The documentation anchor for the code.
          examples:
            - https://docs.keystoneos.xyz/guides/error-codes#http-error
      type: object
      required:
        - detail
        - code
        - docs_url
      title: ErrorResponse
      description: |-
        A refused request: the rule in words, the machine-readable code and
        the documentation anchor for it.
    ErrorCode:
      type: string
      enum:
        - INVALID_TOKEN
        - TOKEN_EXPIRED
        - MISSING_TOKEN
        - INSUFFICIENT_SCOPES
        - NO_PLATFORM_CONTEXT
        - NO_ENVIRONMENT_CONTEXT
        - IP_NOT_ALLOWED
        - AUTH_CONTEXT_NOT_RESOLVED
        - PRINCIPAL_CONFLICT
        - USER_TOKEN_REQUIRED
        - MISSING_CALLBACK_SIGNATURE
        - INVALID_CALLBACK_SIGNATURE
        - CALLBACK_AUTH_NOT_CONFIGURED
        - SETTLEMENT_NOT_FOUND
        - TEMPLATE_NOT_FOUND
        - PLATFORM_NOT_FOUND
        - ENVIRONMENT_NOT_FOUND
        - INSTRUCTION_NOT_FOUND
        - WEBHOOK_ENDPOINT_NOT_FOUND
        - IP_RANGE_NOT_FOUND
        - MEMBER_NOT_FOUND
        - PROVIDER_NOT_FOUND
        - SESSION_NOT_FOUND
        - LEG_NOT_FOUND
        - NOT_REPO_SETTLEMENT
        - PRINCIPAL_NOT_FOUND
        - COMPLIANCE_CHECK_NOT_FOUND
        - SESSION_TOKEN_EXPIRED
        - SESSION_ESCALATION_DENIED
        - SESSION_SETTLEMENT_SCOPE_DENIED
        - SESSION_WRITE_DENIED
        - DEPOSIT_SECRET_NOT_AVAILABLE
        - DEPOSITOR_WALLET_NOT_AVAILABLE
        - NO_ESCROW_FOR_CHAIN
        - LEG_NOT_DEPOSITABLE
        - OFFCHAIN_LEG
        - FUNDING_WINDOW_CLOSED
        - FUNDING_DEADLINE_PASSED
        - LEG_ALREADY_DEPOSITED
        - ESCROW_REGISTRATION_MISMATCH
        - DUPLICATE_RESOURCE
        - IDEMPOTENCY_CONFLICT
        - IDEMPOTENCY_REPLAY_UNVERIFIABLE
        - SETTLEMENT_STATE_CONFLICT
        - NO_VALID_TRANSITION
        - SETTLEMENT_BUSY
        - INSTRUCTION_NOT_CANCELLABLE
        - NOT_REPO_OPEN
        - SETTLEMENT_NOT_FINALIZED
        - CLOSING_ALREADY_EXISTS
        - CLOSING_CREATION_FAILED
        - ENVIRONMENT_DEACTIVATED
        - PRINCIPAL_NO_LSEG_CASE
        - LSEG_TOOLKIT_STALE
        - MEMBER_CHANGE_IN_PROGRESS
        - VALIDATION_ERROR
        - NO_FIELDS_PROVIDED
        - INVALID_PARTY_CONFIGURATION
        - UNSUPPORTED_CHAIN_COMBINATION
        - UNSUPPORTED_SETTLEMENT_CHAIN
        - NON_INTEGRAL_QUANTITY
        - TEMPLATE_INACTIVE
        - UNSUPPORTED_SETTLEMENT_MACHINE
        - UNSUPPORTED_SETTLEMENT_MECHANISM
        - NO_AUTH0_ORGANIZATION
        - SELF_ACTION_FORBIDDEN
        - LAST_MEMBER_MANAGER
        - INVALID_TARGET_STATE
        - CANNOT_RESOLVE_TARGET_STATE
        - UNRECOGNIZED_CLIENT
        - INVALID_API_VERSION
        - RATE_LIMIT_EXCEEDED
        - RATE_LIMIT_UNATTRIBUTED
        - RATE_LIMIT_CREDENTIAL_ISSUANCE
        - AUTH0_ERROR
        - EXTERNAL_SERVICE_ERROR
        - SCREENING_AUDIT_WRITE_FAILED
        - CUSTODY_EXECUTION_UNREADABLE
        - HTTP_ERROR
      title: ErrorCode
      description: Machine-readable error codes for all API error responses.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Auth0 JWT access token. See
        [Authentication](/getting-started/authentication) for details.

````

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