Skip to main content

Overview

The feedback management endpoints allow administrators to review user feedback, create golden examples, manage feedback settings, and generate AI-suggested improvements. These endpoints require the feedback.view or feedback.manage permissions.

Feedback Workflow

  1. Review - List and filter feedback submissions
  2. Analyze - View detailed context including original query and response
  3. Act - Resolve (create golden example), dismiss, or delete feedback
  4. Generate - Use AI to suggest improved responses for negative feedback
  5. Configure - Manage auto-approval settings

List All Feedback

Requires feedback.view permission

Query Parameters

limit
integer
default:"20"
Number of items to return (1-100)
offset
integer
default:"0"
Number of items to skip for pagination
status
string
Filter by status: pending, auto_approved, reviewed, or dismissed
type
string
Filter by feedback type: positive or negative
Search in query, response, or reason text

Response

items
array
Array of feedback items with full context
total
integer
Total number of feedback items matching filters
limit
integer
Number of items returned
offset
integer
Number of items skipped

Example Request

curl -X GET "https://api.example.com/feedback/admin/list?status=pending&type=negative&limit=10" \
  -H "Authorization: Bearer YOUR_TOKEN"

Example Response

{
  "items": [
    {
      "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
      "message_id": "550e8400-e29b-41d4-a716-446655440000",
      "user_id": "123e4567-e89b-12d3-a456-426614174000",
      "user_email": "[email protected]",
      "feedback_type": "negative",
      "reason": "Response was inaccurate",
      "status": "pending",
      "reviewed_by": null,
      "reviewer_email": null,
      "reviewed_at": null,
      "created_at": "2026-03-01T10:30:00Z",
      "original_query": "What is the incident resolution time?",
      "original_response": "The average resolution time is 2 hours.",
      "chat_id": "chat-123",
      "has_golden_example": false,
      "golden_example_id": null,
      "golden_response": null
    }
  ],
  "total": 1,
  "limit": 10,
  "offset": 0
}

Get Feedback Statistics

Requires feedback.view permission

Response

total_feedback
integer
Total number of feedback submissions
positive_count
integer
Number of positive feedback items
negative_count
integer
Number of negative feedback items
pending_count
integer
Number of pending items awaiting review
auto_approved_count
integer
Number of auto-approved items
reviewed_count
integer
Number of manually reviewed items
dismissed_count
integer
Number of dismissed items
golden_examples_count
integer
Total number of golden examples created from feedback

Example Request

cURL
curl -X GET https://api.example.com/feedback/admin/stats \
  -H "Authorization: Bearer YOUR_TOKEN"

Example Response

{
  "total_feedback": 1247,
  "positive_count": 892,
  "negative_count": 355,
  "pending_count": 42,
  "auto_approved_count": 850,
  "reviewed_count": 320,
  "dismissed_count": 35,
  "golden_examples_count": 1170
}

Get Feedback Details

Requires feedback.view permission

Path Parameters

feedback_id
string
required
ID of the feedback to retrieve

Response

Returns a FeedbackWithContext object with all details.

Example Request

cURL
curl -X GET https://api.example.com/feedback/admin/7c9e6679-7425-40de-944b-e07fc1f90ae7 \
  -H "Authorization: Bearer YOUR_TOKEN"

Resolve Feedback

Requires feedback.manage permission

Path Parameters

feedback_id
string
required
ID of the feedback to resolve

Request Body

golden_response
string
The ideal response.
  • For positive feedback: Optional. If not provided, uses the original response.
  • For negative feedback: Required. Must provide the corrected response.

Response

message
string
Success message
feedback_id
string
ID of the resolved feedback
golden_example_id
string
ID of the created golden example
status
string
New status: reviewed

Example Request

curl -X POST https://api.example.com/feedback/admin/7c9e6679-7425-40de-944b-e07fc1f90ae7/resolve \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Example Response

{
  "message": "Feedback resolved successfully",
  "feedback_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "golden_example_id": "8d8f7780-8536-51ef-b827-f18ed2091bf8",
  "status": "reviewed"
}

Dismiss Feedback

Requires feedback.manage permission

Path Parameters

feedback_id
string
required
ID of the feedback to dismiss

Request Body

reason
string
Optional reason for dismissal

Response

message
string
Success message
feedback_id
string
ID of the dismissed feedback
status
string
New status: dismissed

Example Request

cURL
curl -X POST https://api.example.com/feedback/admin/7c9e6679-7425-40de-944b-e07fc1f90ae7/dismiss \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "reason": "User error - question was unclear"
  }'

Example Response

{
  "message": "Feedback dismissed",
  "feedback_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "status": "dismissed"
}

Restore Feedback

Requires feedback.manage permission

Path Parameters

feedback_id
string
required
ID of the feedback to restore

Response

message
string
Success message
feedback_id
string
ID of the restored feedback
status
string
New status: pending

Example Request

cURL
curl -X POST https://api.example.com/feedback/admin/7c9e6679-7425-40de-944b-e07fc1f90ae7/restore \
  -H "Authorization: Bearer YOUR_TOKEN"

Example Response

{
  "message": "Feedback restored to pending",
  "feedback_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "status": "pending"
}

Delete Feedback

This action is permanent and cannot be undone. The associated golden example will also be deleted.
Requires feedback.manage permission

Path Parameters

feedback_id
string
required
ID of the feedback to delete

Response

message
string
Success message
feedback_id
string
ID of the deleted feedback

Example Request

cURL
curl -X DELETE https://api.example.com/feedback/admin/7c9e6679-7425-40de-944b-e07fc1f90ae7 \
  -H "Authorization: Bearer YOUR_TOKEN"

Example Response

{
  "message": "Feedback deleted successfully",
  "feedback_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
}

Generate AI Response

Requires feedback.manage permission
This endpoint uses the configured LLM with full RAG tool access to generate an improved response based on the feedback context. The AI autonomously decides whether to use additional tools for context.

Features

  • Specialized prompt for response improvement
  • Full access to incident lookup and knowledge base tools
  • Timeout protection (60 seconds)
  • Concurrency control to prevent overload

Path Parameters

feedback_id
string
required
ID of the feedback to generate a response for

Response

generated_response
string
The AI-generated improved response
tool_calls_made
integer
Number of RAG tool calls made during generation
generation_time_ms
integer
Time taken to generate the response in milliseconds
success
boolean
Whether generation was successful
error
string | null
Error message if generation failed

Example Request

curl -X POST https://api.example.com/feedback/admin/7c9e6679-7425-40de-944b-e07fc1f90ae7/generate-response \
  -H "Authorization: Bearer YOUR_TOKEN"

Example Response

{
  "generated_response": "The incident resolution time varies based on severity level:\n\n- P0 (Critical): 1 hour\n- P1 (High): 4 hours\n- P2 (Medium): 24 hours\n- P3 (Low): 72 hours\n\nThese are target resolution times, and actual resolution may vary based on complexity.",
  "tool_calls_made": 2,
  "generation_time_ms": 3421,
  "success": true,
  "error": null
}
Use the generated response as a starting point. You can edit it before resolving the feedback to create the golden example.

Get Feedback Settings

Requires feedback.manage permission

Response

auto_approve_positive
boolean
Whether positive feedback is automatically approved
auto_approve_negative
boolean
Whether negative feedback is automatically approved
require_reason_positive
boolean
Whether a reason is required for positive feedback
require_reason_negative
boolean
Whether a reason is required for negative feedback

Example Request

cURL
curl -X GET https://api.example.com/feedback/admin/settings \
  -H "Authorization: Bearer YOUR_TOKEN"

Example Response

{
  "auto_approve_positive": true,
  "auto_approve_negative": false,
  "require_reason_positive": false,
  "require_reason_negative": true
}

Update Feedback Settings

Requires feedback.manage permission

Request Body

All fields are optional. Only provided fields will be updated.
auto_approve_positive
boolean
Enable/disable auto-approval for positive feedback
auto_approve_negative
boolean
Enable/disable auto-approval for negative feedback
require_reason_positive
boolean
Require reason for positive feedback
require_reason_negative
boolean
Require reason for negative feedback

Response

Returns the updated FeedbackSettingsResponse.

Example Request

curl -X PUT https://api.example.com/feedback/admin/settings \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "auto_approve_positive": true,
    "auto_approve_negative": false,
    "require_reason_negative": true
  }'

Example Response

{
  "auto_approve_positive": true,
  "auto_approve_negative": false,
  "require_reason_positive": false,
  "require_reason_negative": true
}

Common Error Responses

400 Bad Request

{
  "detail": "Negative feedback requires a golden response to resolve"
}

401 Unauthorized

{
  "detail": "Not authenticated"
}

403 Forbidden

{
  "detail": "Insufficient permissions. Required: feedback.manage"
}

404 Not Found

{
  "detail": "Feedback not found"
}

500 Internal Server Error

{
  "detail": "Failed to generate response: Timeout after 60 seconds"
}

Best Practices

Filter Efficiently

Use status and type filters to prioritize review of pending negative feedback.

Use AI Generation

For negative feedback, use the generate-response endpoint to get AI-suggested improvements before resolving.

Enable Auto-Approval

Enable auto-approval for positive feedback to build golden examples automatically.

Review Regularly

Set up a regular review cadence for pending feedback to maintain response quality.

Build docs developers (and LLMs) love