Wellness Chat API
The Wellness Chat API powers the 1CARE wellness assistant experience. It supports authenticated, streaming conversations focused on general wellness topics such as recovery, sleep, movement, nutrition, and interpretation of recent assessment context.
Authentication
Use a Firebase user token in the Authorization: Bearer <firebase_jwt> header.
The Wellness Chat module must be enabled for your client. If the feature is unavailable, contact your administrator.
Start Or Continue A Chat
POST /api/wellness-chat
Streams the assistant response for a new or existing chat thread.
This endpoint accepts either:
- A full
messagesarray for stateless requests, or - A
chatId/idplus the latestmessagewhen continuing a persisted chat
Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
id | string | No | Chat ID for a persisted thread |
chatId | string | No | Alias of id |
message | object | No | Latest user message when continuing a persisted thread |
messages | array | No | Full message list for a non-persisted or stateless request |
{
"id": "wellness-chat:123e4567-e89b-12d3-a456-426614174000",
"message": {
"id": "msg-001",
"role": "user",
"parts": [
{
"type": "text",
"text": "What are three simple ways to improve my sleep this week?"
}
]
}
}
Response:
The response is streamed. Client applications should consume it as an AI SDK UI message stream.
Chat History
GET /api/wellness-chat/chats
Returns the authenticated user's saved wellness chat threads.
{
"chats": [
{
"id": "wellness-chat:123e4567-e89b-12d3-a456-426614174000",
"user_id": "user-001",
"title": "What are three simple ways to improve my sleep this week?",
"created_at": "2026-03-18T10:00:00Z",
"updated_at": "2026-03-18T10:02:00Z"
}
],
"hasMore": false
}
GET /api/wellness-chat/chats/[chatId]
Returns a single chat thread and its saved messages.
{
"chat": {
"id": "wellness-chat:123e4567-e89b-12d3-a456-426614174000",
"user_id": "user-001",
"title": "What are three simple ways to improve my sleep this week?",
"created_at": "2026-03-18T10:00:00Z",
"updated_at": "2026-03-18T10:02:00Z"
},
"messages": [
{
"id": "msg-001",
"role": "user",
"parts": [
{
"type": "text",
"text": "What are three simple ways to improve my sleep this week?"
}
]
}
]
}
PATCH /api/wellness-chat/chats/[chatId]
Update the saved title for a wellness chat thread.
Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
title | string | Yes | New chat title |
{
"title": "Sleep improvement ideas"
}
{
"success": true
}
DELETE /api/wellness-chat/chats/[chatId]
Delete a saved wellness chat thread.
{
"success": true
}
Notes
- The assistant may incorporate user profile context and recent assessment context when relevant.
- Responses are informational and wellness-oriented. They are not a substitute for professional medical advice.