Update message feedback

PUT/v2/agents/{agentId}/conversations/{conversationId}/messages/{messageId}/feedback

Rate one reply of an agent as positive or negative and add a comment, so you can find weak answers and improve your sources.

Working draft. These docs are illustrative: names, endpoints and examples describe the intended behaviour and can change before launch.

Sets the feedback on one message of an agent. Call it when your own interface has thumbs up and thumbs down buttons, or when a reviewer on your team rates replies in bulk. A new call replaces the earlier feedback on that message.

Request

PUT /v2/agents/{agentId}/conversations/{conversationId}/messages/{messageId}/feedback

Path parameters:

Name Type Required Description
agentId string Yes The ID of the agent, starting with agt_.
conversationId string Yes The ID of the conversation, starting with conv_.
messageId string Yes The ID of the message to rate, starting with msg_.

Body fields:

Name Type Required Description
rating string Yes positive or negative.
comment string No A short note about why. Leave it out for no comment.

Only replies of the agent can be rated, so the message must have the role assistant. Get the message IDs from List conversation messages.

Example request

curl -X PUT https://api.askocto.co/v2/agents/agt_8f3k2m/conversations/conv_5n2p8w/messages/msg_7c1k9s/feedback \
  -H "Authorization: Bearer $OCTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "rating": "negative", "comment": "Did not mention the 30 day return window." }'
const response = await fetch(
  "https://api.askocto.co/v2/agents/agt_8f3k2m/conversations/conv_5n2p8w/messages/msg_7c1k9s/feedback",
  {
    method: "PUT",
    headers: {
      Authorization: `Bearer ${process.env.OCTO_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      rating: "negative",
      comment: "Did not mention the 30 day return window.",
    }),
  },
)

const message = await response.json()
console.log(message.id, message.feedback.rating)

Example response

A successful call returns 200 OK with the updated message.

{
  "id": "msg_7c1k9s",
  "conversationId": "conv_5n2p8w",
  "role": "assistant",
  "content": "I am sorry about the jacket. Can you share your order number?",
  "sources": [{ "id": "src_91xa7d", "title": "Returns and refunds" }],
  "feedback": {
    "rating": "negative",
    "comment": "Did not mention the 30 day return window."
  },
  "createdAt": "2026-03-20T13:58:04Z"
}

Response fields

The response is the message object, with the fields described in List conversation messages. The feedback field now holds the rating and comment you sent, and comment is null when you left it out.

Negative ratings with a comment are a good list of what to add to your sources. Combine them with Search conversations to see how often a topic comes up.

Errors

Status Code When
400 invalid_request rating is missing or not positive or negative, or the message is not a reply of the agent.
401 unauthorized The API key is missing, malformed or deleted.
404 not_found The agent, the conversation or the message does not exist in your workspace.
429 rate_limited Too many requests. Wait for the number of seconds in the Retry-After header.

Something unclear or missing? Tell us and we will fix the page.