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

# Read a risk run

> Read the run until it ends. A running run may carry progress: waiting_for_coverage while the factor model scores names_asked names (waited_seconds so far, expected_seconds the likely total, at_most_seconds the longest wait before the run measures what it has), then measuring. Finished results stay for 24 hours. A result with figures includes summary, view, component and the verified analytics reference. A failed run returns 200 with failure_code and reason: engine_refused means change the request; rate_limited and provider_unavailable mean the price provider failed, so start again later with a new request_key; timed_out and cancelled also end a run. Requires itoflow-engine-results.

Operation ID: getRiskRun.



## OpenAPI

````yaml /openapi/itoflow-public.openapi.json get /risk/runs/{run_id}
openapi: 3.1.0
info:
  description: >-
    All Itoflow APIs are experimental and may change without notice. Read-only
    operations marked interactive can be tried from the documentation; the
    others are reference-only.
  title: Itoflow Developer API
  version: 1.0.0
servers:
  - description: Itoflow API
    url: https://api.itoflow.ai
security: []
tags:
  - name: Account
  - name: Billing
  - name: Brokers
  - name: Chat
  - name: Connected MCP servers
  - name: GitHub
  - name: Market data
  - name: Monitors
  - name: Notifications
  - name: Portfolios
  - name: Risk runs
  - name: Sharing and data
  - name: Strategies
paths:
  /risk/runs/{run_id}:
    get:
      tags:
        - Risk runs
      summary: Read a risk run
      description: >-
        Read the run until it ends. A running run may carry progress:
        waiting_for_coverage while the factor model scores names_asked names
        (waited_seconds so far, expected_seconds the likely total,
        at_most_seconds the longest wait before the run measures what it has),
        then measuring. Finished results stay for 24 hours. A result with
        figures includes summary, view, component and the verified analytics
        reference. A failed run returns 200 with failure_code and reason:
        engine_refused means change the request; rate_limited and
        provider_unavailable mean the price provider failed, so start again
        later with a new request_key; timed_out and cancelled also end a run.
        Requires itoflow-engine-results.


        Operation ID: getRiskRun.
      operationId: getRiskRun
      parameters:
        - in: path
          name: run_id
          required: true
          schema:
            pattern: ^[0-9a-f]{32}$
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Gateway_getRiskRunResponse'
          description: Run state
          headers:
            Cache-Control:
              schema:
                const: no-store
                type: string
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Gateway_RiskRunError'
          description: Request failed
          headers:
            Cache-Control:
              schema:
                const: no-store
                type: string
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Gateway_RiskRunError'
          description: The itoflow-engine-results flag is off.
          headers:
            Cache-Control:
              schema:
                const: no-store
                type: string
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Gateway_RiskRunError'
          description: Request failed
          headers:
            Cache-Control:
              schema:
                const: no-store
                type: string
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Gateway_RiskRunError'
          description: Request failed
          headers:
            Cache-Control:
              schema:
                const: no-store
                type: string
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Gateway_RiskRunError'
          description: Request failed
          headers:
            Cache-Control:
              schema:
                const: no-store
                type: string
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Gateway_RiskRunError'
          description: Request failed
          headers:
            Cache-Control:
              schema:
                const: no-store
                type: string
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Gateway_RiskRunError'
          description: Request failed
          headers:
            Cache-Control:
              schema:
                const: no-store
                type: string
      security:
        - bearerAuth: []
components:
  schemas:
    Gateway_getRiskRunResponse:
      anyOf:
        - additionalProperties: false
          properties:
            progress:
              $ref: '#/components/schemas/Gateway_RiskRunProgress'
            status:
              const: running
              type: string
          required:
            - status
          type: object
        - additionalProperties: false
          properties:
            analytics:
              additionalProperties: false
              properties:
                artifact_id:
                  minLength: 1
                  type: string
                content_type:
                  const: application/json
                  type: string
                expires_at:
                  format: date-time
                  pattern: >-
                    ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
                  type: string
                schema_version:
                  const: 2
                  type: number
                sha256:
                  maxLength: 64
                  minLength: 64
                  pattern: ^[a-f0-9]{64}$
                  type: string
                size_bytes:
                  exclusiveMinimum: 0
                  maximum: 9007199254740991
                  type: integer
                stored:
                  additionalProperties: false
                  properties:
                    content_encoding:
                      const: gzip
                      type: string
                    sha256:
                      maxLength: 64
                      minLength: 64
                      pattern: ^[a-f0-9]{64}$
                      type: string
                    size_bytes:
                      exclusiveMinimum: 0
                      maximum: 9007199254740991
                      type: integer
                  required:
                    - content_encoding
                    - size_bytes
                    - sha256
                  type: object
              required:
                - schema_version
                - artifact_id
                - content_type
                - size_bytes
                - sha256
                - stored
                - expires_at
              type: object
            component:
              $ref: '#/components/schemas/Gateway_RiskRunComponent'
            status:
              const: ok
              type: string
            summary:
              $ref: '#/components/schemas/Gateway_RiskRunSummary'
            view:
              $ref: '#/components/schemas/Gateway_RiskRunView'
          required:
            - status
            - view
            - component
            - summary
          type: object
        - additionalProperties: false
          properties:
            analytics:
              additionalProperties: false
              properties:
                artifact_id:
                  minLength: 1
                  type: string
                content_type:
                  const: application/json
                  type: string
                expires_at:
                  format: date-time
                  pattern: >-
                    ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
                  type: string
                schema_version:
                  const: 2
                  type: number
                sha256:
                  maxLength: 64
                  minLength: 64
                  pattern: ^[a-f0-9]{64}$
                  type: string
                size_bytes:
                  exclusiveMinimum: 0
                  maximum: 9007199254740991
                  type: integer
                stored:
                  additionalProperties: false
                  properties:
                    content_encoding:
                      const: gzip
                      type: string
                    sha256:
                      maxLength: 64
                      minLength: 64
                      pattern: ^[a-f0-9]{64}$
                      type: string
                    size_bytes:
                      exclusiveMinimum: 0
                      maximum: 9007199254740991
                      type: integer
                  required:
                    - content_encoding
                    - size_bytes
                    - sha256
                  type: object
              required:
                - schema_version
                - artifact_id
                - content_type
                - size_bytes
                - sha256
                - stored
                - expires_at
              type: object
            component:
              $ref: '#/components/schemas/Gateway_RiskRunComponent'
            status:
              const: partial
              type: string
            summary:
              $ref: '#/components/schemas/Gateway_RiskRunSummary'
            view:
              $ref: '#/components/schemas/Gateway_RiskRunView'
          required:
            - status
            - view
            - component
            - summary
          type: object
        - additionalProperties: false
          properties:
            details:
              $ref: '#/components/schemas/Gateway_RiskRunFaultDetails'
            failure_code:
              enum:
                - engine_refused
                - engine_fault
                - analytics_publication_failed
                - rate_limited
                - provider_unavailable
                - timed_out
                - cancelled
              type: string
            reason:
              description: Why, in a sentence.
              maxLength: 4096
              minLength: 1
              type: string
            status:
              const: failed
              type: string
          required:
            - status
            - failure_code
            - reason
          type: object
    Gateway_RiskRunError:
      additionalProperties: false
      properties:
        error:
          additionalProperties: false
          properties:
            code:
              type: string
            flag:
              type: string
            message:
              type: string
          required:
            - code
            - message
          type: object
      required:
        - error
      type: object
    Gateway_RiskRunProgress:
      oneOf:
        - additionalProperties: false
          properties:
            at_most_seconds:
              description: The most the run will wait; it measures what it has then.
              maximum: 9007199254740991
              minimum: 0
              type: integer
            expected_seconds:
              description: >-
                About how long the wait takes: 2 seconds a name, never more than
                at_most_seconds.
              maximum: 9007199254740991
              minimum: 0
              type: integer
            names_asked:
              description: How many names the run asked the factor model to score.
              maximum: 9007199254740991
              minimum: 0
              type: integer
            stage:
              const: waiting_for_coverage
              type: string
            waited_seconds:
              maximum: 9007199254740991
              minimum: 0
              type: integer
          required:
            - stage
            - names_asked
            - waited_seconds
            - expected_seconds
            - at_most_seconds
          type: object
        - additionalProperties: false
          properties:
            stage:
              const: measuring
              type: string
          required:
            - stage
          type: object
    Gateway_RiskRunComponent:
      additionalProperties: false
      properties:
        artifact_id:
          minLength: 1
          type: string
        as_of:
          pattern: ^\d{4}-\d{2}-\d{2}$
          type: string
        bases:
          additionalProperties:
            additionalProperties: false
            properties:
              basis_id:
                minLength: 1
                type: string
              calculation_definition:
                enum:
                  - daily_line_contribution.v1
                  - start_book_centered.v1
                type: string
              calendar:
                minLength: 1
                type: string
              common_from:
                pattern: ^\d{4}-\d{2}-\d{2}$
                type: string
              common_to:
                pattern: ^\d{4}-\d{2}-\d{2}$
                type: string
              comparator:
                minLength: 1
                type: string
              comparator_from:
                pattern: ^\d{4}-\d{2}-\d{2}$
                type: string
              comparator_path:
                additionalProperties: false
                properties:
                  books:
                    items:
                      additionalProperties: false
                      properties:
                        book_id:
                          minLength: 1
                          type: string
                        effective_close:
                          pattern: ^\d{4}-\d{2}-\d{2}$
                          type: string
                        holdings_date:
                          pattern: ^\d{4}-\d{2}-\d{2}$
                          type: string
                        lines_digest:
                          pattern: ^sha256:[0-9a-f]{64}$
                          type: string
                        weight_basis:
                          minLength: 1
                          type: string
                      required:
                        - book_id
                        - holdings_date
                        - effective_close
                        - weight_basis
                        - lines_digest
                      type: object
                    type: array
                  off_session_quotes:
                    items:
                      additionalProperties: false
                      properties:
                        first_session:
                          pattern: ^\d{4}-\d{2}-\d{2}$
                          type: string
                        last_session:
                          pattern: ^\d{4}-\d{2}-\d{2}$
                          type: string
                        name:
                          minLength: 1
                          type: string
                        quote_date:
                          anyOf:
                            - pattern: ^\d{4}-\d{2}-\d{2}$
                              type: string
                            - type: 'null'
                      required:
                        - name
                        - quote_date
                        - first_session
                        - last_session
                      type: object
                    type: array
                  opening:
                    additionalProperties: false
                    properties:
                      assumption:
                        type:
                          - string
                          - 'null'
                      availability_evidence:
                        type:
                          - string
                          - 'null'
                      book_id:
                        minLength: 1
                        type: string
                      holdings_date:
                        pattern: ^\d{4}-\d{2}-\d{2}$
                        type: string
                      kind:
                        enum:
                          - observed
                          - reconstructed
                        type: string
                      knowledge_cutoff:
                        pattern: ^\d{4}-\d{2}-\d{2}$
                        type: string
                      mapped_close:
                        pattern: ^\d{4}-\d{2}-\d{2}$
                        type: string
                      nearest_after:
                        type:
                          - string
                          - 'null'
                      nearest_before:
                        type:
                          - string
                          - 'null'
                      roll_days:
                        maximum: 9007199254740991
                        minimum: 0
                        type: integer
                      roll_direction:
                        enum:
                          - none
                          - forward
                          - backward
                        type: string
                      selection_reason:
                        minLength: 1
                        type: string
                      target_close:
                        pattern: ^\d{4}-\d{2}-\d{2}$
                        type: string
                    required:
                      - kind
                      - book_id
                      - holdings_date
                      - mapped_close
                      - target_close
                      - knowledge_cutoff
                      - roll_days
                      - roll_direction
                      - selection_reason
                      - nearest_before
                      - nearest_after
                      - availability_evidence
                      - assumption
                    type: object
                  unavailable_resets:
                    anyOf:
                      - items:
                          pattern: ^\d{4}-\d{2}-\d{2}$
                          type: string
                        type: array
                      - type: 'null'
                required:
                  - opening
                  - books
                  - off_session_quotes
                  - unavailable_resets
                type: object
              comparator_symbol:
                minLength: 1
                type: string
              comparator_to:
                pattern: ^\d{4}-\d{2}-\d{2}$
                type: string
              currency:
                type: string
              first_session:
                anyOf:
                  - pattern: ^\d{4}-\d{2}-\d{2}$
                    type: string
                  - type: 'null'
              gap_policy:
                minLength: 1
                type: string
              gap_summary:
                additionalProperties: false
                properties:
                  comparator:
                    additionalProperties: false
                    properties:
                      average_weight:
                        anyOf:
                          - pattern: ^-?\d+(\.\d+)?$
                            type: string
                          - type: 'null'
                      gap_days:
                        maximum: 9007199254740991
                        minimum: 0
                        type: integer
                      names:
                        items:
                          minLength: 1
                          type: string
                        type: array
                      weight_reason:
                        type:
                          - string
                          - 'null'
                    required:
                      - gap_days
                      - names
                      - average_weight
                      - weight_reason
                    type: object
                  subject:
                    additionalProperties: false
                    properties:
                      average_weight:
                        anyOf:
                          - pattern: ^-?\d+(\.\d+)?$
                            type: string
                          - type: 'null'
                      gap_days:
                        maximum: 9007199254740991
                        minimum: 0
                        type: integer
                      names:
                        items:
                          minLength: 1
                          type: string
                        type: array
                      weight_reason:
                        type:
                          - string
                          - 'null'
                    required:
                      - gap_days
                      - names
                      - average_weight
                      - weight_reason
                    type: object
                required:
                  - subject
                  - comparator
                type: object
              horizon:
                anyOf:
                  - enum:
                      - 1d
                      - 5d
                      - 2w
                      - mtd
                      - qtd
                      - ytd
                      - 1y
                      - si
                    type: string
                  - pattern: ^[1-9]\d*d$
                    type: string
              issues:
                items:
                  type: string
                type: array
              price_policy:
                minLength: 1
                type: string
              quality:
                enum:
                  - full
                  - partial
                  - unavailable
                type: string
              requested_from:
                pattern: ^\d{4}-\d{2}-\d{2}$
                type: string
              requested_to:
                pattern: ^\d{4}-\d{2}-\d{2}$
                type: string
              reset_policy:
                minLength: 1
                type: string
              session_count:
                maximum: 9007199254740991
                minimum: 0
                type: integer
              subject:
                minLength: 1
                type: string
              subject_from:
                pattern: ^\d{4}-\d{2}-\d{2}$
                type: string
              subject_path:
                additionalProperties: false
                properties:
                  books:
                    items:
                      additionalProperties: false
                      properties:
                        book_id:
                          minLength: 1
                          type: string
                        effective_close:
                          pattern: ^\d{4}-\d{2}-\d{2}$
                          type: string
                        holdings_date:
                          pattern: ^\d{4}-\d{2}-\d{2}$
                          type: string
                        lines_digest:
                          pattern: ^sha256:[0-9a-f]{64}$
                          type: string
                        weight_basis:
                          minLength: 1
                          type: string
                      required:
                        - book_id
                        - holdings_date
                        - effective_close
                        - weight_basis
                        - lines_digest
                      type: object
                    type: array
                  off_session_quotes:
                    items:
                      additionalProperties: false
                      properties:
                        first_session:
                          pattern: ^\d{4}-\d{2}-\d{2}$
                          type: string
                        last_session:
                          pattern: ^\d{4}-\d{2}-\d{2}$
                          type: string
                        name:
                          minLength: 1
                          type: string
                        quote_date:
                          anyOf:
                            - pattern: ^\d{4}-\d{2}-\d{2}$
                              type: string
                            - type: 'null'
                      required:
                        - name
                        - quote_date
                        - first_session
                        - last_session
                      type: object
                    type: array
                  opening:
                    additionalProperties: false
                    properties:
                      assumption:
                        type:
                          - string
                          - 'null'
                      availability_evidence:
                        type:
                          - string
                          - 'null'
                      book_id:
                        minLength: 1
                        type: string
                      holdings_date:
                        pattern: ^\d{4}-\d{2}-\d{2}$
                        type: string
                      kind:
                        enum:
                          - observed
                          - reconstructed
                        type: string
                      knowledge_cutoff:
                        pattern: ^\d{4}-\d{2}-\d{2}$
                        type: string
                      mapped_close:
                        pattern: ^\d{4}-\d{2}-\d{2}$
                        type: string
                      nearest_after:
                        type:
                          - string
                          - 'null'
                      nearest_before:
                        type:
                          - string
                          - 'null'
                      roll_days:
                        maximum: 9007199254740991
                        minimum: 0
                        type: integer
                      roll_direction:
                        enum:
                          - none
                          - forward
                          - backward
                        type: string
                      selection_reason:
                        minLength: 1
                        type: string
                      target_close:
                        pattern: ^\d{4}-\d{2}-\d{2}$
                        type: string
                    required:
                      - kind
                      - book_id
                      - holdings_date
                      - mapped_close
                      - target_close
                      - knowledge_cutoff
                      - roll_days
                      - roll_direction
                      - selection_reason
                      - nearest_before
                      - nearest_after
                      - availability_evidence
                      - assumption
                    type: object
                  unavailable_resets:
                    anyOf:
                      - items:
                          pattern: ^\d{4}-\d{2}-\d{2}$
                          type: string
                        type: array
                      - type: 'null'
                required:
                  - opening
                  - books
                  - off_session_quotes
                  - unavailable_resets
                type: object
              subject_to:
                pattern: ^\d{4}-\d{2}-\d{2}$
                type: string
            required:
              - basis_id
              - calculation_definition
              - subject
              - comparator
              - comparator_symbol
              - currency
              - horizon
              - requested_from
              - requested_to
              - subject_from
              - subject_to
              - comparator_from
              - comparator_to
              - common_from
              - common_to
              - calendar
              - session_count
              - first_session
              - price_policy
              - gap_policy
              - reset_policy
              - quality
              - issues
              - subject_path
              - comparator_path
            type: object
          propertyNames:
            type: string
          type: object
        comparators:
          items:
            additionalProperties: false
            properties:
              key:
                minLength: 1
                type: string
              label:
                type: string
              role:
                enum:
                  - benchmark
                  - peer
                  - beta_reference
                type: string
              symbol:
                minLength: 1
                type: string
            required:
              - key
              - role
              - label
              - symbol
            type: object
          type: array
        groups:
          items:
            additionalProperties: false
            properties:
              key:
                minLength: 1
                type: string
              note:
                type: string
              title:
                minLength: 1
                type: string
            required:
              - key
              - title
            type: object
          type: array
        insights:
          items:
            additionalProperties: false
            properties:
              cites:
                items:
                  additionalProperties: false
                  properties:
                    metric_key:
                      minLength: 1
                      type: string
                    section:
                      minLength: 1
                      type: string
                  required:
                    - section
                    - metric_key
                  type: object
                type: array
              id:
                minLength: 1
                type: string
              rationale:
                type: string
              severity:
                enum:
                  - high
                  - medium
                  - low
                type: string
              status:
                enum:
                  - new
                  - ongoing
                  - resolved
                type: string
              summary:
                type: string
              title:
                minLength: 1
                type: string
            required:
              - id
              - title
              - severity
              - status
              - summary
              - cites
            type: object
          type: array
        receipt:
          additionalProperties: false
          properties:
            books:
              items:
                additionalProperties: false
                properties:
                  covered_weight:
                    pattern: ^-?\d+(\.\d+)?$
                    type: string
                  exposure_unknown_reason:
                    minLength: 1
                    type: string
                  fund_total_notes:
                    items:
                      additionalProperties: false
                      properties:
                        holdings_date:
                          pattern: ^\d{4}-\d{2}-\d{2}$
                          type: string
                        note:
                          minLength: 1
                          type: string
                        symbol:
                          minLength: 1
                          type: string
                      required:
                        - symbol
                        - holdings_date
                        - note
                      type: object
                    type: array
                  holdings_date:
                    pattern: ^\d{4}-\d{2}-\d{2}$
                    type: string
                  holdings_date_inferred:
                    const: true
                    type: boolean
                  portfolio_value_usd:
                    pattern: ^-?\d+(\.\d+)?$
                    type: string
                  role:
                    enum:
                      - subject
                      - benchmark_basket
                      - peer
                    type: string
                  rows:
                    maximum: 9007199254740991
                    minimum: 0
                    type: integer
                  source:
                    enum:
                      - provider:fmp
                      - provider:eodhd
                      - filing:nport
                      - upload
                      - portfolio
                      - what_if
                    type: string
                  symbol:
                    minLength: 1
                    type: string
                  total_basis:
                    enum:
                      - source_total
                      - valued_sum
                      - inferred_from_valued_share
                    type: string
                  total_note:
                    minLength: 1
                    type: string
                  total_value:
                    pattern: ^-?\d+(\.\d+)?$
                    type: string
                  unresolved_rows:
                    exclusiveMinimum: 0
                    maximum: 9007199254740991
                    type: integer
                  valued_rows:
                    maximum: 9007199254740991
                    minimum: 0
                    type: integer
                  warning_counts:
                    additionalProperties:
                      exclusiveMinimum: 0
                      maximum: 9007199254740991
                      type: integer
                    propertyNames:
                      minLength: 1
                      type: string
                    type: object
                  warnings:
                    items:
                      minLength: 1
                      type: string
                    type: array
                  weight_divergence:
                    pattern: ^-?\d+(\.\d+)?$
                    type: string
                  weights:
                    enum:
                      - stated
                      - rebuilt_from_shares
                    type: string
                required:
                  - role
                  - symbol
                  - source
                  - holdings_date
                  - rows
                  - covered_weight
                type: object
              type: array
            comparators_without_books:
              items:
                minLength: 1
                type: string
              type: array
            coverage:
              items:
                additionalProperties: false
                properties:
                  book:
                    type: string
                  names:
                    maximum: 9007199254740991
                    minimum: -9007199254740991
                    type: integer
                  reason_code:
                    type: string
                  weight:
                    anyOf:
                      - pattern: ^-?\d+(\.\d+)?$
                        type: string
                      - type: 'null'
                required:
                  - book
                  - reason_code
                  - names
                  - weight
                type: object
              type: array
            dropped_peers:
              items:
                additionalProperties: false
                properties:
                  reason:
                    type: string
                  symbol:
                    type: string
                required:
                  - symbol
                  - reason
                type: object
              type: array
            sections_not_configured:
              items:
                type: string
              type: array
            sections_unavailable:
              items:
                type: string
              type: array
            unresolved_rows:
              maximum: 9007199254740991
              minimum: 0
              type: integer
          required:
            - books
            - unresolved_rows
            - sections_unavailable
          type: object
        result_id:
          minLength: 1
          type: string
        schema_version:
          anyOf:
            - const: 1
              type: number
            - const: 2
              type: number
        sections:
          items:
            additionalProperties: false
            properties:
              folded:
                type: boolean
              group:
                minLength: 1
                type: string
              headline:
                items:
                  additionalProperties: false
                  properties:
                    label:
                      minLength: 1
                      type: string
                    metric_key:
                      minLength: 1
                      type: string
                  required:
                    - metric_key
                  type: object
                maxItems: 3
                minItems: 1
                type: array
              key:
                minLength: 1
                type: string
              note:
                type: string
              reason:
                type: string
              status:
                enum:
                  - ok
                  - partial
                  - unavailable
                  - not_configured
                type: string
              title:
                type: string
              views:
                items:
                  additionalProperties: false
                  properties:
                    about:
                      minLength: 1
                      type: string
                    basis:
                      minLength: 1
                      type: string
                    key:
                      minLength: 1
                      type: string
                    kind:
                      minLength: 1
                      type: string
                    pivot:
                      enum:
                        - comparator
                        - horizon
                      type: string
                    plot_id:
                      minLength: 1
                      type: string
                    rows:
                      items:
                        additionalProperties: false
                        properties:
                          basis_id:
                            minLength: 1
                            type: string
                          change:
                            additionalProperties: false
                            properties:
                              current_from:
                                pattern: ^\d{4}-\d{2}-\d{2}$
                                type: string
                              current_to:
                                pattern: ^\d{4}-\d{2}-\d{2}$
                                type: string
                              horizon:
                                minLength: 1
                                type: string
                              prior_from:
                                pattern: ^\d{4}-\d{2}-\d{2}$
                                type: string
                              prior_to:
                                pattern: ^\d{4}-\d{2}-\d{2}$
                                type: string
                              value:
                                pattern: ^-?\d+(\.\d+)?$
                                type: string
                              zscore:
                                pattern: ^-?\d+(\.\d+)?$
                                type: string
                            required:
                              - horizon
                              - value
                            type: object
                          comparator:
                            minLength: 1
                            type: string
                          currency:
                            pattern: ^[A-Z]{3}$
                            type: string
                          detail:
                            items:
                              additionalProperties: false
                              properties:
                                basis_id:
                                  minLength: 1
                                  type: string
                                comparator:
                                  minLength: 1
                                  type: string
                                currency:
                                  pattern: ^[A-Z]{3}$
                                  type: string
                                from:
                                  pattern: ^\d{4}-\d{2}-\d{2}$
                                  type: string
                                label:
                                  type: string
                                measure:
                                  minLength: 1
                                  type: string
                                term:
                                  minLength: 1
                                  type: string
                                to:
                                  pattern: ^\d{4}-\d{2}-\d{2}$
                                  type: string
                                unit:
                                  enum:
                                    - pct
                                    - pts
                                    - ratio
                                    - days
                                    - currency
                                    - count
                                  type: string
                                value:
                                  anyOf:
                                    - pattern: ^-?\d+(\.\d+)?$
                                      type: string
                                    - type: 'null'
                              required:
                                - label
                                - value
                                - unit
                              type: object
                            type: array
                          from:
                            pattern: ^\d{4}-\d{2}-\d{2}$
                            type: string
                          group:
                            minLength: 1
                            type: string
                          horizon:
                            anyOf:
                              - enum:
                                  - 1d
                                  - 5d
                                  - 2w
                                  - mtd
                                  - qtd
                                  - ytd
                                  - 1y
                                  - si
                                type: string
                              - pattern: ^[1-9]\d*d$
                                type: string
                          horizon_label:
                            minLength: 1
                            type: string
                          label:
                            type: string
                          measure:
                            minLength: 1
                            type: string
                          metric_key:
                            minLength: 1
                            type: string
                          role:
                            enum:
                              - start
                              - step
                              - end
                            type: string
                          series:
                            items:
                              items: false
                              maxItems: 2
                              minItems: 2
                              prefixItems:
                                - pattern: ^\d{4}-\d{2}-\d{2}$
                                  type: string
                                - pattern: ^-?\d+(\.\d+)?$
                                  type: string
                              type: array
                            type: array
                          term:
                            minLength: 1
                            type: string
                          thresholds:
                            additionalProperties: false
                            properties:
                              amber:
                                pattern: ^-?\d+(\.\d+)?$
                                type: string
                              direction:
                                enum:
                                  - above
                                  - below
                                  - outside
                                type: string
                              red:
                                pattern: ^-?\d+(\.\d+)?$
                                type: string
                              source:
                                enum:
                                  - config
                                  - agent
                                type: string
                            required:
                              - direction
                              - amber
                              - red
                              - source
                            type: object
                          to:
                            pattern: ^\d{4}-\d{2}-\d{2}$
                            type: string
                          unit:
                            enum:
                              - pct
                              - pts
                              - ratio
                              - days
                              - currency
                              - count
                            type: string
                          value:
                            anyOf:
                              - pattern: ^-?\d+(\.\d+)?$
                                type: string
                              - type: 'null'
                        required:
                          - metric_key
                          - label
                          - value
                          - unit
                        type: object
                      type: array
                    title:
                      type: string
                    truncated:
                      additionalProperties: false
                      properties:
                        shown:
                          maximum: 9007199254740991
                          minimum: 0
                          type: integer
                        total:
                          maximum: 9007199254740991
                          minimum: 0
                          type: integer
                      required:
                        - shown
                        - total
                      type: object
                  required:
                    - key
                    - kind
                    - rows
                  type: object
                type: array
            required:
              - key
              - title
              - status
              - folded
              - views
            type: object
          type: array
        subject:
          additionalProperties: false
          properties:
            name:
              type: string
            portfolio_id:
              minLength: 1
              type: string
            symbol:
              minLength: 1
              type: string
          required:
            - portfolio_id
            - symbol
            - name
          type: object
        summary:
          type: string
        terms:
          additionalProperties:
            additionalProperties: false
            properties:
              formula:
                minLength: 1
                type: string
              means:
                minLength: 1
                type: string
              name:
                minLength: 1
                type: string
              worked_out:
                minLength: 1
                type: string
            required:
              - name
              - means
            type: object
          propertyNames:
            minLength: 1
            type: string
          type: object
        tool:
          minLength: 1
          type: string
        type:
          const: engine_artifact
          type: string
      required:
        - type
        - tool
        - schema_version
        - artifact_id
        - as_of
        - subject
        - comparators
        - insights
        - sections
        - receipt
      type: object
    Gateway_RiskRunSummary:
      additionalProperties: false
      properties:
        against:
          description: The benchmark, then the peers the run measured.
          items:
            type: string
          type: array
        as_of:
          description: Market date of the figures, YYYY-MM-DD.
          type: string
        key_figures:
          additionalProperties:
            type:
              - string
              - number
          description: >-
            At most 20 figures: what was measured, then each section's headline
            figures as the panel labels them. A figure the engine could not
            compute reads "n/a".
          propertyNames:
            type: string
          type: object
        notes:
          description: >-
            Sentences on what the run left out: the full figures when they were
            too large to keep, then sections, peers and names.
          items:
            type: string
          type: array
        reason:
          description: 'Set only for a partial run: what it did not compute.'
          type: string
        status:
          enum:
            - ok
            - partial
          type: string
        subject:
          description: The portfolio's name, or its symbol for a what-if.
          type: string
      required:
        - status
        - as_of
        - subject
        - against
        - key_figures
        - notes
      type: object
    Gateway_RiskRunView:
      additionalProperties: false
      properties:
        artifact_omission:
          additionalProperties: false
          properties:
            limit_bytes:
              exclusiveMinimum: 0
              maximum: 9007199254740991
              type: integer
            reason:
              const: too_large
              type: string
            size_bytes:
              exclusiveMinimum: 0
              maximum: 9007199254740991
              type: integer
          required:
            - reason
            - size_bytes
            - limit_bytes
          type: object
        as_of:
          description: Market date of the figures, YYYY-MM-DD.
          pattern: ^\d{4}-\d{2}-\d{2}$
          type: string
        benchmark:
          minLength: 1
          type: string
        coverage:
          description: >-
            Every current gap in subject, benchmark and peers, with signed book
            weight and reason. A null weight means the holding could not be
            valued. Absent when the request left out risk, which alone reads the
            current model, and on runs stored before the full list existed.
            Performance sections name the gaps of the models they measure on
            themselves.
          items:
            additionalProperties: false
            properties:
              book:
                type: string
              reason:
                type: string
              reason_code:
                type: string
              symbol:
                type: string
              weight:
                type:
                  - number
                  - 'null'
            required:
              - book
              - symbol
              - weight
              - reason_code
              - reason
            type: object
          type: array
        dropped_peers:
          description: Peers left out because no holdings book could be had.
          items:
            additionalProperties: false
            properties:
              reason:
                type: string
              symbol:
                minLength: 1
                type: string
            required:
              - symbol
              - reason
            type: object
          type: array
        exposure:
          anyOf:
            - additionalProperties: false
              properties:
                gross_weight:
                  minimum: 0
                  type: number
                long_weight:
                  minimum: 0
                  type: number
                net_weight:
                  type: number
                short_weight:
                  maximum: 0
                  type: number
              required:
                - long_weight
                - short_weight
                - gross_weight
                - net_weight
              type: object
            - type: 'null'
          description: >-
            The book's long, short (at or below 0), gross and net weight of its
            net assets, cash left out; null for a saved portfolio measured
            through its one fund.
        missing_by_design:
          description: >-
            Sections intentionally omitted or unavailable by design: sections of
            an analysis the request left out (reason not_requested); sections
            the request did not set up (status not_configured, for example
            compliance with no limits); trust when include_forecast_quality is
            false; compliance (no limits) and changes (no earlier runs) always;
            performance and risk change without stored history; liquidity for a
            what-if.
          items:
            minLength: 1
            type: string
          type: array
        missing_sections:
          description: >-
            Sections this kind of run could have computed but did not. Any makes
            the run partial.
          items:
            minLength: 1
            type: string
          type: array
        modelled_weight:
          anyOf:
            - maximum: 1
              minimum: 0
              type: number
            - type: 'null'
          description: >-
            Share of the portfolio's gross weight the factor model covers, from
            0 to 1, or null when risk was not measured.
        peers:
          description: The peers the run measured.
          items:
            minLength: 1
            type: string
          type: array
        sections:
          items:
            additionalProperties: false
            properties:
              key:
                minLength: 1
                type: string
              reason:
                type: string
              status:
                enum:
                  - ok
                  - partial
                  - unavailable
                  - not_configured
                type: string
              title:
                type: string
            required:
              - key
              - title
              - status
            type: object
          type: array
        subject:
          additionalProperties: false
          properties:
            kind:
              enum:
                - portfolio
                - what_if
              type: string
            name:
              type: string
            symbol:
              minLength: 1
              type: string
          required:
            - kind
            - name
            - symbol
          type: object
        unmodelled:
          description: >-
            Holdings the factor model does not cover, heaviest first (at most
            20), with unknown weights last. A null weight means the holding
            could not be valued. Risk figures leave them out. Empty when the
            request left out risk.
          items:
            additionalProperties: false
            properties:
              symbol:
                minLength: 1
                type: string
              weight:
                type:
                  - number
                  - 'null'
            required:
              - symbol
              - weight
            type: object
          type: array
        unmodelled_count:
          anyOf:
            - maximum: 9007199254740991
              minimum: 0
              type: integer
            - type: 'null'
          description: >-
            How many holdings the factor model does not cover, or null when the
            request left out risk: only risk reads the current model.
      required:
        - as_of
        - subject
        - benchmark
        - peers
        - dropped_peers
        - sections
        - missing_sections
        - missing_by_design
        - unmodelled
        - unmodelled_count
        - modelled_weight
        - exposure
      type: object
    Gateway_RiskRunFaultDetails:
      additionalProperties: false
      description: >-
        Safe failure class and publication date when known; null when
        unavailable.
      properties:
        exception_type:
          maxLength: 200
          minLength: 1
          type: string
        publication_date:
          anyOf:
            - format: date
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
              type: string
            - type: 'null'
      required:
        - exception_type
        - publication_date
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      description: Itoflow access token issued for the Itoflow API.
      scheme: bearer
      type: http

````

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