v2
chat
chat

Submit message feedback

Changed on

Rate a reply in one of the caller's chats.

Saves the rating, one per reply and score name so rating again overwrites it, and scores it in Langfuse on the trace of the turn that wrote the reply, or on the chat's Langfuse session when that trace is not known. Langfuse being down does not fail the request; the response says where the score went.

post/api/chat/sessions/{session_id}/feedback

Request

  • The document declares no server URL.
  • Auth: HTTP bearer

Path parameters

session_idstring required

Request body

message_idstring required

The reply as the chat UI knows it: <session id>-seq-<N> for a reply loaded from the chat history, or the message's own id.

score_name'user-feedback' | 'copy' required

"user-feedback" for thumbs up/down, "copy" when the user copied the reply.

score_value0 | 1 required

1 for thumbs up or a copy, 0 for thumbs down.

commentstring nullable

What the user said was wrong, from the thumbs-down form.

Response

Successful Response

idstring required

The rating's id, which its Langfuse score shares.

langfuse_target'trace' | 'session' nullable

Where the Langfuse score went: the trace of the turn that wrote the reply, or the chat's Langfuse session when that trace is not known. Null when Langfuse is not configured or did not take the score; the rating is saved either way.

Changes