Share and feedback
Send event feedback
Send feedback flagging one step of a session as right or wrong.
PUT
/
api
/
v2
/
sessions
/
{id}
/
events
/
{event_index}
/
feedback
from hai_agents import Client
client = Client()
client.sessions.submit_event_feedback(
session_id,
5,
success=False,
message="Agent clicked the wrong button at this step",
)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
await client.sessions.submitEventFeedback({
id: sessionId,
eventIndex: 5,
body: {
success: false,
message: "Agent clicked the wrong button at this step",
},
});
curl -X PUT https://agp.eu.hcompany.ai/api/v2/sessions/$SESSION_ID/events/5/feedback \
-H "Authorization: Bearer $HAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"success": false,
"message": "Agent clicked the wrong button at this step"
}'
Behavior
Works on sessions you own. For the whole session, send session feedback.Path parameters
string
required
The session ID.
integer
required
The event’s position in the session’s event list.
Request body
boolean
required
Whether this step was correct.
string
Details on the feedback.
Response
204 No Content.
from hai_agents import Client
client = Client()
client.sessions.submit_event_feedback(
session_id,
5,
success=False,
message="Agent clicked the wrong button at this step",
)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
await client.sessions.submitEventFeedback({
id: sessionId,
eventIndex: 5,
body: {
success: false,
message: "Agent clicked the wrong button at this step",
},
});
curl -X PUT https://agp.eu.hcompany.ai/api/v2/sessions/$SESSION_ID/events/5/feedback \
-H "Authorization: Bearer $HAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"success": false,
"message": "Agent clicked the wrong button at this step"
}'
Errors
| Status | Cause |
|---|---|
404 | Not found, or not in your organization. Also sent when event_index is out of range. |
Was this page helpful?
⌘I
from hai_agents import Client
client = Client()
client.sessions.submit_event_feedback(
session_id,
5,
success=False,
message="Agent clicked the wrong button at this step",
)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
await client.sessions.submitEventFeedback({
id: sessionId,
eventIndex: 5,
body: {
success: false,
message: "Agent clicked the wrong button at this step",
},
});
curl -X PUT https://agp.eu.hcompany.ai/api/v2/sessions/$SESSION_ID/events/5/feedback \
-H "Authorization: Bearer $HAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"success": false,
"message": "Agent clicked the wrong button at this step"
}'