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

# Clear All Chats

> Clear all chat threads and messages for the current user with a specific agent.

Args:
    agent_id: Agent ID to filter chats by (required)
    chat_service: The chat service instance
    organization_id: The organization ID to clear chats for
    user_id: The user ID to clear chats for
    _auth_token: The platform token for authentication

Returns:
    Dict with counts of deleted threads, messages, and cache keys



## OpenAPI

````yaml delete /api/v1/chat/clear-all-chats
openapi: 3.1.0
info:
  title: ThenaAgentStudio
  description: |2-

        ThenaCrew AI CRM Renewal System

        An intelligent platform to automate customer renewal insights and communications through multi-agent workflows.

        Key Features:
        * AI-powered renewal analysis
        * Personalized communication generation
        * Automated opportunity tracking
        * Multi-agent workflow orchestration
        
  version: 1.0.0
servers:
  - url: https://agent-studio.thena.ai
    description: Production server
  - url: http://localhost:8008
    description: Local development server
security:
  - ApiKeyAuth: []
tags:
  - name: Agents
    description: Agent management endpoints
  - name: Chat
    description: Chat and messaging endpoints
paths:
  /api/v1/chat/clear-all-chats:
    delete:
      tags:
        - Chat
        - Chat
      summary: Clear All Chats
      description: >-
        Clear all chat threads and messages for the current user with a specific
        agent.


        Args:
            agent_id: Agent ID to filter chats by (required)
            chat_service: The chat service instance
            organization_id: The organization ID to clear chats for
            user_id: The user ID to clear chats for
            _auth_token: The platform token for authentication

        Returns:
            Dict with counts of deleted threads, messages, and cache keys
      operationId: clear_all_chats_api_v1_chat_clear_all_chats_delete
      parameters:
        - name: agent_id
          in: query
          required: true
          schema:
            type: string
            format: uuid
            description: Agent ID to filter chats by
            title: Agent Id
          description: Agent ID to filter chats by
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: integer
                title: Response Clear All Chats Api V1 Chat Clear All Chats Delete
        '401':
          description: Unauthorized - Invalid or missing JWT token
        '403':
          description: Forbidden - Insufficient permissions
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal server error
      security:
        - ApiKeyAuth: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````