Create a new thread for a user
Creates a new thread for the specified user and returns the full thread object (same shape as GET by id). The thread_id field is included for backwards compatibility and can be passed to the signedAppUrl endpoint via the open_thread action.
Responds 201 when a thread was created and 200 when an existing unused thread was returned instead, so a repeated call does not accumulate empty threads. Reuse is enabled per organization and never happens when initial_messages are supplied.
Request
- Base URLhttps://api.counselhealth.com (the document declares no server; this is the origin it was published from)
- AuthHTTP bearer
Headers
Optional idempotency key. Repeat requests with the same key and body return the original result.
Request body
Example request
{
"module": "get_care",
"initial_messages": [
{
"body": "Hello, how are you?",
"role": "patient"
}
],
"metadata": {
"external_session_id": "abc123",
"plan": "pro",
"linked_thread_title": "Lightheadedness when standing"
}
}Response
No thread was created — an existing unused thread matching this request (same module, smart pill, metadata and agent_context, with no messages from the user) was returned instead. Enabled per organization; requests that seed initial_messages always create.
Example response
{
"module": "get_care",
"metadata": {
"external_session_id": "abc123",
"plan": "pro",
"linked_thread_title": "Lightheadedness when standing"
},
"thread_id": "550e8400-e29b-41d4-a716-446655440000"
}Changes
No recorded changes to this operation across all 1 revision of this API.