Skip to main content

Message Feedback

The Chat API provides an endpoint for submitting quality feedback on individual agent messages. This data is used to improve agent behavior and can be queried for analytics.

Endpoint​

PUT /chat/message-feedback?tenant={tenant}

Request Body​

{
"message_id": "uuid",
"judgement": "relevant" | "somewhat_relevant" | "not_relevant",
"agent_identifier": "string",
"comment": "string",
"conversation_id": "uuid"
}
FieldTypeRequiredDescription
message_idUUIDYesThe message_id from the agent's ChatMessage response
judgementenumYesRating: "relevant", "somewhat_relevant", or "not_relevant"
agent_identifierstringYesThe agent that produced the message
commentstringYesFree-text feedback or structured reasons
conversation_idUUIDNoLinks feedback to a conversation — use the session_id carried by the agent's message (see Conversations)

Example​

import os
import requests

TENANT = "zetaalpha"
headers = {
"Content-Type": "application/json",
"X-Auth": os.getenv("ZETA_ALPHA_API_KEY"),
}

requests.put(
f"https://api.zeta-alpha.com/v0/service/chat/message-feedback?tenant={TENANT}",
headers=headers,
json={
"message_id": "the-message-id-from-response",
"judgement": "relevant",
"agent_identifier": "custom_agent",
"comment": "Accurate and well-sourced answer",
},
)

Getting the message_id​

The message_id is returned in the agent's ChatMessage:

  • Non-streaming: response.json()["conversation"][-1]["message_id"]
  • Streaming: In the final SSE event's data, message["message_id"]

Judgement Values​

ValueMeaningTypical UI
relevantThe answer was helpful and accurate👍 Thumbs up
somewhat_relevantPartially useful but not fully satisfyingNeutral / partial
not_relevantThe answer was unhelpful or incorrect👎 Thumbs down

Using the comment Field​

The comment field accepts free-text. Common patterns:

  • User-typed feedback: "The answer was missing information about X"
  • Structured reasons: "factual_error,missing_citation"
  • Empty acknowledgment: "User clicked thumbs up"

Use whatever format suits your application — the field is stored as-is for later analysis.