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

# Close a thread

> Close an active thread



## OpenAPI

````yaml patch /api/v1/threads/{threadId}/close
openapi: 3.0.0
info:
  version: 1.0.0
  title: Feather AI API
servers:
  - url: https://prod.featherhq.com
    description: Production environment
security: []
paths:
  /api/v1/threads/{threadId}/close:
    patch:
      tags:
        - SMS Threads
      summary: Close a thread
      description: Close an active thread
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: threadId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                reason:
                  type: string
      responses:
        '200':
          description: Thread closed successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  thread:
                    type: object
                    properties:
                      id:
                        type: string
                      organizationId:
                        type: string
                      agentVersionId:
                        type: string
                      toPhoneNumber:
                        type: string
                      fromPhoneNumber:
                        type: string
                        nullable: true
                      fromPhoneNumberId:
                        type: string
                        nullable: true
                      leadId:
                        type: string
                        nullable: true
                      isActive:
                        type: boolean
                      createdAt:
                        type: string
                      updatedAt:
                        type: string
                      closedAt:
                        type: string
                        nullable: true
                      closedReason:
                        type: string
                        nullable: true
                      metadata:
                        type: object
                        nullable: true
                        additionalProperties:
                          type: string
                      variables:
                        type: object
                        nullable: true
                        additionalProperties:
                          type: string
                    required:
                      - id
                      - organizationId
                      - agentVersionId
                      - toPhoneNumber
                      - fromPhoneNumber
                      - fromPhoneNumberId
                      - leadId
                      - isActive
                      - createdAt
                      - updatedAt
                      - closedAt
                      - closedReason
                required:
                  - thread
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    default: 400
                  message:
                    type: string
                    default: Bad request
                  code:
                    type: string
                    enum:
                      - BAD_REQUEST
                    default: BAD_REQUEST
                  success:
                    type: boolean
                    enum:
                      - false
                    default: false
        '404':
          description: Thread not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    default: 400
                  message:
                    type: string
                    default: Bad request
                  code:
                    type: string
                    enum:
                      - BAD_REQUEST
                    default: BAD_REQUEST
                  success:
                    type: boolean
                    enum:
                      - false
                    default: false
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    default: 500
                  message:
                    type: string
                    default: Internal server error
                  code:
                    type: string
                    enum:
                      - INTERNAL_SERVER_ERROR
                    default: INTERNAL_SERVER_ERROR
                  success:
                    type: boolean
                    enum:
                      - false
                    default: false
      security:
        - ApiKey: []
components:
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-API-Key

````