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

# Get a run

> Status and result of a run. Use it to follow a `pending` run sent to the human review queue:
once a human has picked, `status` becomes `resolved` and `choice` carries the human choice.




## OpenAPI

````yaml /openapi.yaml get /runs/{run_id}
openapi: 3.1.0
info:
  title: Branch Pilot API
  version: '1.0'
  summary: The AI decision layer for workflows.
  description: >
    One endpoint per decision. Send the input your decision expects, get a typed
    answer with

    calibrated probabilities, a confidence and the engine that produced it.


    Personal data in declared PII fields (and detected in free text) is
    pseudonymized before

    any model call; only the pseudonymized input is logged.
  contact:
    email: hello@branchpilot.ai
  termsOfService: https://branchpilot.ai/terms
servers:
  - url: https://api.branchpilot.ai/v1
    description: Production
security:
  - apiKey: []
tags:
  - name: Decide
  - name: Runs
  - name: Decisions
paths:
  /runs/{run_id}:
    get:
      tags:
        - Runs
      summary: Get a run
      description: >
        Status and result of a run. Use it to follow a `pending` run sent to the
        human review queue:

        once a human has picked, `status` becomes `resolved` and `choice`
        carries the human choice.
      operationId: getRun
      parameters:
        - $ref: '#/components/parameters/runId'
      responses:
        '200':
          description: The run.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Run'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    runId:
      name: run_id
      in: path
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    Run:
      allOf:
        - $ref: '#/components/schemas/DecideResponse'
        - type: object
          properties:
            status:
              type: string
              enum:
                - ok
                - uncertain
                - pending
                - resolved
                - error
            resolved_by_human:
              type: boolean
              description: Present when a human resolved the run in the review queue.
            feedback:
              type:
                - string
                - 'null'
              enum:
                - good
                - bad
                - null
            error_code:
              type: string
              description: Present when status is `error`.
            created_at:
              type: string
              format: date-time
    DecideResponse:
      type: object
      required:
        - run_id
        - decision
        - version
        - status
        - probabilities
        - confidence
        - engine
        - model
        - latency_ms
        - pii_redacted
      properties:
        run_id:
          type: string
          format: uuid
        decision:
          type: string
        version:
          type: integer
        status:
          type: string
          enum:
            - ok
            - uncertain
            - pending
          description: >-
            `uncertain`: confidence below the decision threshold. `pending`:
            sent to the human review queue.
        choice:
          type: string
          description: Route decisions. `__uncertain__` when status is `uncertain`.
        score:
          type: number
          minimum: 0
          maximum: 100
          description: Score decisions, remapped to 0–100.
        raw_score:
          type: number
          description: Score decisions, weighted position on the 0..N-1 level scale.
        legend:
          type: object
          additionalProperties:
            type: string
          description: Score decisions, level index → label.
        labels:
          type: array
          items:
            type: string
          description: >-
            Classify decisions, labels whose probability reached their
            threshold.
        probabilities:
          type: object
          additionalProperties:
            type: number
        confidence:
          type: number
          minimum: 0
          maximum: 1
        confidence_source:
          type: string
          enum:
            - calibrated
            - self_reported
        engine:
          type: string
          enum:
            - jev
            - llm_fallback
        model:
          type: string
        latency_ms:
          type: integer
        pii_redacted:
          type: integer
          description: >-
            Number of personal-data substitutions performed before the model
            call.
        fallback_reason:
          type: string
          description: >-
            Present when the LLM fallback answered; why the primary engine did
            not.
        review_url:
          type: string
          format: uri
          description: Present when status is `pending`.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            details: {}
  responses:
    Unauthorized:
      description: Missing, invalid or revoked API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Unknown resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: An API key created in Settings → API keys (`bp_live_…` or `bp_test_…`).

````