Skip to content

Terminate or reopen a chat conversation
deprecated

Request

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.

Security
apikeyAuth
Bodyapplication/jsonrequired
idstring
Example:"cp-a1b2c3d4"
firstNamestring
Example:"John"
lastNamestring
Example:"Doe"
fullNamestring
Example:"John Doe"
phoneNumberstring
Example:"27821234567"
userIdstring

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

Customer's optional WhatsApp username (display only).

Example:"johndoe"
parentUserIdstring

BSUID of the parent WhatsApp Business portfolio, when applicable.

Example:"ZA.1000000000000000"
emailstring
Example:"john.doe@example.com"
subjectstring
Example:"Billing Inquiry"
teamstring
Example:"Support Team"
whatsAppClientNumberstring
Example:"+27123456789"
conversationClosedboolean
Example:false
missedConversationboolean
Example:false
afterHoursConversationboolean
Example:false
chatBotConversationboolean
Example:true
sendRatingWidgetboolean
Example:false
clientRefstring
Example:"Growthpoint"
createdTimestring, (date-time)
Example:"2026-01-15T08:00:00Z"
lastMessageTimestring, (date-time)
Example:"2026-01-15T10:35:00Z"
customerLastMessageTimestring or null, (date-time)
Example:"2026-01-15T10:30:00Z"
channelstring
Enum:"WHATSAPP""WEB""FACEBOOK"
Example:"WHATSAPP"
conversationStatusstring
Example:"OPEN"
senderstring
Example:"+27821234567"
assignedToobject(SystemUser)
lastAssignedAgentobject(SystemUser)
openedBystring
Example:"agent@example.com"
terminatedBystring
Example:"agent@example.com"
unreadboolean
Example:true
ratedboolean
Example:false
expectingRatingboolean
Example:false
companyNamestring
Example:"Acme Corp"
accountNumberstring
Example:"ACC-001234"
activeFlowstring
Example:"main_support_flow"
nodeNamestring
Example:"Welcome Node"
botNamestring
Example:"Support Bot"
timezonestring
Example:"Africa/Johannesburg"
gstnstring, (uuid)

Global system tracking number

Example:"a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
ctnstring, (uuid)

Client tracking number

Example:"b2c3d4e5-f6a7-8901-b2c3-d4e5f6a78901"
curl -i -X PUT \
  https://ecommunicate-api-docs.redocly.app/_mock/apis/omnichannel/pl4chat-service/ChatParticipant/terminateChatParticipantChat \
  -H 'Authorization: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "eb326385-70b2-4561-9b3a-123456789abc",
    "firstName": "John",
    "lastName": "Doe",
    "fullName": "John Doe",
    "phoneNumber": "27821234567",
    "email": "john.doe@example.com",
    "subject": "Billing Inquiry",
    "team": "Support Team",
    "whatsAppClientNumber": "+27123456789",
    "conversationClosed": true,
    "missedConversation": false,
    "afterHoursConversation": false,
    "chatBotConversation": true,
    "sendRatingWidget": false,
    "clientRef": "Growthpoint",
    "createdTime": "2026-01-15T08:00:00Z",
    "lastMessageTime": "2026-01-15T10:35:00Z",
    "customerLastMessageTime": "2026-01-15T10:30:00Z",
    "channel": "WHATSAPP",
    "conversationStatus": "OPEN",
    "sender": "+27821234567",
    "assignedTo": {
      "id": "21c28d3e-bc5c-4bc9-99be-fe283df71abc"
    },
    "lastAssignedAgent": {
      "id": "21c28d3e-bc5c-4bc9-99be-fe283df71abc"
    },
    "openedBy": "agent@example.com",
    "terminatedBy": "agent@example.com",
    "unread": true,
    "rated": false,
    "expectingRating": false,
    "companyName": "Acme Corp",
    "accountNumber": "ACC-001234",
    "activeFlow": "main_support_flow",
    "nodeName": "Welcome Node",
    "botName": "Support Bot",
    "timezone": "Africa/Johannesburg",
    "gstn": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
    "ctn": "b2c3d4e5-f6a7-8901-b2c3-d4e5f6a78901"
  }'

Responses

The updated chat participant object reflecting the new conversation state

Bodyapplication/json
idstring
Example:"cp-a1b2c3d4"
firstNamestring
Example:"John"
lastNamestring
Example:"Doe"
fullNamestring
Example:"John Doe"
phoneNumberstring
Example:"27821234567"
userIdstring

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

Customer's optional WhatsApp username (display only).

Example:"johndoe"
parentUserIdstring

BSUID of the parent WhatsApp Business portfolio, when applicable.

Example:"ZA.1000000000000000"
emailstring
Example:"john.doe@example.com"
subjectstring
Example:"Billing Inquiry"
teamstring
Example:"Support Team"
whatsAppClientNumberstring
Example:"+27123456789"
conversationClosedboolean
Example:false
missedConversationboolean
Example:false
afterHoursConversationboolean
Example:false
chatBotConversationboolean
Example:true
sendRatingWidgetboolean
Example:false
clientRefstring
Example:"Growthpoint"
createdTimestring, (date-time)
Example:"2026-01-15T08:00:00Z"
lastMessageTimestring, (date-time)
Example:"2026-01-15T10:35:00Z"
customerLastMessageTimestring or null, (date-time)
Example:"2026-01-15T10:30:00Z"
channelstring
Enum:"WHATSAPP""WEB""FACEBOOK"
Example:"WHATSAPP"
conversationStatusstring
Example:"OPEN"
senderstring
Example:"+27821234567"
assignedToobject(SystemUser)
lastAssignedAgentobject(SystemUser)
openedBystring
Example:"agent@example.com"
terminatedBystring
Example:"agent@example.com"
unreadboolean
Example:true
ratedboolean
Example:false
expectingRatingboolean
Example:false
companyNamestring
Example:"Acme Corp"
accountNumberstring
Example:"ACC-001234"
activeFlowstring
Example:"main_support_flow"
nodeNamestring
Example:"Welcome Node"
botNamestring
Example:"Support Bot"
timezonestring
Example:"Africa/Johannesburg"
gstnstring, (uuid)

Global system tracking number

Example:"a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890"
ctnstring, (uuid)

Client tracking number

Example:"b2c3d4e5-f6a7-8901-b2c3-d4e5f6a78901"
Response
{ "id": "cp-a1b2c3d4", "firstName": "John", "lastName": "Doe", "fullName": "John Doe", "phoneNumber": "27821234567", "userId": "ZA.1021033720668862", "username": "johndoe", "parentUserId": "ZA.1000000000000000", "email": "john.doe@example.com", "subject": "Billing Inquiry", "team": "Support Team", "whatsAppClientNumber": "+27123456789", "conversationClosed": false, "missedConversation": false, "afterHoursConversation": false, "chatBotConversation": true, "sendRatingWidget": false, "clientRef": "Growthpoint", "createdTime": "2026-01-15T08:00:00Z", "lastMessageTime": "2026-01-15T10:35:00Z", "customerLastMessageTime": "2026-01-15T10:30:00Z", "channel": "WHATSAPP", "conversationStatus": "OPEN", "sender": "+27821234567", "assignedTo": { … }, "lastAssignedAgent": { … }, "openedBy": "agent@example.com", "terminatedBy": "agent@example.com", "unread": true, "rated": false, "expectingRating": false, "companyName": "Acme Corp", "accountNumber": "ACC-001234", "activeFlow": "main_support_flow", "nodeName": "Welcome Node", "botName": "Support Bot", "timezone": "Africa/Johannesburg", "gstn": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890", "ctn": "b2c3d4e5-f6a7-8901-b2c3-d4e5f6a78901" }