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

# Stop a risk run

> Stop a run by its run_id. cancelled is false when no run is going. Requires itoflow-engine-results.

Operation ID: cancelRiskRun.



## OpenAPI

````yaml /openapi/itoflow-public.openapi.json post /risk/runs/{run_id}/cancel
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}/cancel:
    post:
      tags:
        - Risk runs
      summary: Stop a risk run
      description: >-
        Stop a run by its run_id. cancelled is false when no run is going.
        Requires itoflow-engine-results.


        Operation ID: cancelRiskRun.
      operationId: cancelRiskRun
      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_cancelRiskRunResponse'
          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_cancelRiskRunResponse:
      additionalProperties: false
      properties:
        cancelled:
          type: boolean
      required:
        - cancelled
      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
  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.