Create Annotation
(v2)POST
Records a rating against exactly one trace, span or thread, and returns its id. The target must already exist in your project. A rating on a THUMBS_RATING scale is 0 or 1; on a FIVE_STAR_RATING scale it is 1 to 5.
curl -X POST "https://api.confident-ai.com/v2/annotations" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"traceUuid": "3f9c2a1e-5b7d-4c8e-9f01-2a3b4c5d6e7f",
"expectedOutput": "Mount Everest is 8,848 metres tall.",
"fieldType": "TEXT",
"value": true,
"name": "Helpfulness",
"explanation": "Answered the question and cited the right source.",
"userId": "end-user-42",
"imagesMapping": {}
}'{
"success": true,
"data": {
"id": "<ANNOTATION-ID>"
},
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Request body
Trace Annotation RequestobjectAn annotation left on a trace.
Show 8 propertiesHide 8 properties
traceUuidstringRequiredThe uuid of the trace being annotated.
expectedOutputstringThe output the trace should have produced.
fieldTypeenumThe kind of value an annotation holds:
TEXT,NUMBER,FLOATorBOOLEANfor a free value,CHOICEorMULTIPLE_CHOICEfor a choice from the options in the field'sconfig, andTHUMBS_RATINGorFIVE_STAR_RATINGfor a rating.Show 8 enum valuesHide 8 enum values
TEXTNUMBERFLOATBOOLEANCHOICEMULTIPLE_CHOICEFIVE_STAR_RATINGTHUMBS_RATING
valuestring | number | boolean | list of stringsRequiredThe annotated value, in the shape its
fieldTypeexpects: a boolean forTHUMBS_RATING(trueis thumbs up) andBOOLEAN, a whole number from 1 to 5 forFIVE_STAR_RATING, a number forNUMBERorFLOAT, a string forTEXTandCHOICE, and a list of strings forMULTIPLE_CHOICE.Show 4 variantsHide 4 variants
string
- OR
number
- OR
boolean
- OR
list of strings
namestringA name for what this annotation is for. Omit it for the default annotation.
explanationstringWhy the annotation was given.
userIdstringThe id of the end user this annotation came from, when it was collected from your own users rather than your team.
imagesMappingobjectImages referenced by
[DEEPEVAL:IMAGE:<key>]markers in the text fields, keyed by that marker's key.
- OR
Span Annotation RequestobjectAn annotation left on a span.
Show 8 propertiesHide 8 properties
spanUuidstringRequiredThe uuid of the span being annotated.
expectedOutputstringThe output the span should have produced.
fieldTypeenumThe kind of value an annotation holds:
TEXT,NUMBER,FLOATorBOOLEANfor a free value,CHOICEorMULTIPLE_CHOICEfor a choice from the options in the field'sconfig, andTHUMBS_RATINGorFIVE_STAR_RATINGfor a rating.Show 8 enum valuesHide 8 enum values
TEXTNUMBERFLOATBOOLEANCHOICEMULTIPLE_CHOICEFIVE_STAR_RATINGTHUMBS_RATING
valuestring | number | boolean | list of stringsRequiredThe annotated value, in the shape its
fieldTypeexpects: a boolean forTHUMBS_RATING(trueis thumbs up) andBOOLEAN, a whole number from 1 to 5 forFIVE_STAR_RATING, a number forNUMBERorFLOAT, a string forTEXTandCHOICE, and a list of strings forMULTIPLE_CHOICE.Show 4 variantsHide 4 variants
string
- OR
number
- OR
boolean
- OR
list of strings
namestringA name for what this annotation is for. Omit it for the default annotation.
explanationstringWhy the annotation was given.
userIdstringThe id of the end user this annotation came from, when it was collected from your own users rather than your team.
imagesMappingobjectImages referenced by
[DEEPEVAL:IMAGE:<key>]markers in the text fields, keyed by that marker's key.
- OR
Thread Annotation RequestobjectAn annotation left on a thread.
Show 8 propertiesHide 8 properties
threadIdstringRequiredThe id of the thread being annotated.
expectedOutcomestringThe outcome the conversation should have reached.
fieldTypeenumThe kind of value an annotation holds:
TEXT,NUMBER,FLOATorBOOLEANfor a free value,CHOICEorMULTIPLE_CHOICEfor a choice from the options in the field'sconfig, andTHUMBS_RATINGorFIVE_STAR_RATINGfor a rating.Show 8 enum valuesHide 8 enum values
TEXTNUMBERFLOATBOOLEANCHOICEMULTIPLE_CHOICEFIVE_STAR_RATINGTHUMBS_RATING
valuestring | number | boolean | list of stringsRequiredThe annotated value, in the shape its
fieldTypeexpects: a boolean forTHUMBS_RATING(trueis thumbs up) andBOOLEAN, a whole number from 1 to 5 forFIVE_STAR_RATING, a number forNUMBERorFLOAT, a string forTEXTandCHOICE, and a list of strings forMULTIPLE_CHOICE.Show 4 variantsHide 4 variants
string
- OR
number
- OR
boolean
- OR
list of strings
namestringA name for what this annotation is for. Omit it for the default annotation.
explanationstringWhy the annotation was given.
userIdstringThe id of the end user this annotation came from, when it was collected from your own users rather than your team.
imagesMappingobjectImages referenced by
[DEEPEVAL:IMAGE:<key>]markers in the text fields, keyed by that marker's key.
Response
Create Annotation succeeded.
successbooleanIndicates if the request was successful.
dataobjectA reference to an annotation by its id.
Show 1 propertyHide 1 property
idstringThe id of the annotation, generated by Confident AI.
deprecatedbooleanIndicates if this endpoint is deprecated.