Create Form
POSThttps://api.confident-ai.com/v2/annotation-forms
Creates an annotation form in your Confident AI project and returns its id. Attach the form to an annotation queue to have its questions asked of every item in that queue.
curl -X POST "https://api.confident-ai.com/v2/annotation-forms" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "Answer quality review",
"fields": [
{
"id": "<ANNOTATION-FORM-FIELD-ID>",
"label": "How helpful was the answer?",
"type": "TEXT",
"description": "Judge only the answer, not the retrieved context.",
"required": true,
"order": 0,
"selectOptions": [
"Not helpful",
"Somewhat helpful",
"Very helpful"
],
"criteriaName": "Helpfulness",
"criteriaType": "FIVE_STAR_RATING",
"collectExplanation": true,
"collectExpectedOutput": false,
"collectExpectedOutcome": false
}
]
}'{
"success": true,
"data": {
"id": "<ANNOTATION-FORM-ID>"
},
"link": "https://app.confident-ai.com/project/<PROJECT-ID>/project-settings/annotation/<ANNOTATION-FORM-ID>",
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Request body
namestringRequiredThe name of the form, shown wherever a queue offers it.
fieldslist of objectsThe questions to put on the form, in the order annotators see them. A form created without fields collects nothing until you add some.
Show 12 propertiesHide 12 properties
idstringThe id of an existing field to keep, which preserves the answers already recorded against it. Omit it for a new field and Confident AI assigns one.
labelstringRequiredThe question shown to the annotator.
typeenumRequiredThe kind of answer a form field collects: TEXT, NUMBER, FLOAT or BOOLEAN for a free answer, SELECT or MULTI_SELECT for a choice from
selectOptions, and ANNOTATION_CRITERIA for a rating on the scale named bycriteriaType.Show 7 enum valuesHide 7 enum values
TEXTNUMBERFLOATBOOLEANSELECTMULTI_SELECTANNOTATION_CRITERIA
descriptionstring | nullGuidance shown under the question. Send null to clear it.
requiredbooleanWhether the annotator must answer this field before completing the item. Defaults to false.
orderintegerThe position of the field in the form. Defaults to the order the fields arrive in.
selectOptionsarray | nullThe choices offered for a SELECT or MULTI_SELECT field. Required, and non-empty, for those two types; null for every other type.
criteriaNamestring | nullThe criterion an ANNOTATION_CRITERIA field rates, matching a custom annotation option in this project. Null for every other type.
criteriaTypeenum | nullThis is the type of annotation, which can be either thumbs rating or five star rating.
Show 2 enum valuesHide 2 enum values
FIVE_STAR_RATINGTHUMBS_RATING
collectExplanationbooleanWhether an ANNOTATION_CRITERIA field also asks the annotator to explain the rating. Defaults to false.
collectExpectedOutputbooleanWhether an ANNOTATION_CRITERIA field on a trace or span form also asks for the output that should have been produced. Defaults to false.
collectExpectedOutcomebooleanWhether an ANNOTATION_CRITERIA field on a thread form also asks for the outcome the conversation should have reached. Defaults to false.
Response
Create Form succeeded.
successbooleanIndicates if the request was successful.
dataobjectA reference to an annotation form by its id.
Show 1 propertyHide 1 property
idstringThe id of the form, generated by Confident AI.
linkstringThis is the URL of the resource on the Confident AI platform.
deprecatedbooleanIndicates if this endpoint is deprecated.