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

# Ban All Checks For Agent Run

> Ban all checks for a PR and stop all related agents.

This endpoint:
1. Flags the PR to prevent future CI/CD check suite events from being processed
2. Stops all current agents for that PR



## OpenAPI

````yaml api-reference/openapi3.json post /v1/organizations/{org_id}/agent/run/ban
openapi: 3.1.0
info:
  title: Developer API
  description: API for application developers
  version: 1.0.0
servers:
  - url: https://api.codegen.com
    description: Codegen API
security: []
paths:
  /v1/organizations/{org_id}/agent/run/ban:
    post:
      tags:
        - agents
        - agents
        - agents
      summary: Ban All Checks For Agent Run
      description: >-
        Ban all checks for a PR and stop all related agents.


        This endpoint:

        1. Flags the PR to prevent future CI/CD check suite events from being
        processed

        2. Stops all current agents for that PR
      operationId: >-
        ban_all_checks_for_agent_run_v1_organizations__org_id__agent_run_ban_post
      parameters:
        - name: org_id
          in: path
          required: true
          schema:
            type: integer
            title: Org Id
        - name: authorization
          in: header
          required: false
          schema:
            title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StopAgentRunInput'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PermissionsErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentRunNotFoundErrorResponse'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIRateLimitErrorResponse'
          description: Too Many Requests
components:
  schemas:
    StopAgentRunInput:
      properties:
        agent_run_id:
          type: integer
          title: Agent Run Id
        before_card_order_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Before Card Order Id
          description: >-
            Kanban order key of the card that should come before this agent run
            in the CANCELLED column
        after_card_order_id:
          anyOf:
            - type: string
            - type: 'null'
          title: After Card Order Id
          description: >-
            Kanban order key of the card that should come after this agent run
            in the CANCELLED column
      type: object
      required:
        - agent_run_id
      title: StopAgentRunInput
    PermissionsErrorResponse:
      properties:
        message:
          type: string
          title: Message
          default: You do not have access to this organization.
        status_code:
          type: integer
          title: Status Code
          default: 403
      type: object
      title: PermissionsErrorResponse
    AgentRunNotFoundErrorResponse:
      properties:
        message:
          type: string
          title: Message
          default: Agent run not found.
        status_code:
          type: integer
          title: Status Code
          default: 404
      type: object
      title: AgentRunNotFoundErrorResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    APIRateLimitErrorResponse:
      properties:
        message:
          type: string
          title: Message
          default: Rate limit exceeded. Please try again later.
        status_code:
          type: integer
          title: Status Code
          default: 429
      type: object
      title: APIRateLimitErrorResponse
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````