Threads and messages
A thread (thr_…) is a conversation between a member and your assistant.
Opening a thread
Open a thread with POST /api/v1/members/{external_member_id}/threads, passing your assistant’s asst_… ID:
{
"assistant": "asst_4d9e2a7b1c8f3052e6a9c4b0"
}Bella returns 201 Created with a thr_… ID:
{
"id": "thr_9c41f0b7a2d64e83b15c7f20",
"external_member_id": "usr_94821",
"assistant": "asst_4d9e2a7b1c8f3052e6a9c4b0",
"created_at": "2026-08-02T10:16:00Z"
}The member must exist and have completed all onboarding phases (status: "completed"). If any phase is "pending", the request returns 409 Conflict.
Thread history vs. member memory
Bella separates conversation history from member memory:
- Thread history (
thr_…): Preserves the back-and-forth messages in a single conversation so the coach can resolve follow-up questions. - Member memory: Persists profile facts (stage of life, due date, goals, preferences) across all threads in memory.
This allows two common conversation models:
- Single ongoing thread: Maintain one
thr_…ID per member and send all messages to it. - Multiple topic threads: Open a new
thr_…when starting a new session. Memory persists automatically without repeating onboarding.
Sending messages and receiving replies
Send member messages via POST /api/v1/threads/{id}/messages with text (1 to 4,000 characters). Choose how responses are returned via stream:
| Mode | Request parameter | Response type | Best for |
|---|---|---|---|
| Synchronous | "stream": false (default) | application/json | Non-streaming chat UIs, background tasks, or scripts. |
| Streaming (SSE) | "stream": true | text/event-stream | Interactive chat UIs with live status indicators and real-time word streaming. |
In synchronous mode, Bella returns the thread ID and created message when complete:
{
"thread": "thr_9c41f0b7a2d64e83b15c7f20",
"message": {
"id": "msg_7d02edd7fc430c94162cba02",
"role": "coach",
"text": "At 24 weeks into your second trimester, modifying core work is all about managing intra-abdominal pressure...",
"created_at": "2026-11-08T23:08:00.123456Z"
}
}In streaming mode, Bella emits SSE frames (status → delta → done). See the Streaming replies guide for client parsers.
Retrieving thread history
Retrieve message history and metadata for a thread with GET /api/v1/threads/{id}.
Threads include a title (up to 100 characters). If omitted during creation, Bella generates one from the member’s initial message.