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

# Delete Conversation

> Soft-delete a conversation owned by the authenticated user.

The underlying LangGraph checkpoint data is preserved so the conversation
can be recovered if needed. Only the ``conversation_users`` record is
marked deleted.

Args:
    user:      The authenticated user (must be the conversation owner).
    thread_id: LangGraph thread ID to delete.
    db:        Database session.

Returns:
    ``{"thread_id": ..., "deleted": True}`` on success.

Raises:
    HTTPException 403: If the user does not own this conversation.
    HTTPException 404: If no matching active conversation was found.



## OpenAPI

````yaml /openapi.json delete /api/conversations/{thread_id}
openapi: 3.1.0
info:
  title: HAI-Co² API
  description: Human-AI Co-Construction reference implementation.
  version: 0.1.0
servers:
  - url: https://haico.gr
    description: Production
  - url: https://dev.haico.gr
    description: Development
  - url: http://localhost:8000
    description: Local development
security: []
paths:
  /api/conversations/{thread_id}:
    delete:
      tags:
        - Conversations
      summary: Delete Conversation
      description: >-
        Soft-delete a conversation owned by the authenticated user.


        The underlying LangGraph checkpoint data is preserved so the
        conversation

        can be recovered if needed. Only the ``conversation_users`` record is

        marked deleted.


        Args:
            user:      The authenticated user (must be the conversation owner).
            thread_id: LangGraph thread ID to delete.
            db:        Database session.

        Returns:
            ``{"thread_id": ..., "deleted": True}`` on success.

        Raises:
            HTTPException 403: If the user does not own this conversation.
            HTTPException 404: If no matching active conversation was found.
      operationId: delete_conversation_api_conversations__thread_id__delete
      parameters:
        - name: thread_id
          in: path
          required: true
          schema:
            type: string
            maxLength: 255
            minLength: 1
            title: Thread Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
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
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      description: >-
        A personal access token (`haico_pat_...`), created under Profile → API
        keys. Send it as `Authorization: Bearer <key>`. The browser session JWT
        is also accepted but is an internal mechanism and is not part of the
        public contract.
      scheme: bearer

````