Annotate Queue Item
POSThttps://api.confident-ai.com/v1/annotation-queues/{itemId}/annotate
Annotates a single queue item, associating the work with the item's trace, span, or thread automatically. Supports both plain queues and queues with an attached form.
Submit criteria ratings (the flat rating fields or the annotations array) and, for form queues, custom-field answers (formResponses). At least one must be present.
Validation rules:
- For thread items: Use
expectedOutcome(notexpectedOutput). - For trace/span items: Use
expectedOutput(notexpectedOutcome). - A criterion's
namemust match an available criterion — omit it for the default criterion, otherwise it must match a configured custom criterion or a form criteria field. A mismatched name is rejected. - Form
formResponsesare addressed by each field's visible label, accepted only for queues with an attached form. - Set
markAsCompleted: falseto leave the item open (default: true). For form queues, completing enforces the form's required fields.
curl -X POST "https://api.confident-ai.com/v1/annotation-queues/{itemId}/annotate" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"rating": 1,
"type": "THUMBS_RATING",
"explanation": "Response is accurate and helpful",
"markAsCompleted": true
}'{
"success": true,
"data": {
"id": "annotation-uuid",
"annotationIds": [
"annotation-uuid"
],
"formResponseIds": [
"form-response-uuid-1",
"form-response-uuid-2"
]
}
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Path parameters
itemIdstringRequiredThe ID of the queue item to annotate.
Request body
ratingintegerRating value for a single criterion (0-1 for THUMBS_RATING, 1-5 for FIVE_STAR_RATING). Shorthand for a one-entry
annotationsarray.typeenumType of the rating.
Show 2 enum valuesHide 2 enum values
THUMBS_RATINGFIVE_STAR_RATING
namestringCriterion name. Omit for the default criterion; otherwise it must match a configured custom criterion (or a form criteria field), or the annotation will not appear.
expectedOutcomestringExpected outcome (for thread items only).
expectedOutputstringExpected output (for trace/span items only).
explanationstringExplanation for the rating.
annotationslist of objectsOne entry per criterion. Use instead of the flat fields to rate multiple criteria in a single request.
Show 6 propertiesHide 6 properties
ratingintegerRequiredRating value (0-1 for THUMBS_RATING, 1-5 for FIVE_STAR_RATING).
typeenumType of the rating.
Show 2 enum valuesHide 2 enum values
THUMBS_RATINGFIVE_STAR_RATING
namestringCriterion name. Omit for the default criterion; otherwise it must match a configured custom criterion or a form criteria field.
explanationstringExplanation for the rating.
expectedOutputstringExpected output (for trace/span items only).
expectedOutcomestringExpected outcome (for thread items only).
formResponseslist of objectsAnswers to a form's custom fields, addressed by each field's visible label. Accepted only for queues with an attached form, and requires
annotatorEmail.Show 2 propertiesHide 2 properties
labelstringRequiredThe visible label of the custom field being answered. Must be unique within the form and must not be a criteria field's label.
valuestring | number | boolean | list of stringsThe answer, shaped to the field type. Null clears the answer.
Show 4 variantsHide 4 variants
string
Text or single-select fields.
- OR
number
Number or decimal fields.
- OR
boolean
Yes/No fields (also accepts the strings "Yes"/"No").
- OR
list of strings
Multi-select fields.
annotatorEmailstringProject member to attribute the work to. Required when submitting
formResponses, otherwise they will not appear in the platform.markAsCompletedbooleanWhether to mark the queue item as completed. For form queues, completing enforces the form's required fields.
Response
Successfully annotated the queue item
successbooleanIndicates if the queue item was successfully annotated.
dataobjectContains the created annotation and form-response identifiers.
Show 3 propertiesHide 3 properties
idstringThe first created annotation's id, kept for backward compatibility. Null when only form responses were submitted.
annotationIdslist of stringsIdentifiers of the created annotations.
formResponseIdslist of stringsIdentifiers of the created form responses.