Skip to content

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.

POST /api/v1/response-feedback

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)

{
  "success": true,
  "feedback_id": "fb_abc123"
}

Notes

  • The response_id is valid for 24 hours after the response was generated
  • Each response_id can receive feedback only once

Agent Type Feedback

Rate an agent type overall using its endpoint slug.

POST /api/v1/feedback/{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