Chat
Close Session
Close an open session. No further messages can be sent after closing.
PATCH
Close session
Every endpoint on this page requires either a Clerk-issued JWT (
Authorization: Bearer <token>) or
an organization API key (x-api-key: pk_…). Anonymous calls return 401 Unauthorized. See
Authentication for the full setup.Closing a session triggers
session.closed webhooks if you have them configured. Closed sessions remain readable — you can still fetch messages and session details.Code examples
Sample response
Authorizations
Path Parameters
Body
application/json
Optional reason for closing the session.
Example:
"RESOLVED"
Close session