Sessions
Append session messages
DeprecatedAppends 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.
Usage
import { ContextEngineClient } from "@clinia/context-engine-js";
// Initialize the client
const client = new ContextEngineClient({
baseUrl: process.env.CLINIA_WORKSPACE,
auth: {
clientId: process.env.CLINIA_CLIENT_ID,
clientSecret: process.env.CLINIA_CLIENT_SECRET,
},
});
// Call the API, with the request body the API reference documents
const { data, error } = await client.sessions.appendMessages("<patient-id>", "<session-id>", body);
// Print the response
console.log(data ?? error);The environment variables are set in Install and authenticate, for JavaScript or Python.
API reference
POST /v1/patients/{patientId}/sessions/{sessionId}/messages documents the parameters, the request body and the responses.