The Context Engine Studio is now open source.  View on GitHub →
Clinia
Sessions

Append session messages

Deprecated
POST
/v1/patients/{patientId}/sessions/{sessionId}/messages

Appends user/assistant messages to a session, in order, creating the session if this is its first write, and queues memory formation over them. The returned ingestion is the receipt to poll. Tool-call turns are recorded separately by the MCP layer and are not accepted here.

New ids are limited to [A-Za-z0-9][A-Za-z0-9.~:-]{0,127}, but you can keep referring to previous ids as they were defined.

Deprecated: use POST …/ingestions/sessions, which accepts the same messages under the session's id.

Authorization

Bearer write
AuthorizationBearer <token>

Each operation lists the OAuth scope (read or write) it requires.

In: header

Scope: write

Path Parameters

patientId*string

ID of the patient

Match^[A-Za-z0-9._~:-]{1,128}$
sessionId*string

Unique session ID returned when the session was created.

Length1 <= length

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Messages to append to an open session.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/v1/patients/string/sessions/string/messages" \  -H "Content-Type: application/json" \  -d '{    "messages": [      {        "role": "user",        "content": "string"      }    ]  }'
{  "ok": true,  "messageCount": 0,  "ingestion": {    "ingestionId": "string",    "source": "fhir/r4",    "mimeType": "string",    "receivedAt": "string",    "status": "pending",    "staged": {      "facts": 0,      "events": 0,      "narratives": 0,      "messages": 0    },    "intake": [      {        "unit": "resource",        "received": 0,        "entries": [          {            "kind": "string",            "label": "string",            "count": 1,            "outcome": "structured",            "reason": "unsupported"          }        ],        "sessionId": "string"      }    ],    "startedAt": "string",    "completedAt": "string",    "failure": {      "code": "string",      "message": "string"    }  }}