Annotate Single Item

Creates an annotation for a single queue item. This endpoint automatically associates the annotation with the correct trace, span, or thread based on the queue item. **Validation rules:** - For thread items: Use `expectedOutcome` (not `expectedOutput`) - For trace/span items: Use `expectedOutput` (not `expectedOutcome`) - Set `markAsCompleted: true` to automatically mark the queue item as completed after annotation (default: true)

Path parameters

itemIdstringRequired
The ID of the queue item to annotate.

Headers

CONFIDENT_API_KEYstringRequired
The API key of your Confident AI project.

Request

This endpoint expects an object.
ratingintegerRequired

Rating value (0-1 for THUMBS_RATING, 1-5 for FIVE_STAR_RATING)

typeenumOptionalDefaults to THUMBS_RATING
Type of rating
Allowed values:
namestringOptionalDefaults to Default
Name of the annotation
expectedOutcomestringOptional

Expected outcome (for threads only)

expectedOutputstringOptional

Expected output (for traces/spans only)

explanationstringOptional
Explanation for the rating
flaggedbooleanOptionalDefaults to false
Whether the item is flagged
markAsCompletedbooleanOptionalDefaults to true
Whether to mark the queue item as completed

Response

Successfully created annotation for queue item
successboolean or null
dataobject or null