Launch Week 02 wrapped — explore all five launches

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.

POST/v2/annotation-forms
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
    }
  ]
}'
200
{
  "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_KEYstringRequired

    The API key of your Confident AI project.

Request body

  • namestringRequired

    The name of the form, shown wherever a queue offers it.

  • fieldslist of objects

    The 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
    • idstring

      The 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.

    • labelstringRequired

      The question shown to the annotator.

    • typeenumRequired

      The 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 by criteriaType.

      Show 7 enum valuesHide 7 enum values
      • TEXT
      • NUMBER
      • FLOAT
      • BOOLEAN
      • SELECT
      • MULTI_SELECT
      • ANNOTATION_CRITERIA
    • descriptionstring | null

      Guidance shown under the question. Send null to clear it.

    • requiredboolean

      Whether the annotator must answer this field before completing the item. Defaults to false.

    • orderinteger

      The position of the field in the form. Defaults to the order the fields arrive in.

    • selectOptionsarray | null

      The choices offered for a SELECT or MULTI_SELECT field. Required, and non-empty, for those two types; null for every other type.

    • criteriaNamestring | null

      The criterion an ANNOTATION_CRITERIA field rates, matching a custom annotation option in this project. Null for every other type.

    • criteriaTypeenum | null

      This is the type of annotation, which can be either thumbs rating or five star rating.

      Show 2 enum valuesHide 2 enum values
      • FIVE_STAR_RATING
      • THUMBS_RATING
    • collectExplanationboolean

      Whether an ANNOTATION_CRITERIA field also asks the annotator to explain the rating. Defaults to false.

    • collectExpectedOutputboolean

      Whether an ANNOTATION_CRITERIA field on a trace or span form also asks for the output that should have been produced. Defaults to false.

    • collectExpectedOutcomeboolean

      Whether 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.

  • successboolean

    Indicates if the request was successful.

  • dataobject

    A reference to an annotation form by its id.

    Show 1 propertyHide 1 property
    • idstring

      The id of the form, generated by Confident AI.

  • linkstring

    This is the URL of the resource on the Confident AI platform.

  • deprecatedboolean

    Indicates if this endpoint is deprecated.

Built byConfident AI