---
schema_version: "1"
id: 2b73c98de7092903d200bf3187aa50fdc47031bfe134cc0df95bc1d2180473c6
title: Server-Sent Events Structure
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/service-cloud/messaging-api/references/server-sent-events-structure.md
canonical_url: https://developer.salesforce.com/docs/service/messaging-api/references/about/server-sent-events-structure.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: a8917a8e5c946374dd7dbd90697f489732dc89a735caaa928d02e852334ab928
products:
  - Enhanced Chat API
  - Service Cloud Developer Content
---
# Server-Sent Events Structure

Clients subscribe to the Server-Sent Events endpoint to receive server-side events.

These events encompass diverse message entries and provide supplementary information related to the conversation entry.

For a comprehensive understanding of the various supported message types and formats, please refer to the “Message Types & Format Types” section.

**Important:** New event types can be introduced at any time as the Messaging API evolves. To ensure that your integration remains stable when new events are added, your implementation must ignore unrecognized event types, rather than throwing errors or failing. 

## CONVERSATION_CLOSE_CONVERSATION

The CONVERSATION_CLOSE_CONVERSATION event handles when the client receives an indicator or a confirmation that the conversation is closed.

This event only triggers when the end user closes the conversation, not when an agent ends a session. To handle when sessions end regardless of who initiated it, see the [CONVERSATION_SESSION_STATUS_CHANGED](#conversation_session_status_changed) event.

Add the following payload to the [Server-Sent Events](https://developer.salesforce.com/docs/service/messaging-api/references/about/server-sent-events.md) endpoint.

```json
"{\"entryType\":\"CloseConversation\",\"id\":\"28abcd89-5b99-4162-966f-70fee8588b17\",\"conversationIdentifier\":\"9d1357a8-9a31-4ae2-a13b-6781a6b15045\"}",
```

## CONVERSATION_DELIVERY_ACKNOWLEDGEMENT

The CONVERSATION_DELIVERY_ACKNOWLEDGEMENT event handles when an end user receives an acknowledgment for their message when it is ‘Delivered’.

Add the following payload to the [Server-Sent Events](https://developer.salesforce.com/docs/service/messaging-api/references/about/server-sent-events.md) endpoint.

```json
"{\"entryType\":\"DeliveryAcknowledgement\",\"id\":\"2f4548b2-42d7-4535-82dd-d2b0fb38ab95\",\"recipient\":{\"role\":\"Agent\",\"appType\":\"agent\",\"subject\":\"005SB000000AEkr\",\"clientIdentifier\":null},\"acknowledgedConversationEntryIdentifier\":\"7f7700aa-7ae4-4cf6-b23d-8f5ae11cbf72\",\"acknowledgementTimestamp\":1713391682342}",
```

## CONVERSATION_MESSAGE

The CONVERSATION_MESSAGE event handles when a conversation message comes through the event source (SSE).

Add the following payload to the [Server-Sent Events](https://developer.salesforce.com/docs/service/messaging-api/references/about/server-sent-events.md) endpoint.

```json
"{\"entryType\":\"Message\",\"id\":\"98ff46c3-358e-43e1-b70a-981d403374e9\",\"abstractMessage\":{\"messageType\":\"StaticContentMessage\",\"inReplyToMessageId\":null,\"id\":\"98ff46c3-358e-43e1-b70a-981d403374e9\",\"references\":[],\"staticContent\":{\"formatType\":\"Text\",\"text\":\"hi\"}},\"messageReason\":null}",
```

## CONVERSATION_PARTICIPANT_CHANGED

The CONVERSATION_PARTICIPANT_CHANGED event handles when a new participant joins a conversation or an existing participant leaves. This event applies to a participant other than the end user using the Enhanced Chat client.

Add the following payload to the [Server-Sent Events](https://developer.salesforce.com/docs/service/messaging-api/references/about/server-sent-events.md) endpoint.

```json
"{\"entryType\":\"ParticipantChanged\",\"id\":\"889fb316-6627-4158-9a91-4f641870899c\",\"entries\":[{\"operation\":\"add\",\"menuMetadata\":null,\"participant\":{\"role\":\"Agent\",\"appType\":\"agent\",\"subject\":\"005SB000000AEkr\",\"clientIdentifier\":\"\"},\"displayName\":\"Jessica T\"}]}",

"{\"entryType\":\"ParticipantChanged\",\"id\":\"ff2dcd62-d8b1-43b0-9165-f7b21d0f1bb4\",\"entries\":[{\"operation\":\"remove\",\"menuMetadata\":null,\"participant\":{\"role\":\"Agent\",\"appType\":\"agent\",\"subject\":\"005SG0000018413\",\"clientIdentifier\":\"\"},\"displayName\":\"Admin U\"}]}"
```

## CONVERSATION_PROGRESS_INDICATOR

The CONVERSATION_PROGRESS_INDICATOR event allows you to display a progress indicator when an AI agent is responding to a conversation. Progress indicators are useful to provide more information and context to users when an AI Agent is executing complex actions.

Add the following payload to the [Server-Sent Events](https://developer.salesforce.com/docs/service/messaging-api/references/about/server-sent-events.md) endpoint.

```json
"{\"entryType\":\"ProgressIndicator\",\"id\":\"a7ba79d6-6ee5-402c-936c-d2716682c4ed\",\"progressIndicator\":{\"indicatorType\":\"ProgressUpdateIndicator\",\"progressMessage\":{\"formatType\":\"Text\",\"text\":\"Calling agent action: SvcCopilotTmpl__GetAllCasesForContact\"}}}",
```

## CONVERSATION_QUEUE_POSITION

The CONVERSATION_QUEUE_POSITION event handles when the queue position of a chat in the service queue is updated.

Add the following payload to the [Server-Sent Events](https://developer.salesforce.com/docs/service/messaging-api/references/about/server-sent-events.md) endpoint.

```json
"{\"entryType\":\"QueuePosition\",\"pendingServiceRoutingId\":\"0JRSG0000039WoX\",\"workItemId\":\"0MwSG00000DQVQU\",\"position\":1}"
```

## CONVERSATION_READ_ACKNOWLEDGEMENT

The CONVERSATION_READ_ACKNOWLEDGEMENT event handles when an end user receives an acknowledgment for their message when it is ‘Read’.

Add the following payload to the [Server-Sent Events](https://developer.salesforce.com/docs/service/messaging-api/references/about/server-sent-events.md) endpoint.

```json
"{\"entryType\":\"ReadAcknowledgement\",\"id\":\"52824f00-2365-4ab8-9e27-827d08d5b4d4\",\"recipient\":{\"role\":\"Agent\",\"appType\":\"agent\",\"subject\":\"005SB000000AEkr\",\"clientIdentifier\":null},\"acknowledgedConversationEntryIdentifier\":\"7f7700aa-7ae4-4cf6-b23d-8f5ae11cbf72\",\"acknowledgementTimestamp\":1713391759278}",
```

## CONVERSATION_ROUTING_RESULT

The CONVERSATION_ROUTING_RESULT event handles routing to a rep or chatbot, such as when a conversation is initially created or when a conversation is transferred from a chatbot to a rep.

Add the following payload to the [Server-Sent Events](https://developer.salesforce.com/docs/service/messaging-api/references/about/server-sent-events.md) endpoint.

```json
"{\"entryType\":\"RoutingResult\",\"id\":\"3dd5edf6-49f1-464b-8d59-f53d8ff18528\",\"recordId\":\"0MwSB000007tiXR\",\"errorMessages\":[],\"pendingServiceRoutingId\":\"0JRSB0000029uEk\",\"routingType\":\"Initial\",\"estimatedWaitTime\":{\"estimatedWaitTimeInSeconds\":-1,\"isEWTRequested\":true},\"failureReason\":\"\",\"failureType\":\"None\",\"routingConfigurationDetails\":{\"routingConfigurationType\":\"QueueRoutingType\",\"queueId\":\"00GSB0000002RNV\"}}",
```

## CONVERSATION_SESSION_STATUS_CHANGED

The CONVERSATION_SESSION_STATUS_CHANGED event notifies when a messaging session's status changes. For example, this event is triggered when a messaging session status changes to `NEW`, `ACTIVE`, `INACTIVE`, or `ENDED`. This event allows you to track whether a session was created, accepted, or ended. This event is especially useful because the [CONVERSATION_CLOSE_CONVERSATION](#conversation_close_conversation) event only triggers when the end user closes the conversation, not when an agent ends a session. The session status change event fills that gap by letting you detect when sessions end regardless of who initiated it.

Add the following payload to the [Server-Sent Events](https://developer.salesforce.com/docs/service/messaging-api/references/about/server-sent-events.md) endpoint.

```json
"{\"entryType\":\"SessionStatusChanged\",\"id\":\"fe7991bd-d863-4d8f-8ca9-ae52dd4b3d93\",\"conversationIdentifier\":\"f804aa54-e77e-4958-8840-79e0233ae4b0\",\"channelAddressIdentifier\":\"0aeba2ad-ff17-416f-8c70-7b0326220008\",\"sessionStatusPrev\":\"Waiting\",\"sessionEndedByRole\":null,\"sessionEndTime\":null,\"sessionStatus\":\"Active\",\"sessionStartTime\":1767740596000,\"sessionId\":\"0MwSB00000WMkZk\"}",
```

## CONVERSATION_STREAMING_TOKEN

The CONVERSATION_STREAMING_TOKEN event allows you to feed partial responses in real time as they become available, engaging users immediately and allowing them to consume content sooner.

Add the following payload to the [Server-Sent Events](https://developer.salesforce.com/docs/service/messaging-api/references/about/server-sent-events.md) endpoint.

```json
"{\"entryType\":\"StreamingToken\",\"id\":\"5f1085c6-e933-49d3-bf87-f7d52fac149a\",\"streamingToken\":{\"tokenType\":\"MessageStreamingToken\",\"sequenceNumber\":1,\"timestamp\":1741299980669,\"targetMessageIdentifier\":\"1741299974320-REQ-1\",\"token\":{\"formatType\":\"Text\",\"text\":\"Agentforce is a powerful tool that helps companies build AI agents to drive customer\"}}}",
```

The token type `StreamingTokenValidation` notifies you when there's an issue like hallucination in the tokens streamed.

```json
"{\"entryType\":\"StreamingToken\",\"id\":\"8b764460-fde7-4ad4-a9f9-b9ed85528542\",\"streamingToken\":{\"tokenType\":\"StreamingTokenValidation\",\"sequenceNumber\":1,\"timestamp\":1741302561902,\"result\":{\"valid\":false,\"reason\":\"UNGROUNDED\"},\"targetMessageIdentifier\":\"1741302557255-REQ-1\"}}",
```

## CONVERSATION_TYPING_STARTED_INDICATOR

The CONVERSATION_TYPING_STARTED_INDICATOR event handles when the client receives a “typing started” indicator when the other participant, such as a rep or chatbot, starts typing a message.

Add the following payload to the [Server-Sent Events](https://developer.salesforce.com/docs/service/messaging-api/references/about/server-sent-events.md) endpoint.

```json
"{\"entryType\":\"TypingStartedIndicator\",\"id\":\"0df87b90-d916-49a1-8739-fc59e6090668\",\"timestamp\":1713391872258}",
```

## CONVERSATION_TYPING_STOPPED_INDICATOR

The CONVERSATION_TYPING_STOPPED_INDICATOR event handles when the client receives a “typing stopped” indicator when the other participant, such as a rep or chatbot, stops typing a message.

Add the following payload to the [Server-Sent Events](https://developer.salesforce.com/docs/service/messaging-api/references/about/server-sent-events.md) endpoint.

```json
"{\"entryType\":\"TypingStoppedIndicator\",\"id\":\"60582fd0-d697-43b4-9b39-e014d6d62760\",\"timestamp\":1713391878151}",
```
