Logo
Search
API Docs

Update Session API

Chat Agents

Update Session API

Overview

Chat API & Session Management covers creating a session and using it to maintain context across chat requests, but not changing a session after it's created. This page fills that gap: the endpoint for updating a session's name, status, expiration, and message history.


Endpoint

PATCH https://api.sulus.ai/session/{id}
ParameterLocationRequiredDescription
idpathYesThe unique identifier of the session to update.
AuthorizationheaderYesBearer <YOUR_API_KEY>

UpdateSessionDTO Fields

FieldTypeDescription
namestringNew name for the session. Maximum length is 40 characters.
statusstring (enum)New status for the session. Valid values: active, completed.
expirationSecondsnumberSession expiration time in seconds. Defaults to 86400 (24 hours) if not set.
messagesarrayUpdated array of chat messages for the session.

Worked Example: Marking a Session Completed

Once a conversation is finished, update the session's status so it's no longer treated as an active, ongoing thread:

curl -X PATCH https://api.sulus.ai/session/session_xyz789 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "completed"
  }'

The response is the full, updated Session object. You can combine multiple fields in a single request — for example, updating status and expirationSeconds together.