Sulus offers two mutually exclusive methods for maintaining conversation context across chat requests — they cannot be used together in the same request.
previousChatId (simple conversation chaining)
Pass the id from the previous chat response as previousChatId in the next request:
curl -X POST https://api.sulus.ai/chat \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"assistantId": "your-assistant-id",
"previousChatId": "chat_abc123",
"input": "What was my name again?"
}'
sessionId (complex or long-running workflows)
Create a session first, then reference the returned session.id as sessionId in every subsequent chat request for that conversation:
curl -X POST https://api.sulus.ai/session \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"assistantId": "your-assistant-id"}'
curl -X POST https://api.sulus.ai/chat \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"sessionId": "session_xyz789",
"input": "Hello, I need help with billing"
}'
A session is tied to one assistant — you can't pass assistantId alongside sessionId. Sessions expire after 24 hours by default; after that, you'll need to create a new session.
| previousChatId | sessionId |
|---|
| Best for | Simple back-and-forth conversations | Complex, multi-step workflows |
| Setup | Minimal | Requires session creation first |
| Long-running conversations | Less ideal | Recommended |
| Multi-assistant support | Pass assistantId per request | Separate session per assistant |