Create annotation

POST

Add annotations to a task like an annotator does.

You will need to supply the task ID. You can find this in Label Studio by opening a task and checking the URL. It is also listed at the top of the labeling interface. Or you can use Get tasks list.

The content of the result field depends on your labeling configuration. For example, send the following data as part of your POST request to send an empty annotation with the ID of the user who completed the task:

1{
2"result": {},
3"was_cancelled": true,
4"ground_truth": true,
5"lead_time": 0,
6"task": 0
7"completed_by": 123
8}

Path parameters

idintegerRequired
Task ID

Request

This endpoint expects an object.
resultlist of maps from strings to anyOptional

Labeling result in JSON format. Read more about the format in the Label Studio documentation.

taskintegerOptional
Corresponding task for this annotation
projectintegerOptional
Project ID for this annotation
completed_byintegerOptional
User ID of the person who created this annotation
updated_byintegerOptional
Last user who updated this annotation
was_cancelledbooleanOptional
User skipped the task
ground_truthbooleanOptional
This annotation is a Ground Truth
lead_timedoubleOptional
How much time it took to annotate the task (in seconds)

Response

This endpoint returns an object.
idintegerOptional
resultlist of maps from strings to anyOptional
List of annotation results for the task
created_usernamestringOptional
Username string
created_agostringOptionalDefaults to
Time delta from creation time
completed_byintegerOptional
unique_idstringOptional
was_cancelledbooleanOptional
User skipped the task
ground_truthbooleanOptional

This annotation is a Ground Truth (ground_truth)

created_atdatetimeOptional
Creation time
updated_atdatetimeOptional
Last updated time
draft_created_atdatetimeOptional
Draft creation time
lead_timedoubleOptional
How much time it took to annotate the task
import_idintegerOptional
Original annotation ID that was at the import step or NULL if this annotation wasn't imported
last_actionenumOptional
Action which was performed in the last annotation history item
taskintegerOptional
Corresponding task for this annotation
projectintegerOptional
Project ID for this annotation
updated_byintegerOptional
Last user who updated this annotation
parent_predictionintegerOptional
Points to the prediction from which this annotation was created
parent_annotationintegerOptional
Points to the parent annotation from which this annotation was created
last_created_byintegerOptional
User who created the last annotation history item