Skip to main content
DELETE
/
v1
/
widget
/
sessions
/
{sessionId}
Close widget session
curl --request DELETE \
  --url https://api.example.com/v1/widget/sessions/{sessionId} \
  --header 'Authorization: <authorization>'

Overview

Roadmap — not yet available. The embeddable widget is a future feature.
Closes a widget session immediately, invalidating the session token and terminating any active SSE streams. Use this when the user ends a chat session or navigates away. Authentication: Widget session token.

Request headers

Authorization
string
required
Widget session token. Format: Bearer <sessionToken>. Obtain from Create widget session.

Path parameters

sessionId
string
required
The widget session identifier to close.

Response

Returns 204 No Content on success.

Error responses

StatusError codeDescription
401unauthorizedMissing or invalid session token
404session_not_foundSession does not exist or already closed

Examples

curl https://api.causeflow.ai/v1/widget/sessions/wsess_01HX9VTPQR3KF8MZWBYD5N6JCE \
  -X DELETE \
  -H "Authorization: Bearer wst_live_EXAMPLE_TOKEN_REDACTED"

Create widget session

Start a new widget session

Send message

Send a message in a session