# Terminate a chat (v2)

Close the conversation (and trigger the rating widget if configured). Takes only the chat id — the closing agent is resolved from your API key / session. Replaces toggling conversationClosed on the deprecated Terminate or reopen a chat conversation.

Endpoint: POST /pl4chat-service/api/v2/chats/{id}/terminate
Version: 3.0.0
Security: apikeyAuth

## Path parameters:

  - `id` (string, required)
    Chat participant id.
    Example: "aef65b5a-23a4-462a-a275-9aa2f3e0e56e"

## Response 200 fields (application/json):

  - `id` (string)
    Example: "aef65b5a-23a4-462a-a275-9aa2f3e0e56e"

  - `fullName` (string)
    Example: "John Doe"

  - `firstName` (string)
    Example: "John"

  - `lastName` (string)
    Example: "Doe"

  - `phoneNumber` (string)
    Example: "27821234567"

  - `userId` (string)
    Customer's durable business-scoped user id (BSUID, alpha usernames). Stable across phone-number changes; present even when the phone is withheld.
    Example: "ZA.1021033720668862"

  - `username` (string)
    Customer's optional WhatsApp username (display only).
    Example: "johndoe"

  - `email` (string)
    Example: "john.doe@example.com"

  - `channel` (string)
    Enum: "WHATSAPP", "WEB", "FACEBOOK"

  - `conversationStatus` (string)
    Example: "ACTIVE"

  - `conversationClosed` (boolean)

  - `unread` (boolean)
    Example: true

  - `missedConversation` (boolean)

  - `chatBotConversation` (boolean)

  - `whatsAppClientNumber` (string)
    Example: "+27123456789"

  - `team` (string)
    Example: "Support"

  - `teamId` (string)
    Example: "288436ad-4522-4f27-95e9-c406a917894d"

  - `lastMessageTime` (string)
    Example: "2026-01-15T10:31:00Z"

  - `createdTime` (string)
    Example: "2026-01-15T10:00:00Z"

  - `customerLastMessageTime` (string)
    Example: "2026-01-15T10:30:00Z"

  - `assignedTo` (object)
    Lean reference to the agent who sent or owns a message.

  - `assignedTo.id` (string)
    Example: "b2c3d4e5-f6a7-8901-b2c3-d4e5f6a78901"

  - `assignedTo.firstName` (string)
    Example: "Alice"

  - `assignedTo.lastName` (string)
    Example: "Smith"

  - `assignedTo.email` (string)
    Example: "alice.smith@example.com"

  - `assignedTo.avatar` (string)
    URL of the agent's avatar image.
    Example: "https://example.com/avatars/alice.png"

  - `lastAssignedAgent` (object)
    Lean reference to the agent who sent or owns a message.

## Response 401 fields (application/json):

  - `status` (string)
    Example: "ERROR"

  - `message` (string)
    Example: "Unauthorized user"

  - `requestId` (string)
    Example: "c3a1f8e2-4b6d-11ee-be56-0242ac120002"

  - `timestamp` (string)
    Example: "2026-01-15T10:30:00Z"

## Response 403 fields (application/json):

  - `status` (string)
    Example: "ERROR"

  - `message` (string)
    Example: "Forbidden"

  - `requestId` (string)
    Example: "c3a1f8e2-4b6d-11ee-be56-0242ac120002"

  - `timestamp` (string)
    Example: "2026-01-15T10:30:00Z"

## Response 404 fields (application/json):

  - `status` (string)
    Example: "ERROR"

  - `message` (string)
    Example: "Resource not found"

  - `requestId` (string)
    Example: "c3a1f8e2-4b6d-11ee-be56-0242ac120002"

  - `timestamp` (string)
    Example: "2026-01-15T10:30:00Z"


