> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2-codex-docs-audit-20260719-0149.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel Team Run

> Request cancellation for `run_id`. After any required ownership check, local and factory teams store cancellation intent keyed by run ID and mark known member runs for cancellation. For admins and otherwise unscoped callers, this also supports cancel-before-start for an unregistered ID. Cancellation is cooperative and may not be immediate. HTTP 200 does not confirm that an active run existed or that cancellation was delivered to a remote team.



## OpenAPI

````yaml post /teams/{team_id}/runs/{run_id}/cancel
openapi: 3.1.0
info:
  title: Agno API Reference
  description: The all-in-one, private, secure agent platform that runs in your cloud.
  version: 2.7.4
servers: []
security: []
paths:
  /teams/{team_id}/runs/{run_id}/cancel:
    post:
      tags:
        - Teams
      summary: Cancel Team Run
      description: >-
        Request cancellation for `run_id`. After any required ownership check,
        local and factory teams store cancellation intent keyed by run ID and
        mark known member runs for cancellation. For admins and otherwise
        unscoped callers, this also supports cancel-before-start for an
        unregistered ID. Cancellation is cooperative and may not be immediate.
        HTTP 200 does not confirm that an active run existed or that
        cancellation was delivered to a remote team.
      operationId: cancel_team_run
      parameters:
        - name: team_id
          in: path
          required: true
          schema:
            type: string
            title: Team Id
        - name: run_id
          in: path
          required: true
          schema:
            type: string
            title: Run Id
        - name: session_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Session ID used to verify run ownership. Required when the caller
              is user-scoped: service accounts, and non-admin JWT users when
              user isolation is enabled. Admin and otherwise unscoped callers
              can omit it.
            title: Session Id
          description: >-
            Session ID used to verify run ownership. Required when the caller is
            user-scoped: service accounts, and non-admin JWT users when user
            isolation is enabled. Admin and otherwise unscoped callers can omit
            it.
      responses:
        '200':
          description: >-
            Cancellation request accepted. The empty response does not confirm
            run existence or remote delivery.
          content:
            application/json:
              schema: {}
        '400':
          description: A user-scoped caller omitted session_id
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenResponse'
        '404':
          description: >-
            Team not found, or the run could not be verified in the caller's
            session.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '500':
          description: Failed to cancel team run
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponse'
      security:
        - {}
        - HTTPBearer: []
components:
  schemas:
    BadRequestResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Error detail message
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
          description: Error code for categorization
      type: object
      required:
        - detail
      title: BadRequestResponse
      example:
        detail: Bad request
        error_code: BAD_REQUEST
    UnauthenticatedResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Error detail message
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
          description: Error code for categorization
      type: object
      required:
        - detail
      title: UnauthenticatedResponse
      example:
        detail: Unauthenticated access
        error_code: UNAUTHENTICATED
    ForbiddenResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Error detail message
      type: object
      required:
        - detail
      title: ForbiddenResponse
      example:
        detail: Insufficient permissions
    NotFoundResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Error detail message
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
          description: Error code for categorization
      type: object
      required:
        - detail
      title: NotFoundResponse
      example:
        detail: Not found
        error_code: NOT_FOUND
    ValidationErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Error detail message
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
          description: Error code for categorization
      type: object
      required:
        - detail
      title: ValidationErrorResponse
      example:
        detail: Validation error
        error_code: VALIDATION_ERROR
    InternalServerErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Error detail message
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
          description: Error code for categorization
      type: object
      required:
        - detail
      title: InternalServerErrorResponse
      example:
        detail: Internal server error
        error_code: INTERNAL_SERVER_ERROR
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````