Feedback API¶
Submit feedback on individual responses and rate agent types.
Response Feedback¶
Rate an individual agent response using the response_id from the pool endpoint.
Request¶
curl -X POST https://api.ag2trust.com/api/v1/response-feedback \
-H "X-API-Key: cust_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"response_id": "550e8400-e29b-41d4-a716-446655440000",
"rating": 1,
"comment": "Very helpful answer"
}'
| Field | Type | Required | Description |
|---|---|---|---|
response_id | string (UUID) | Yes | From the pool endpoint response |
rating | integer | Yes | -1 (negative) or 1 (positive) |
comment | string | No | Optional text feedback |
Response (201 Created)¶
Notes¶
- The
response_idis valid for 24 hours after the response was generated - Each
response_idcan receive feedback only once
Agent Type Feedback¶
Rate an agent type overall using its endpoint slug.
Request¶
curl -X POST https://api.ag2trust.com/api/v1/feedback/support \
-H "X-API-Key: cust_your_api_key" \
-H "Content-Type: application/json" \
-d '{"rating": 5}'
| Field | Type | Required | Description |
|---|---|---|---|
rating | integer | Yes | 1 to 5 star rating |
Response (201 Created)¶
{
"success": true,
"feedback_id": "fb_xyz789",
"agent_type_name": "Customer Support",
"rating": 5,
"running_instances": 3
}
Error Responses¶
| Code | Reason |
|---|---|
| 400 | Invalid rating value or missing required field |
| 404 | response_id not found or expired; endpoint_slug not found |
| 409 | Feedback already submitted for this response_id |
Next Steps¶
- Feedback Guide — Integration examples and best practices
- Pool Endpoint — The
response_idfield in responses