# Terminate or reopen a chat conversation (deprecated)

Deprecated. Use Terminate a chat (v2)
or Reopen a chat (v2) — they take
only the chat id (the actor is resolved from your API key / session) and avoid the full-object
merge pitfalls below. Retained for existing integrations.

Terminates or reopens a chat by toggling the conversationClosed field on the ChatParticipant object.
Set conversationClosed to true to terminate the chat (triggers the rating widget if configured),
or set it to false to reopen a previously closed chat.

Important — send the full object. The safest approach is to fetch the participant with GET /pl4chat-service/ChatParticipant and send the complete object back with conversationClosed toggled. The endpoint merges non-null string and object fields (so most omitted fields are preserved), but two categories behave differently and can silently reset state:

- assignedTo — if omitted or null, the agent assignment is cleared.
- Boolean flags — conversationClosed, missedConversation, afterHoursConversation, sendRatingWidget, and chatBotConversation are always copied from the request. Omitting any of them resets it to false.

Note that when terminating with sendRatingWidget=true, the server also moves assignedTo to lastAssignedAgent, sets expectingRating=true, and triggers the rating widget.

Endpoint: PUT /pl4chat-service/ChatParticipant/terminateChatParticipantChat
Version: 3.0.0
Security: apikeyAuth

## Request fields (application/json):

  - `id` (string)
    Example: "cp-a1b2c3d4"

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

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

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

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

  - `userId` (string)
    Customer's durable business-scoped user id (BSUID, alpha usernames), e.g. ZA.1021033720668862. 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"

  - `parentUserId` (string)
    BSUID of the parent WhatsApp Business portfolio, when applicable.
    Example: "ZA.1000000000000000"

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

  - `subject` (string)
    Example: "Billing Inquiry"

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

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

  - `conversationClosed` (boolean)

  - `missedConversation` (boolean)

  - `afterHoursConversation` (boolean)

  - `chatBotConversation` (boolean)
    Example: true

  - `sendRatingWidget` (boolean)

  - `clientRef` (string)
    Example: "Growthpoint"

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

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

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

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

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

  - `sender` (string)
    Example: "+27821234567"

  - `assignedTo` (object)

  - `assignedTo.id` (string)
    Example: "e1f2a3b4-c5d6-7890-e1f2-a3b4c5d67890"

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

  - `assignedTo.password` (string)
    Example: "********"

  - `assignedTo.tempPassword` (string,null)
    Example: "********"

  - `assignedTo.role` (string)
    Enum: "CLIENT"

  - `assignedTo.liveChatRole` (string)
    Enum: "SUPERVISOR", "AGENT"

  - `assignedTo.primaryEmailAddress` (string,null)
    Example: "agent@example.com"

  - `assignedTo.mobileNumber` (string,null)
    Example: "+27821234567"

  - `assignedTo.sentLowerCreditLimitMail` (boolean)

  - `assignedTo.sentZeroCreditMail` (boolean)

  - `assignedTo.apiKey` (string)
    Example: "64a1b2c3d4e5f67890abcdef"

  - `assignedTo.disabled` (boolean)

  - `assignedTo.deleted` (boolean)

  - `assignedTo.emailVerificationKey` (string,null)

  - `assignedTo.passwordResetKey` (string,null)

  - `assignedTo.inactivityNodeId` (string,null)
    Example: "node-inactivity-001"

  - `assignedTo.publicHolidayInactivityNodeId` (string,null)
    Example: "node-holiday-001"

  - `assignedTo.officeClosedInactivityNodeId` (string,null)
    Example: "node-closed-001"

  - `assignedTo.autoResponseNodeId` (string,null)
    Example: "node-auto-001"

  - `assignedTo.client` (object)

  - `assignedTo.client.id` (string)
    Example: "dbdb8809-6fd0-4cd2-8574-502f0f61a69d"

  - `assignedTo.client.clientRef` (string)
    Example: "Growthpoint"

  - `assignedTo.client.accountType` (string)
    Example: "Postpaid"

  - `assignedTo.client.countryCode` (string)
    Example: "ZA"

  - `assignedTo.client.countryTimezone` (string)
    Example: "Africa/Johannesburg"

  - `assignedTo.client.pricingModel` (string)
    Example: "PMP"

  - `assignedTo.client.clientPlatformCharge` (number,null)
    Example: 0.1

  - `assignedTo.client.clientNotificationCharge` (number)
    Example: 0.35

  - `assignedTo.client.clientSession24HourCharge` (number)
    Example: 0.35

  - `assignedTo.client.clientConversationCharge` (number)
    Example: 0.35

  - `assignedTo.client.userInitiatedConversationCharge` (number,null)
    Example: 0.2

  - `assignedTo.client.businessInitiatedConversationCharge` (number)
    Example: 1.25

  - `assignedTo.client.clientWhatsAppBalance` (number)
    Example: 1000

  - `assignedTo.client.clientSMSBalance` (number)
    Example: 10

  - `assignedTo.client.primaryEmailAddress` (string,null)
    Example: "admin@example.com"

  - `assignedTo.client.secondaryEmailAddress` (string,null)
    Example: "backup@example.com"

  - `assignedTo.client.clientEmailAddress` (string,null)
    Example: "client@example.com"

  - `assignedTo.client.upperNotificationLimit` (number,null)
    Example: 100

  - `assignedTo.client.lowerNotificationLimit` (number,null)
    Example: 10

  - `assignedTo.client.upperNotificationLimitMailSent` (boolean)

  - `assignedTo.client.lowerNotificationLimitMailSent` (boolean)

  - `assignedTo.client.zeroBalanceNotificationMailSent` (boolean)

  - `assignedTo.client.lastUpperNotificationMailSentTime` (string,null)
    Example: "2026-01-15T10:30:00+02:00"

  - `assignedTo.client.lastLowerNotificationMailSentTime` (string,null)
    Example: "2026-01-20T14:00:00+02:00"

  - `assignedTo.client.lastZeroBalanceNotificationMailSentTime` (string,null)

  - `assignedTo.client.smsMode` (string)
    Example: "fallback"

  - `assignedTo.client.smsFallback` (boolean)
    Example: true

  - `assignedTo.client.smsUserId` (string)
    Example: "support@ecommunicate.co.za"

  - `assignedTo.client.smsPassword` (string)
    Example: "********"

  - `assignedTo.client.smsClientRef` (string)
    Example: "ecomtest1"

  - `assignedTo.client.reseller` (boolean)

  - `assignedTo.client.parentClient` (object,null)

  - `assignedTo.client.license` (object,null)

  - `assignedTo.client.useParentNumber` (boolean)

  - `assignedTo.client.useParentCredit` (boolean)

  - `assignedTo.client.userInitiatedConversationBalance` (number)
    Example: 100

  - `assignedTo.client.businessInitiatedConversationBalance` (number)
    Example: 973

  - `assignedTo.client.popiaComplianceEnabled` (boolean)
    Example: true

  - `assignedTo.client.eligible1000Free` (boolean)
    Example: true

  - `assignedTo.client.splitConversation` (boolean)
    Example: true

  - `assignedTo.client.monthlyFundAllocation` (boolean)
    Example: true

  - `assignedTo.client.monthlyBusinessInitiatedBalanceAllocation` (number)
    Example: 1000

  - `assignedTo.client.monthlyUserInitiatedBalanceAllocation` (number)
    Example: 100

  - `assignedTo.client.useApi` (boolean)
    Example: true

  - `assignedTo.client.headerKeyPairsJson` (string)
    JSON array of key-value header pairs.
    Example: "[{\"key\": \"Authorization\", \"value\": \"your-api-key\"}]"

  - `assignedTo.clientRef` (string,null)

  - `assignedTo.ticketCount` (integer,null)
    Example: 5

  - `assignedTo.lastSeen` (string,null)

  - `assignedTo.resetPasswordEmailSent` (boolean)

  - `assignedTo.emailVerified` (boolean)

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

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

  - `assignedTo.agentChatLimit` (integer)
    Max concurrent chats.
    Example: 5

  - `assignedTo.availabilityStatus` (boolean)
    Example: true

  - `assignedTo.initialPassword` (boolean)

  - `assignedTo.tempAccount` (boolean)

  - `assignedTo.loginToken` (string)
    Example: "1d368c30-c9f8-4523-b8c2-3824ba72ff5c"

  - `assignedTo.validToken` (boolean)

  - `assignedTo.avatar` (string)
    Example: "https://example.com/avatars/jane.jpg"

  - `assignedTo.shouldGetNotifications` (boolean)
    Example: true

  - `assignedTo.applicationKey` (string)
    Example: "a3b4c5d6-e7f8-9012-a3b4-c5d6e7f89012"

  - `assignedTo.userId` (string)
    Example: "21c28d3e-bc5c-4bc9-99be-fe283df71653"

  - `assignedTo.applicationClientId` (string)
    Example: "1d368c30-c9f8-4523-b8c2-3824ba72ff5c"

  - `assignedTo.allowedSharedInbox` (boolean)
    Example: true

  - `assignedTo.allowedUnassignedInbox` (boolean)
    Example: true

  - `assignedTo.assignmentMessage` (string)
    Custom message sent to the customer when a chat is assigned to this agent. If null, defaults to 'Assigned to ``'.
    Example: "Hi, I'm Jane and I'll be assisting you today."

  - `lastAssignedAgent` (object)

  - `openedBy` (string)
    Example: "agent@example.com"

  - `terminatedBy` (string)
    Example: "agent@example.com"

  - `unread` (boolean)
    Example: true

  - `rated` (boolean)

  - `expectingRating` (boolean)

  - `companyName` (string)
    Example: "Acme Corp"

  - `accountNumber` (string)
    Example: "ACC-001234"

  - `activeFlow` (string)
    Example: "main_support_flow"

  - `nodeName` (string)
    Example: "Welcome Node"

  - `botName` (string)
    Example: "Support Bot"

  - `timezone` (string)
    Example: "Africa/Johannesburg"

  - `gstn` (string)
    Global system tracking number
    Example: "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"

  - `ctn` (string)
    Client tracking number
    Example: "b2c3d4e5-f6a7-8901-b2c3-d4e5f6a78901"

## 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"


