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

# Close a chat

> Closes an active chat conversation and marks it as complete.



## OpenAPI

````yaml PUT /{version}/{account_id}/{project_id}/chat/close
openapi: 3.0.0
info:
  title: Chat API
  description: API endpoints for chat functionality.
  version: 1.0.0
servers:
  - url: https://api.us-1.platform.polyai.app
    description: Hostname for US-1 region
  - url: https://api.uk-1.platform.polyai.app
    description: Hostname for UK-1 region
  - url: https://api.euw-1.platform.polyai.app
    description: Hostname for EUW-1 region
security:
  - ApiKeyAuth: []
  - TokenAuth: []
paths:
  /{version}/{account_id}/{project_id}/chat/close:
    put:
      summary: Close an existing chat conversation
      description: Closes an active chat conversation and marks it as complete.
      operationId: chatClose
      parameters:
        - $ref: '#/components/parameters/ApiKeyHeader'
        - $ref: '#/components/parameters/TokenHeader'
        - name: version
          in: path
          description: API version
          required: true
          schema:
            type: string
          example: v1
        - name: account_id
          in: path
          description: Account ID
          required: true
          schema:
            type: string
          example: ACCOUNT-xxxxxxxx
        - name: project_id
          in: path
          description: Project ID
          required: true
          schema:
            type: string
          example: PROJECT-xxxxxxxx
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CloseChatRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CloseChatResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - ApiKeyAuth: []
        - TokenAuth: []
components:
  parameters:
    ApiKeyHeader:
      name: X-API-KEY
      in: header
      description: Your PolyAI API key.
      required: true
      schema:
        type: string
    TokenHeader:
      name: X-TOKEN
      in: header
      description: Agent authentication token (connector).
      required: true
      schema:
        type: string
  schemas:
    CloseChatRequest:
      type: object
      properties:
        conversation_id:
          type: string
          description: ID of the conversation to close
          example: CONV-1234567890
      required:
        - conversation_id
    CloseChatResponse:
      type: object
      properties:
        success:
          type: boolean
          description: Whether the conversation was successfully closed
          example: true
      required:
        - success
    Error:
      type: object
      properties:
        error_message:
          type: string
          description: Reason for error
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: You must request an API Key to use PolyAI APIs.
    TokenAuth:
      type: apiKey
      in: header
      name: X-TOKEN
      description: Authentication token provisioned in Agent Studio.

````