Annotations

Update an annotation

PATCH

Update attributes for an existing annotation.

You will need to supply the annotation’s unique ID. You can find the ID in the Label Studio UI listed at the top of the annotation in its tab. It is also listed in the History panel when viewing the annotation. Or you can use Get all task annotations to find all annotation IDs.

For information about the JSON format used in the result, see Label Studio JSON format of annotated tasks.

Path parameters

idintegerRequired
A unique integer value identifying this annotation.

Request

This endpoint expects an object.
result
list of maps from strings to anyOptional
task
integerOptional
Corresponding task for this annotation
project
integerOptional
Project ID for this annotation
completed_by
integerOptional
User ID of the person who created this annotation
updated_by
integerOptional
Last user who updated this annotation
was_cancelled
booleanOptional
User skipped the task
ground_truth
booleanOptional
This annotation is a Ground Truth
lead_time
doubleOptional
How much time it took to annotate the task (in seconds)

Response

This endpoint returns an object
id
integerOptional
result
list of maps from strings to anyOptional
List of annotation results for the task
created_username
stringOptional
Username string
created_ago
stringOptionalDefaults to
Time delta from creation time
completed_by
integerOptional
unique_id
stringOptional
was_cancelled
booleanOptional
User skipped the task
ground_truth
booleanOptional

This annotation is a Ground Truth (ground_truth)

created_at
datetimeOptional
Creation time
updated_at
datetimeOptional
Last updated time
draft_created_at
datetimeOptional
Draft creation time
lead_time
doubleOptional
How much time it took to annotate the task
import_id
integerOptional
Original annotation ID that was at the import step or NULL if this annotation wasn't imported
last_action
enumOptional
Action which was performed in the last annotation history item
task
integerOptional
Corresponding task for this annotation
project
integerOptional
Project ID for this annotation
updated_by
integerOptional
Last user who updated this annotation
parent_prediction
integerOptional
Points to the prediction from which this annotation was created
parent_annotation
integerOptional
Points to the parent annotation from which this annotation was created
last_created_by
integerOptional
User who created the last annotation history item
PATCH
1curl -X PATCH http://localhost:8080/api/annotations/1/ \
2 -H "Authorization: Token <api_key>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "result": [
6 {
7 "original_width": 1920,
8 "original_height": 1080,
9 "image_rotation": 0,
10 "from_name": "bboxes",
11 "to_name": "image",
12 "type": "rectanglelabels",
13 "value": {
14 "x": 20,
15 "y": 30,
16 "width": 50,
17 "height": 60,
18 "rotation": 0,
19 "values": {
20 "rectanglelabels": {
21 "0": "Person"
22 }
23 }
24 }
25 }
26 ],
27 "was_cancelled": false,
28 "ground_truth": true
29}'
200Updated
1{
2 "id": 1,
3 "result": [
4 {
5 "original_width": 1920,
6 "original_height": 1080,
7 "image_rotation": 0,
8 "from_name": "bboxes",
9 "to_name": "image",
10 "type": "rectanglelabels",
11 "value": {
12 "x": 20,
13 "y": 30,
14 "width": 50,
15 "height": 60,
16 "rotation": 0,
17 "values": {
18 "rectanglelabels": {
19 "0": "Person"
20 }
21 }
22 }
23 }
24 ],
25 "created_username": "created_username",
26 "created_ago": "created_ago",
27 "completed_by": 1,
28 "unique_id": "unique_id",
29 "was_cancelled": false,
30 "ground_truth": false,
31 "created_at": "2024-01-15T09:30:00Z",
32 "updated_at": "2024-01-15T09:30:00Z",
33 "draft_created_at": "2024-01-15T09:30:00Z",
34 "lead_time": 10,
35 "import_id": 1,
36 "last_action": "prediction",
37 "task": 1,
38 "project": 1,
39 "updated_by": 1,
40 "parent_prediction": 1,
41 "parent_annotation": 1,
42 "last_created_by": 1
43}