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"
}
| Field | Type | Required | Description |
|---|---|---|---|
message_id | UUID | Yes | The message_id from the agent's ChatMessage response |
judgement | enum | Yes | Rating: "relevant", "somewhat_relevant", or "not_relevant" |
agent_identifier | string | Yes | The agent that produced the message |
comment | string | Yes | Free-text feedback or structured reasons |
conversation_id | UUID | No | Links feedback to a specific conversation session |
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": "chat_with_dynamic_retrieval",
"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
| Value | Meaning | Typical UI |
|---|---|---|
relevant | The answer was helpful and accurate | 👍 Thumbs up |
somewhat_relevant | Partially useful but not fully satisfying | Neutral / partial |
not_relevant | The 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.