Use this API endpoint to import labeling tasks in bulk. Note that each POST request is limited at 250K tasks and 200 MB. 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.
Imported data is verified against a project label_config and must include all variables that were used in the label_config.
For example, if the label configuration has a $text variable, then each item in a data object must include a text
field.
There are three possible ways to import tasks with this endpoint:
Send JSON tasks as POST data. Only JSON is supported for POSTing files directly.
Update this example to specify your authorization token and Label Studio instance host, then run the following from the command line:
Send tasks as files. You can attach multiple files with different names.
Update this example to specify your authorization token, Label Studio instance host, and file name and path, then run the following from the command line:
You can also provide a URL to a file with labeling tasks. Supported file formats are the same as in option 2.
List of fields to preannotate from the task data. For example, if you provide a list of {"text": "text", "prediction": "label"}
items in the request, the system will create a task with the text
field and a prediction with the label
field when preannoted_from_fields=["prediction"]
.