Append Session Message
Persist one verbatim chat turn into the conversation-history store.
This is the chat-history write path (ADR-0020). It writes ONLY to
conversation_messages via the conversation writer
(:func:append_message); it never touches the EDN memory engine
(memory_records). The two stores are independent by design and
this endpoint runs alongside, never through, POST /api/v1/memory/ingest.
The writer is caller-commits, so this endpoint owns the commit,
mirroring create_session. append_message validates role
in (422), caps content at 100000 chars (422),
enforces session ownership via ensure_session_owned_or_create
(404 on another user’s session, creates the session row on first
use), and bumps the session’s denormalised sidebar fields.
IDOR AUDIT PASS — append_message gates on session ownership scoped
to the authenticated user_id before any write.
Authorizations
EDN API key presented as 'Bearer ' in the Authorization header. Create and manage keys from the Console.
