Tasks

Get task list

GET

Retrieve a list of tasks.

You can use the query parameters to filter the list by project and/or view (a tab within the Data Manager). You can also optionally add pagination to make the response easier to parse.

The project ID can be found in the URL when viewing the project in Label Studio, or you can retrieve all project IDs using List all projects. The view ID can be found using List views.

Query parameters

pageintegerOptional
A page number within the paginated result set.
page_sizeintegerOptional
Number of results to return per page.
viewintegerOptional
View ID
projectintegerOptional
Project ID
resolve_uribooleanOptional
Resolve task data URIs using Cloud Storage
fieldsenumOptional
Set to "all" if you want to include annotations and predictions in the response
Allowed values: alltask_only
reviewbooleanOptional
Get tasks for review
includestringOptional
Specify which fields to include in the response
querystringOptional

Additional query to filter tasks. It must be JSON encoded string of dict containing one of the following parameters: {"filters": ..., "selectedItems": ..., "ordering": ...}. Check Data Manager > Create View for more details about filters, selectedItems and ordering.

  • filters: dict with "conjunction" string ("or" or "and") and list of filters in "items" array. Each filter is a dictionary with keys: "filter", "operator", "type", "value". Read more about available filters
    Example: {"conjunction": "or", "items": [{"filter": "filter:tasks:completed_at", "operator": "greater", "type": "Datetime", "value": "2021-01-01T00:00:00.000Z"}]}
  • selectedItems: dictionary with keys: "all", "included", "excluded". If “all” is false, "included" must be used. If “all” is true, "excluded" must be used.
    Examples: {"all": false, "included": [1, 2, 3]} or {"all": true, "excluded": [4, 5]}
  • ordering: list of fields to order by. Currently, ordering is supported by only one parameter.
    Example: ["completed_at"]

Response

This endpoint returns an object
tasks
list of objectsOptional

List of tasks, each task contains predictions and annotations if fields query parameter is set to all

total
integerOptional
Total number of tasks
total_annotations
integerOptional
Total number of annotations
total_predictions
integerOptional
Total number of predictions
GET
1curl http://localhost:8080/api/tasks/ \
2 -H "Authorization: Token <api_key>"
200Retrieved
1{
2 "tasks": [
3 {
4 "id": 1,
5 "predictions": [
6 {
7 "result": {
8 "0": {
9 "from_name": "sentiment",
10 "to_name": "text",
11 "type": "choices",
12 "value": {
13 "value": {
14 "choices": {
15 "0": "POSITIVE"
16 }
17 }
18 }
19 }
20 },
21 "score": 0.9,
22 "model_version": "1.0",
23 "task": 1,
24 "created_at": "2021-01-01T00:00:00Z",
25 "updated_at": "2021-01-01T00:00:00Z"
26 }
27 ],
28 "annotations": [
29 {
30 "result": {
31 "0": {
32 "from_name": "sentiment",
33 "to_name": "text",
34 "type": "choices",
35 "value": {
36 "value": {
37 "choices": {
38 "0": "POSITIVE"
39 }
40 }
41 }
42 }
43 },
44 "created_at": "2021-01-01T00:00:00Z",
45 "updated_at": "2021-01-01T00:00:00Z",
46 "completed_by": 1,
47 "updated_by": 1,
48 "was_cancelled": false,
49 "ground_truth": false,
50 "lead_time": 12.34
51 }
52 ],
53 "drafts": [
54 {}
55 ],
56 "annotators": [
57 1
58 ],
59 "inner_id": 1,
60 "cancelled_annotations": 1,
61 "total_annotations": 1,
62 "total_predictions": 1,
63 "completed_at": "2024-01-15T09:30:00Z",
64 "file_upload": "file_upload",
65 "storage_filename": "storage_filename",
66 "avg_lead_time": 1.1,
67 "draft_exists": true,
68 "updated_by": [
69 {}
70 ],
71 "created_at": "2024-01-15T09:30:00Z",
72 "updated_at": "2024-01-15T09:30:00Z",
73 "is_labeled": true,
74 "overlap": 1.1,
75 "comment_count": 1,
76 "unresolved_comment_count": 1,
77 "last_comment_updated_at": "2024-01-15T09:30:00Z",
78 "project": 1,
79 "comment_authors": [
80 1
81 ]
82 }
83 ],
84 "total": 1,
85 "total_annotations": 1,
86 "total_predictions": 1
87}