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

# Cancel Thread

> Cancel a running analysis thread.

This endpoint:
1. Updates thread status to CANCELLED
2. Persists cancelled_blocks in checkpoint state for UI display
3. Cancels the running Temporal workflow if one exists
4. Returns cancellation confirmation

Requires UPDATE permission on ANALYSIS resources.



## OpenAPI

````yaml https://analyst.heyhumm.ai/api/openapi.json post /threads/{thread_id}/cancel
openapi: 3.1.0
info:
  title: Analyst API
  description: API for the Analyst service with proper organization-scoped permissions
  version: 1.0.0
servers:
  - url: https://analyst.heyhumm.ai
security: []
paths:
  /threads/{thread_id}/cancel:
    post:
      tags:
        - threads
      summary: Cancel Thread
      description: |-
        Cancel a running analysis thread.

        This endpoint:
        1. Updates thread status to CANCELLED
        2. Persists cancelled_blocks in checkpoint state for UI display
        3. Cancels the running Temporal workflow if one exists
        4. Returns cancellation confirmation

        Requires UPDATE permission on ANALYSIS resources.
      operationId: cancel_thread_threads__thread_id__cancel_post
      parameters:
        - name: thread_id
          in: path
          required: true
          schema:
            type: string
            description: Thread ID
            title: Thread Id
          description: Thread ID
        - name: organization_id
          in: query
          required: true
          schema:
            type: string
            title: Organization 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
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````