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

# Cancel assistants

> Cancels one or more assistants that were registered with the cancel_token. Use this to terminate running assistant executions gracefully.



## OpenAPI

````yaml /api-reference/endpoint/assistants/openapi.json post /hub/agent/cancel
openapi: 3.0.0
info:
  title: Quiva Assistants API
  x-gateway-name: API Gateway
  description: >-
    API for managing Quiva Assistants. Every endpoint requires either a Bearer
    JWT or an API key — the gateway resolves an API key into the user/account
    context these endpoints read. A restricted API key must explicitly allow the
    /hub/agent* paths it's used against, or requests are rejected before they
    reach this API.
  version: 0.1.1
  contact:
    name: quiva.ai Support
servers:
  - url: https://api.quiva.ai
    description: Production API server
security:
  - bearerAuth: []
  - apiKeyAuth: []
paths:
  /hub/agent/cancel:
    post:
      tags:
        - Assistants
      summary: Cancel assistants
      description: >-
        Cancels one or more assistants that were registered with the
        cancel_token. Use this to terminate running assistant executions
        gracefully.
      operationId: cancelAgents
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentCancelRequest'
            example:
              cancel_token: my-session-token-123
      responses:
        '200':
          description: Assistants cancelled successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelResponse'
        '400':
          description: Bad request - check that cancel_token is provided and valid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - provide valid authentication credentials.
        '500':
          description: Server error - the cancellation request could not be processed.
components:
  schemas:
    AgentCancelRequest:
      type: object
      required:
        - cancel_token
      properties:
        cancel_token:
          type: string
          description: Token identifying assistant(s) to cancel.
          example: my-session-token-123
    CancelResponse:
      type: object
      properties:
        success:
          type: boolean
          description: Whether the cancellation was successful.
        message:
          type: string
          description: Human-readable status message.
        cancelled_count:
          type: integer
          description: Number of assistants cancelled.
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT Authorization header using the Bearer scheme.
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: API key authentication via X-Api-Key header.

````