Open participant stream
GET/participants/:user_id/stream
Open a new participant stream to listen for new events from the server.
The server sends the Server Sent Event in plain text to the client in this format when there is an event.
data: {"eventType": "ACTION_PLAN_CARDS_ADDED", payload: [.....] }
EventTypes
KEEP_ALIVE This will be issued every 15 seconds to the client so the connection is kept open. you can simply ignore this.
MESSAGE_SENT This will be issued when there is a message sent from the server. This can be used for building a chat application The payload for this event can be found from api/v1/docs#/schemas/ChatMessage
ACTION_PLAN_CARDS_ADDED This will be issued when a new activity card is created from the backend. This is the event to render a card ( one-off activity or a message card ) or cards (if the payload has more than one item) The payload of this event can be found from the /activity_plan_cards/search
ACTION_PLAN_CARD_RESPONDED This will be issued when a participant responds to an activity card. The payload of this event can be found from the /activity_plan_cards/search
CHAT_SESSION_MEMBER_REQUESTED This will be issued when a coach tried to join a locked chat session.
CHAT_SESSION_MEMBER_JOINED This will be issued when a new member joins the chat session.
CHAT_SESSION_MEMBER_LEFT This will be issued when a member leaves the chat session.
payload for these events will have the following structure
{
"sessionId": "string",
"participantId": "string",
"memberId": "string",
"memberType": "string",
"memberName": "string",
"photoUrl": "string or null"
}
CHAT_SESSION_MEMBER_APPROVED This will be issued when an existing session member approves the coach to join the chat session.
CHAT_SESSION_MEMBER_REJECTED This will be issued when an existing session member rejects the coach to join the chat session.
The payload for these events will have the following structure
{
"sessionId": "string",
"participantId": "string",
"memberId": "string",
"memberType": "string",
"memberName": "string",
"approvedBy": "string", // or "rejectedBy": "string"
}
PARTICIPANT_EXTRA_VALUE_CHANGED This will be issued when a participant extra value is changed.
The payload for these events will have the following structure
{
"updatedAt": "2025-09-30T22:06:08Z",
"extraCode": "EXTRA_A_2S21",
"extraGroup": "PARTICIPANT",
"extraName": "Extra A",
"extraValue": "Testing SSE",
"id": "3", // extra ID
"participantId": "40"
}
** It is recommended to use EventSourcePolly from https://github.com/Yaffle/EventSource This will extend the EventSource to have Headers for the auth token.
sse = new EventSourcePolyfill(streamURL, {
headers: {
"Authorization": "Bearer ${authToken}",
"X-API-Key": "${apiKey}"
}
});
Request
Responses
- 200
- 400
- 401
- 409
- 422
- 500
OK
Bad Request
Unauthorized
Conflict
Unprocessable Entity
Internal Server Error