Feedback
Service for managing UiPath Agent Feedback.
Feedback allows you to collect and manage user feedback on AI agent responses, including positive/negative ratings, comments, and categorized feedback. This is useful for monitoring agent quality, identifying areas for improvement, and building datasets for fine-tuning. Feedback on agent runs
Usage¶
Prerequisites: Initialize the SDK first - see Getting Started
import { Feedback } from '@uipath/uipath-typescript/feedback';
const feedback = new Feedback(sdk);
const allFeedback = await feedback.getAll();
Methods¶
createCategory()¶
createCategory(
category:string,options?:FeedbackCreateCategoryOptions):Promise<FeedbackCategoryResponse>
Creates a new feedback category.
Custom categories can be used to label feedback entries beyond the default system categories.
Once created, reference the category by its id when submitting or updating feedback.
If isPositive and isNegative are omitted, the backend defaults both to true.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
category |
string |
Name of the category to create (max 256 characters, unique per tenant) |
options? |
FeedbackCreateCategoryOptions |
Optional flags controlling whether the category applies to positive and/or negative feedback FeedbackCreateCategoryOptions |
Returns¶
Promise<FeedbackCategoryResponse>
Promise resolving to the created FeedbackCategoryResponse
Example¶
import { Feedback } from '@uipath/uipath-typescript/feedback';
const feedback = new Feedback(sdk);
// Minimum — applies to both positive and negative feedback by default
const category = await feedback.createCategory('Hallucination');
console.log(category.id, category.category);
// With explicit flags
const negativeOnly = await feedback.createCategory('Off-topic', {
isPositive: false,
isNegative: true,
});
deleteById()¶
deleteById(
id:string,options:FeedbackOptions):Promise<void>
Deletes a feedback entry by its ID.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
id |
string |
Feedback ID (GUID) of the entry to delete |
options |
FeedbackOptions |
Required options including folderKey for folder-level authorization FeedbackOptions |
Returns¶
Promise<void>
Promise resolving to void on success
Example¶
import { Feedback } from '@uipath/uipath-typescript/feedback';
const feedback = new Feedback(sdk);
const allFeedback = await feedback.getAll({ pageSize: 1 });
const feedbackId = allFeedback.items[0].id;
const folderKey = allFeedback.items[0].folderKey!;
await feedback.deleteById(feedbackId, { folderKey });
deleteCategory()¶
deleteCategory(
id:string,options?:FeedbackDeleteCategoryOptions):Promise<void>
Deletes a feedback category by its ID.
System default categories (Output, Agent Error, Agent Plan Execution) cannot be deleted —
attempting to do so throws a 409 Conflict error.
Use forceDelete to delete a custom category that already has feedback entries associated with it.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
id |
string |
Category ID (GUID) of the category to delete |
options? |
FeedbackDeleteCategoryOptions |
Optional deletion options FeedbackDeleteCategoryOptions |
Returns¶
Promise<void>
Promise resolving to void on success
Examples¶
import { Feedback } from '@uipath/uipath-typescript/feedback';
const feedback = new Feedback(sdk);
// Only custom categories (isDefault: false) can be deleted
const categories = await feedback.getCategories();
const customCategory = categories.items.find(c => !c.isDefault);
if (customCategory) {
await feedback.deleteCategory(customCategory.id);
}
// Force-delete a custom category that has associated feedback entries
const categories = await feedback.getCategories();
const customCategory = categories.items.find(c => !c.isDefault);
if (customCategory) {
await feedback.deleteCategory(customCategory.id, { forceDelete: true });
}
getAll()¶
getAll<
T>(options?:T):Promise<TextendsHasPaginationOptions<T> ?PaginatedResponse<FeedbackResponse> :NonPaginatedResponse<FeedbackResponse>>
Gets all feedback across all agents in the tenant, with optional filters.
Retrieves a list of feedback entries, optionally filtered by agent, trace, span, status, or agent version. When no pagination options are provided, the SDK returns up to 100 items. When pagination options are provided without a pageSize, the SDK defaults to 50 items per page.
Type Parameters¶
| Type Parameter | Default type |
|---|---|
T extends FeedbackGetAllOptions |
FeedbackGetAllOptions |
Parameters¶
| Parameter | Type | Description |
|---|---|---|
options? |
T |
Optional query parameters for filtering and pagination |
Returns¶
Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<FeedbackResponse> : NonPaginatedResponse<FeedbackResponse>>
Promise resolving to NonPaginatedResponse of FeedbackResponse without pagination options, or PaginatedResponse of FeedbackResponse when pagination options are used.
Example¶
import { Feedback, FeedbackStatus } from '@uipath/uipath-typescript/feedback';
// Get all feedback (returns API default page size)
const allFeedback = await feedback.getAll();
// Get the agentId from a feedback entry
const agentId = allFeedback.items[0].agentId;
// Get feedback for a specific agent
const agentFeedback = await feedback.getAll({
agentId,
});
// First page with pagination
const page1 = await feedback.getAll({ pageSize: 10 });
// Navigate using cursor
if (page1.hasNextPage) {
const page2 = await feedback.getAll({ cursor: page1.nextCursor });
}
// Filter by status
const activeFeedback = await feedback.getAll({
status: FeedbackStatus.Pending,
});
getById()¶
getById(
id:string,options:FeedbackOptions):Promise<FeedbackResponse>
Gets a single feedback entry by its feedback ID.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
id |
string |
Feedback ID (GUID) of the feedback entry |
options |
FeedbackOptions |
Required options including folderKey for folder-level authorization FeedbackOptions |
Returns¶
Promise<FeedbackResponse>
Promise resolving to FeedbackResponse
Example¶
import { Feedback } from '@uipath/uipath-typescript/feedback';
const feedback = new Feedback(sdk);
// First, get feedback entries to obtain the ID and folder key
const allFeedback = await feedback.getAll({ pageSize: 10 });
const feedbackId = allFeedback.items[0].id;
const folderKey = allFeedback.items[0].folderKey;
const item = await feedback.getById(feedbackId, { folderKey });
console.log(item.isPositive, item.comment, item.status);
getCategories()¶
getCategories<
T>(options?:T):Promise<TextendsHasPaginationOptions<T> ?PaginatedResponse<FeedbackCategoryResponse> :NonPaginatedResponse<FeedbackCategoryResponse>>
Gets all feedback categories for the tenant.
Returns both system default categories (Output, Agent Error, Agent Plan Execution) and any custom categories created for this tenant. When no pagination options are provided, the SDK returns up to 100 items. When pagination options are provided without a pageSize, the SDK defaults to 50 items per page.
Type Parameters¶
| Type Parameter | Default type |
|---|---|
T extends FeedbackGetCategoriesOptions |
FeedbackGetCategoriesOptions |
Parameters¶
| Parameter | Type | Description |
|---|---|---|
options? |
T |
Optional filters and pagination options FeedbackGetCategoriesOptions |
Returns¶
Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<FeedbackCategoryResponse> : NonPaginatedResponse<FeedbackCategoryResponse>>
Promise resolving to NonPaginatedResponse of FeedbackCategoryResponse without pagination options, or PaginatedResponse of FeedbackCategoryResponse when pagination options are used.
Example¶
import { Feedback } from '@uipath/uipath-typescript/feedback';
const feedback = new Feedback(sdk);
// Get all categories
const categories = await feedback.getCategories();
console.log(categories.items.map(c => c.category));
// Get only categories applicable to negative feedback
const negativeCategories = await feedback.getCategories({ isNegative: true });
// Paginated
const page1 = await feedback.getCategories({ pageSize: 10 });
submit()¶
submit(
traceId:string,isPositive:boolean,options:FeedbackSubmitOptions):Promise<FeedbackResponse>
Submits a feedback entry.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
traceId |
string |
Trace identifier linking feedback to a specific agent execution |
isPositive |
boolean |
Whether the feedback is positive (thumbs up) or negative (thumbs down) |
options |
FeedbackSubmitOptions |
Additional feedback data and folderKey for authorization FeedbackSubmitOptions |
Returns¶
Promise<FeedbackResponse>
Promise resolving to the submitted FeedbackResponse
Example¶
import { Feedback } from '@uipath/uipath-typescript/feedback';
const feedback = new Feedback(sdk);
// Obtain traceId and folderKey from an existing feedback entry
const allFeedback = await feedback.getAll({ pageSize: 1 });
const traceId = allFeedback.items[0].traceId;
const folderKey = allFeedback.items[0].folderKey!;
const item = await feedback.submit(traceId, true, { folderKey });
console.log(item.id, item.status);
updateById()¶
updateById(
id:string,isPositive:boolean,options:FeedbackUpdateOptions):Promise<FeedbackResponse>
Updates already submitted feedback.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
id |
string |
Feedback ID (GUID) of the entry to update |
isPositive |
boolean |
Whether the feedback is positive (thumbs up) or negative (thumbs down) |
options |
FeedbackUpdateOptions |
Updated feedback data and folderKey for authorization FeedbackUpdateOptions |
Returns¶
Promise<FeedbackResponse>
Promise resolving to the updated FeedbackResponse
Example¶
import { Feedback } from '@uipath/uipath-typescript/feedback';
const feedback = new Feedback(sdk);
const allFeedback = await feedback.getAll({ pageSize: 1 });
const feedbackId = allFeedback.items[0].id;
const folderKey = allFeedback.items[0].folderKey!;
const updated = await feedback.updateById(feedbackId, false, {
comment: 'On reflection, not great.',
folderKey,
});
console.log(updated.isPositive, updated.comment);