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

# Cancel Agent Run

> Cancel one live AI agent run and its session (organisation admins only). The runner interrupts the in-flight turn within seconds.



## OpenAPI

````yaml https://platform.ankra.app/openapi.json post /api/v1/org/ai-agent-runs/{run_id}/cancel
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://platform.ankra.app
security: []
paths:
  /api/v1/org/ai-agent-runs/{run_id}/cancel:
    post:
      tags:
        - AI Agent Runs
      summary: Cancel Agent Run
      description: >-
        Cancel one live AI agent run and its session (organisation admins only).
        The runner interrupts the in-flight turn within seconds.
      operationId: >-
        cancel_agent_run_api_endpoint_api_v1_org_ai_agent_runs__run_id__cancel_post
      parameters:
        - in: header
          name: authorization
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
        - in: header
          name: x-ankra-organisation-id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Ankra-Organisation-Id
        - in: path
          name: run_id
          required: true
          schema:
            format: uuid
            title: Run Id
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  cancelled_session_id:
                    anyOf:
                      - type: string
                      - type: 'null'
                    title: Cancelled Session Id
                  detail:
                    title: Detail
                    type: string
                  status:
                    title: Status
                    type: string
                title: CancelAgentRunResponse
                type: object
          description: Successful Response
        '403':
          content:
            application/json:
              schema:
                properties:
                  detail:
                    title: Detail
                    type: string
                title: DetailResponse
                type: object
          description: Only organisation admins can cancel agent runs.
        '404':
          content:
            application/json:
              schema:
                properties:
                  detail:
                    title: Detail
                    type: string
                title: DetailResponse
                type: object
          description: Agent run not found.
        '409':
          content:
            application/json:
              schema:
                properties:
                  detail:
                    title: Detail
                    type: string
                title: DetailResponse
                type: object
          description: The run has already finished.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object

````