Skip to content

Files

Latest commit

4b2f1d9 · Mar 5, 2025

History

History
19887 lines (13386 loc) · 273 KB

reference.md

File metadata and controls

19887 lines (13386 loc) · 273 KB

Reference

Annotations

client.annotations.get(...)

📝 Description

Tasks can have multiple annotations. Use this call to retrieve a specific annotation using its 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.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.annotations.get(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this annotation.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.annotations.delete(...)

📝 Description

Delete an annotation.

This action can't be undone!

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.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.annotations.delete(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this annotation.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.annotations.update(...)

📝 Description

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.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.annotations.update(
    id=1,
    result=[
        {
            "original_width": 1920,
            "original_height": 1080,
            "image_rotation": 0,
            "from_name": "bboxes",
            "to_name": "image",
            "type": "rectanglelabels",
            "value": {
                "x": 20,
                "y": 30,
                "width": 50,
                "height": 60,
                "rotation": 0,
                "values": {"rectanglelabels": ["Person"]},
            },
        }
    ],
    was_cancelled=False,
    ground_truth=True,
)

⚙️ Parameters

id: int — A unique integer value identifying this annotation.

result: typing.Optional[typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]]] — Labeling result in JSON format. Read more about the format in the Label Studio documentation.

task: typing.Optional[int] — Corresponding task for this annotation

project: typing.Optional[int] — Project ID for this annotation

completed_by: typing.Optional[int] — User ID of the person who created this annotation

updated_by: typing.Optional[int] — Last user who updated this annotation

was_cancelled: typing.Optional[bool] — User skipped the task

ground_truth: typing.Optional[bool] — This annotation is a Ground Truth

lead_time: typing.Optional[float] — How much time it took to annotate the task (in seconds)

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.annotations.list(...)

📝 Description

List all annotations for a task.

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.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.annotations.list(
    id=1,
)

⚙️ Parameters

id: int — Task ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.annotations.create(...)

📝 Description

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:

{
"result": {},
"was_cancelled": true,
"ground_truth": true,
"lead_time": 0,
"task": 0
"completed_by": 123
} 

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.annotations.create(
    id=1,
    result=[
        {
            "original_width": 1920,
            "original_height": 1080,
            "image_rotation": 0,
            "from_name": "bboxes",
            "to_name": "image",
            "type": "rectanglelabels",
            "value": {
                "x": 20,
                "y": 30,
                "width": 50,
                "height": 60,
                "rotation": 0,
                "values": {"rectanglelabels": ["Person"]},
            },
        }
    ],
    was_cancelled=False,
    ground_truth=True,
)

⚙️ Parameters

id: int — Task ID

result: typing.Optional[typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]]] — Labeling result in JSON format. Read more about the format in the Label Studio documentation.

task: typing.Optional[int] — Corresponding task for this annotation

project: typing.Optional[int] — Project ID for this annotation

completed_by: typing.Optional[int] — User ID of the person who created this annotation

updated_by: typing.Optional[int] — Last user who updated this annotation

was_cancelled: typing.Optional[bool] — User skipped the task

ground_truth: typing.Optional[bool] — This annotation is a Ground Truth

lead_time: typing.Optional[float] — How much time it took to annotate the task (in seconds)

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.annotations.create_bulk(...)

📝 Description

Create multiple annotations for specific tasks in a bulk operation.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.annotations.create_bulk()

⚙️ Parameters

tasks: typing.Optional[typing.Sequence[int]]

selected_items: typing.Optional[AnnotationsCreateBulkRequestSelectedItems]

lead_time: typing.Optional[float]

project: typing.Optional[int]

result: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Users

client.users.reset_token()

📝 Description

Reset your access token or API key. When reset, any scripts or automations you have in place will need to be updated with the new key.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.users.reset_token()

⚙️ Parameters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.users.get_token()

📝 Description

Get a access token to authenticate to the API as the current user. To find this in the Label Studio interface, click Account & Settings in the upper right. For more information, see Access Token.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.users.get_token()

⚙️ Parameters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.users.whoami()

📝 Description

Get information about your user account, such as your username, email, and user ID.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.users.whoami()

⚙️ Parameters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.users.list()

📝 Description

List all users in your Label Studio organization.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.users.list()

⚙️ Parameters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.users.create(...)

📝 Description

Create a user in Label Studio.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.users.create()

⚙️ Parameters

id: typing.Optional[int] — User ID

first_name: typing.Optional[str] — First name of the user

last_name: typing.Optional[str] — Last name of the user

username: typing.Optional[str] — Username of the user

email: typing.Optional[str] — Email of the user

avatar: typing.Optional[str] — Avatar URL of the user

initials: typing.Optional[str] — Initials of the user

phone: typing.Optional[str] — Phone number of the user

allow_newsletters: typing.Optional[bool] — Whether the user allows newsletters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.users.get(...)

📝 Description

Get info about a specific Label Studio user. You will need to provide their user ID. You can find a list of all user IDs using List users.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.users.get(
    id=1,
)

⚙️ Parameters

id: int — User ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.users.delete(...)

📝 Description

Delete a specific Label Studio user.

You will need to provide their user ID. You can find a list of all user IDs using List users.

Use caution when deleting a user, as this can cause issues such as breaking the "Annotated by" filter or leaving orphaned records.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.users.delete(
    id=1,
)

⚙️ Parameters

id: int — User ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.users.update(...)

📝 Description

Update details for a specific Label Studio user, such as their name or contact information.

You will need to provide their user ID. You can find a list of all user IDs using List users.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.users.update(
    id=1,
)

⚙️ Parameters

id: int — User ID

users_update_request_id: typing.Optional[int] — User ID

first_name: typing.Optional[str] — First name of the user

last_name: typing.Optional[str] — Last name of the user

username: typing.Optional[str] — Username of the user

email: typing.Optional[str] — Email of the user

avatar: typing.Optional[str] — Avatar URL of the user

initials: typing.Optional[str] — Initials of the user

phone: typing.Optional[str] — Phone number of the user

allow_newsletters: typing.Optional[bool] — Whether the user allows newsletters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Actions

client.actions.list()

📝 Description

Retrieve all the registered actions with descriptions that data manager can use.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.actions.list()

⚙️ Parameters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.actions.create(...)

📝 Description

Perform a Data Manager action with the selected tasks and filters. Note: More complex actions require additional parameters in the request body. Call GET api/actions?project=<id> to explore them.
Example: GET api/actions?id=delete_tasks&project=1

🔌 Usage

from label_studio_sdk import LabelStudio
from label_studio_sdk.actions import (
    ActionsCreateRequestFilters,
    ActionsCreateRequestFiltersItemsItem,
    ActionsCreateRequestSelectedItemsExcluded,
)

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.actions.create(
    id="retrieve_tasks_predictions",
    project=1,
    filters=ActionsCreateRequestFilters(
        conjunction="or",
        items=[
            ActionsCreateRequestFiltersItemsItem(
                filter="filter:tasks:id",
                operator="greater",
                type="Number",
                value=123,
            )
        ],
    ),
    selected_items=ActionsCreateRequestSelectedItemsExcluded(
        all_=True,
        excluded=[124, 125, 126],
    ),
    ordering=["tasks:total_annotations"],
)

⚙️ Parameters

id: ActionsCreateRequestId — Action name ID, see the full list of actions in the GET api/actions request

project: int — Project ID

view: typing.Optional[int] — View ID (optional, it has higher priority than filters, selectedItems and ordering from the request body payload)

filters: typing.Optional[ActionsCreateRequestFilters] — Filters to apply on tasks. You can use the helper class Filters from this page to create Data Manager Filters.
Example: {"conjunction": "or", "items": [{"filter": "filter:tasks:completed_at", "operator": "greater", "type": "Datetime", "value": "2021-01-01T00:00:00.000Z"}]}

selected_items: typing.Optional[ActionsCreateRequestSelectedItems] — Task selection by IDs. If filters are applied, the selection will be applied to the filtered tasks.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: typing.Optional[typing.Sequence[ActionsCreateRequestOrderingItem]] — List of fields to order by. Fields are similar to filters but without the filter: prefix. To reverse the order, add a minus sign before the field name, e.g. -tasks:created_at.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Views

client.views.list(...)

📝 Description

List all views for a specific project. A view is a tab in the Data Manager where you can set filters and customize which tasks and information appears.

You will need to provide the project ID. You can find this in the URL when viewing the project in Label Studio, or you can use List all projects.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.views.list()

⚙️ Parameters

project: typing.Optional[int] — Project ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.views.create(...)

📝 Description

Create a new Data Manager view for a specific project. A view is a tab in the Data Manager where you can set filters and customize what tasks and information appears.

You will need to provide the project ID. You can find this in the URL when viewing the project in Label Studio, or you can use List all projects.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.views.create()

⚙️ Parameters

data: typing.Optional[ViewsCreateRequestData] — Custom view data

project: typing.Optional[int] — Project ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.views.delete_all(...)

📝 Description

Delete all views for a specific project. A view is a tab in the Data Manager where you can set filters and customize what tasks appear.

You will need to provide the project ID. You can find this in the URL when viewing the project in Label Studio, or you can use List all projects.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.views.delete_all(
    project=1,
)

⚙️ Parameters

project: int

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.views.get(...)

📝 Description

Get the details about a specific Data Manager view (tab). You will need to supply the view ID. You can find this using List views.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.views.get(
    id="id",
)

⚙️ Parameters

id: str — View ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.views.delete(...)

📝 Description

Delete a specific Data Manager view (tab) by ID. You can find the view using List views.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.views.delete(
    id="id",
)

⚙️ Parameters

id: str — View ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.views.update(...)

📝 Description

You can update a specific Data Manager view (tab) with additional filters and other customizations. You will need to supply the view ID. You can find this using List views.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.views.update(
    id="id",
)

⚙️ Parameters

id: str — View ID

data: typing.Optional[ViewsUpdateRequestData] — Custom view data

project: typing.Optional[int] — Project ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Files

client.files.get(...)

📝 Description

Retrieve details about a specific uploaded file. To get the file upload ID, use Get files list.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.files.get(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this file upload.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.files.delete(...)

📝 Description

Delete a specific uploaded file. To get the file upload ID, use Get files list.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.files.delete(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this file upload.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.files.update(...)

📝 Description

Update a specific uploaded file. To get the file upload ID, use Get files list.

You will need to include the file data in the request body. For example:

curl -H 'Authorization: Token abc123' \ -X POST 'https://localhost:8080/api/import/file-upload/245' -F ‘file=@path/to/my_file.csv’

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.files.update(
    id_=1,
)

⚙️ Parameters

id_: int — A unique integer value identifying this file upload.

id: typing.Optional[int]

file: typing.Optional[str]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.files.list(...)

📝 Description

Retrieve the list of uploaded files used to create labeling tasks for a specific project. These are files that have been uploaded directly to Label Studio.

You must provide a project ID. 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.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.files.list(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this file upload.

all_: typing.Optional[bool] — Set to "true" if you want to retrieve all file uploads

ids: typing.Optional[typing.Union[int, typing.Sequence[int]]] — Specify the list of file upload IDs to retrieve, e.g. ids=[1,2,3]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.files.delete_many(...)

📝 Description

Delete uploaded files for a specific project. These are files that have been uploaded directly to Label Studio.

You must provide a project ID. 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.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.files.delete_many(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this file upload.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.files.download(...)

📝 Description

Download a specific uploaded file. If you aren't sure of the file name, try Get files list first.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.files.download(
    filename="filename",
)

⚙️ Parameters

filename: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Ml

client.ml.list(...)

📝 Description

List all configured Machine Learning (ML) backends for a specific project by ID. For more information about ML backends, see Machine learning integration.

You will need to provide the project ID. This can be found in the URL when viewing the project in Label Studio, or you can retrieve all project IDs using List all projects.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.ml.list()

⚙️ Parameters

project: typing.Optional[int] — Project ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.ml.create(...)

📝 Description

Add an ML backend to a project. For more information about what you need to configure when adding an ML backend, see Connect the model to Label studio.

If you are using Docker Compose, you may need to adjust your ML backend URL. See localhost and Docker containers.

If you are using files that are located in the cloud, local storage, or uploaded to Label Studio, you must configure your environment variables to allow the ML backend to interact with those files. See Allow the ML backend to access Label Studio.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.ml.create()

⚙️ Parameters

url: typing.Optional[str] — ML backend URL

project: typing.Optional[int] — Project ID

is_interactive: typing.Optional[bool] — Is interactive

title: typing.Optional[str] — Title

description: typing.Optional[str] — Description

auth_method: typing.Optional[MlCreateRequestAuthMethod] — Auth method

basic_auth_user: typing.Optional[str] — Basic auth user

basic_auth_pass: typing.Optional[str] — Basic auth password

extra_params: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] — Extra parameters

timeout: typing.Optional[int] — Response model timeout

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.ml.get(...)

📝 Description

Get details about a specific ML backend. You will need to specify an ID for the backend connection. You can find this using List ML backends.

For more information, see Machine learning integration.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.ml.get(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this ml backend.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.ml.delete(...)

📝 Description

Remove an existing ML backend connection. You will need to specify an ID for the backend connection. You can find this using List ML backends.

For more information, see Machine learning integration.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.ml.delete(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this ml backend.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.ml.update(...)

📝 Description

Update the ML backend parameters. You will need to specify an ID for the backend connection. You can find this using List ML backends.

For more information, see Machine learning integration.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.ml.update(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this ml backend.

url: typing.Optional[str] — ML backend URL

project: typing.Optional[int] — Project ID

is_interactive: typing.Optional[bool] — Is interactive

title: typing.Optional[str] — Title

description: typing.Optional[str] — Description

auth_method: typing.Optional[MlUpdateRequestAuthMethod] — Auth method

basic_auth_user: typing.Optional[str] — Basic auth user

basic_auth_pass: typing.Optional[str] — Basic auth password

extra_params: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] — Extra parameters

timeout: typing.Optional[int] — Response model timeout

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.ml.predict_interactive(...)

📝 Description

Enable interactive pre-annotations for a specific task.

ML-assisted labeling with interactive pre-annotations works with image segmentation and object detection tasks using rectangles, ellipses, polygons, brush masks, and keypoints, as well as with HTML and text named entity recognition tasks. Your ML backend must support the type of labeling that you’re performing, recognize the input that you create, and be able to respond with the relevant output for a prediction. For more information, see Interactive pre-annotations.

Before you can use interactive annotations, it must be enabled for you ML backend connection ("is_interactive": true).

You will need the task ID and the ML backend connection ID. The task ID is available from the Label Studio URL when viewing the task, or you can retrieve it programmatically with Get task list. The ML backend connection ID is available via List ML backends.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.ml.predict_interactive(
    id=1,
    task=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this ML backend.

task: int — ID of task to annotate

context: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] — Context for ML model

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.ml.train(...)

📝 Description

After you connect a model to Label Studio as a machine learning backend and annotate at least one task, you can start training the model. Training logs appear in stdout and the console.

For more information, see Model training.

You will need to specify an ID for the backend connection. You can find this using List ML backends.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.ml.train(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this ML backend.

use_ground_truth: typing.Optional[bool] — Whether to include ground truth annotations in training

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.ml.list_model_versions(...)

📝 Description

Get available versions of the model. You will need to specify an ID for the backend connection. You can find this using List ML backends.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.ml.list_model_versions(
    id="id",
)

⚙️ Parameters

id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Predictions

client.predictions.list(...)

📝 Description

Get a list of all predictions. You can optionally filter these by task or by project. If you want to filter, you will need the project ID and/or task ID. Both of these can be found in the Label Studio URL when viewing a task, or you can use List all projects and Get tasks list.

The terms "predictions" and pre-annotations" are used interchangeably.

Predictions can be imported directly into Label Studio or generated by a connected ML backend.

To import predictions via the API, see Create prediction.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.predictions.list()

⚙️ Parameters

task: typing.Optional[int] — Filter predictions by task ID

project: typing.Optional[int] — Filter predictions by project ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.predictions.create(...)

📝 Description

If you have predictions generated for your dataset from a model, either as pre-annotated tasks or pre-labeled tasks, you can import the predictions with your dataset into Label Studio for review and correction.

To import predicted labels into Label Studio, you must use the Basic Label Studio JSON format and set up your tasks with the predictions JSON key. The Label Studio ML backend also outputs tasks in this format.

JSON format for predictions

Label Studio JSON format for pre-annotations must contain two sections:

  • A data object which references the source of the data that the pre-annotations apply to. This can be a URL to an audio file, a pre-signed cloud storage link to an image, plain text, a reference to a CSV file stored in Label Studio, or something else.
  • A predictions array that contains the pre-annotation results for the different types of labeling. See how to add results to the predictions array.

For more information, see the JSON format reference in the Label Studio documentation

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.predictions.create(
    result=[
        {
            "original_width": 1920,
            "original_height": 1080,
            "image_rotation": 0,
            "from_name": "bboxes",
            "to_name": "image",
            "type": "rectanglelabels",
            "value": {
                "x": 20,
                "y": 30,
                "width": 50,
                "height": 60,
                "rotation": 0,
                "values": {"rectanglelabels": ["Person"]},
            },
        }
    ],
    score=0.95,
    model_version="yolo-v8",
)

⚙️ Parameters

task: typing.Optional[int] — Task ID for which the prediction is created

result: typing.Optional[typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]]] — Prediction result in JSON format. Read more about the format in the Label Studio documentation.

score: typing.Optional[float] — Prediction score. Can be used in Data Manager to sort task by model confidence. Task with the lowest score will be shown first.

model_version: typing.Optional[str] — Model version - tag for predictions that can be used to filter tasks in Data Manager, as well as select specific model version for showing preannotations in the labeling interface

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.predictions.get(...)

📝 Description

Get details about a specific prediction by its ID. To find the prediction ID, use List predictions.

For information about the prediction format, see the JSON format reference in the Label Studio documentation.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.predictions.get(
    id=1,
)

⚙️ Parameters

id: int — Prediction ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.predictions.delete(...)

📝 Description

Delete a prediction. To find the prediction ID, use List predictions.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.predictions.delete(
    id=1,
)

⚙️ Parameters

id: int — Prediction ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.predictions.update(...)

📝 Description

Update a prediction. To find the prediction ID, use List predictions.

For information about the prediction format, see the JSON format reference in the Label Studio documentation.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.predictions.update(
    id=1,
    result=[
        {
            "original_width": 1920,
            "original_height": 1080,
            "image_rotation": 0,
            "from_name": "bboxes",
            "to_name": "image",
            "type": "rectanglelabels",
            "value": {
                "x": 20,
                "y": 30,
                "width": 50,
                "height": 60,
                "rotation": 0,
                "values": {"rectanglelabels": ["Person"]},
            },
        }
    ],
    score=0.95,
    model_version="yolo-v8",
)

⚙️ Parameters

id: int — Prediction ID

task: typing.Optional[int] — Task ID for which the prediction is created

result: typing.Optional[typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]]] — Prediction result in JSON format. Read more about the format in the Label Studio documentation.

score: typing.Optional[float] — Prediction score. Can be used in Data Manager to sort task by model confidence. Task with the lowest score will be shown first.

model_version: typing.Optional[str] — Model version - tag for predictions that can be used to filter tasks in Data Manager, as well as select specific model version for showing preannotations in the labeling interface

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Projects

client.projects.list(...)

📝 Description

Return a list of the projects within your organization.

To perform most tasks with the Label Studio API, you must specify the project ID, sometimes referred to as the pk. The project ID can be found in the URL when viewing the project in Label Studio, or you can retrieve all project IDs using this API call.

To retrieve a list of your Label Studio projects, update the following command to match your own environment. Replace the domain name, port, and authorization token, then run the following from the command line:

curl -X GET https://localhost:8080/api/projects/ -H 'Authorization: Token abc123'

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
response = client.projects.list()
for item in response:
    yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
    yield page

⚙️ Parameters

ordering: typing.Optional[str] — Which field to use when ordering the results.

ids: typing.Optional[str] — ids

title: typing.Optional[str] — title

page: typing.Optional[int] — A page number within the paginated result set.

page_size: typing.Optional[int] — Number of results to return per page.

workspaces: typing.Optional[int] — workspaces

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.projects.create(...)

📝 Description

Create a project and set up the labeling interface. For more information about setting up projects, see the following:

curl -H Content-Type:application/json -H 'Authorization: Token abc123' -X POST 'https://localhost:8080/api/projects'     --data '{"label_config": "<View>[...]</View>"}'

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.projects.create()

⚙️ Parameters

title: typing.Optional[str] — Project title

description: typing.Optional[str] — Project description

label_config: typing.Optional[str] — Label config in XML format

expert_instruction: typing.Optional[str] — Labeling instructions to show to the user

show_instruction: typing.Optional[bool] — Show labeling instructions

show_skip_button: typing.Optional[bool] — Show skip button

enable_empty_annotation: typing.Optional[bool] — Allow empty annotations

show_annotation_history: typing.Optional[bool] — Show annotation history

reveal_preannotations_interactively: typing.Optional[bool] — Reveal preannotations interactively. If set to True, predictions will be shown to the user only after selecting the area of interest

show_collab_predictions: typing.Optional[bool] — Show predictions to annotators

maximum_annotations: typing.Optional[int] — Maximum annotations per task

color: typing.Optional[str] — Project color in HEX format

control_weights: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] — Dict of weights for each control tag in metric calculation. Each control tag (e.g. label or choice) will have its own key in control weight dict with weight for each label and overall weight. For example, if a bounding box annotation with a control tag named my_bbox should be included with 0.33 weight in agreement calculation, and the first label Car should be twice as important as Airplane, then you need to specify: {'my_bbox': {'type': 'RectangleLabels', 'labels': {'Car': 1.0, 'Airplane': 0.5}, 'overall': 0.33}

workspace: typing.Optional[int] — Workspace ID

model_version: typing.Optional[str] — Model version

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.projects.get(...)

📝 Description

Retrieve information about a specific project by project ID. 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.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.projects.get(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this project.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.projects.delete(...)

📝 Description

Delete a project by specified project ID. Deleting a project permanently removes all tasks, annotations, and project data from Label Studio.

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.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.projects.delete(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this project.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.projects.update(...)

📝 Description

Update the project settings for a specific project. For more information, see the following:

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.

If you are modifying the labeling config for project that has in-progress work, note the following: * You cannot remove labels or change the type of labeling being performed unless you delete any existing annotations that are using those labels. * If you make changes to the labeling configuration, any tabs that you might have created in the Data Manager are removed.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.projects.update(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this project.

title: typing.Optional[str] — Project title

description: typing.Optional[str] — Project description

label_config: typing.Optional[str] — Label config in XML format

expert_instruction: typing.Optional[str] — Labeling instructions to show to the user

show_instruction: typing.Optional[bool] — Show labeling instructions

show_skip_button: typing.Optional[bool] — Show skip button

enable_empty_annotation: typing.Optional[bool] — Allow empty annotations

show_annotation_history: typing.Optional[bool] — Show annotation history

reveal_preannotations_interactively: typing.Optional[bool] — Reveal preannotations interactively. If set to True, predictions will be shown to the user only after selecting the area of interest

show_collab_predictions: typing.Optional[bool] — Show predictions to annotators

maximum_annotations: typing.Optional[int] — Maximum annotations per task

color: typing.Optional[str] — Project color in HEX format

control_weights: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] — Dict of weights for each control tag in metric calculation. Each control tag (e.g. label or choice) will have its own key in control weight dict with weight for each label and overall weight. For example, if a bounding box annotation with a control tag named my_bbox should be included with 0.33 weight in agreement calculation, and the first label Car should be twice as important as Airplane, then you need to specify: {'my_bbox': {'type': 'RectangleLabels', 'labels': {'Car': 1.0, 'Airplane': 0.5}, 'overall': 0.33}

workspace: typing.Optional[int] — Workspace ID

model_version: typing.Optional[str] — Model version

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.projects.import_tasks(...)

📝 Description

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:

1. POST with data

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:

curl -H 'Content-Type: application/json' -H 'Authorization: Token abc123' \
-X POST 'https://localhost:8080/api/projects/1/import' --data '[{"text": "Some text 1"}, {"text": "Some text 2"}]'

2. POST with files

Send tasks as files. You can attach multiple files with different names.

  • JSON: text files in JavaScript object notation format
  • CSV: text files with tables in Comma Separated Values format
  • TSV: text files with tables in Tab Separated Value format
  • TXT: simple text files are similar to CSV with one column and no header, supported for projects with one source only

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:

curl -H 'Authorization: Token abc123' \
-X POST 'https://localhost:8080/api/projects/1/import' -F ‘file=@path/to/my_file.csv’

3. POST with URL

You can also provide a URL to a file with labeling tasks. Supported file formats are the same as in option 2.

curl -H 'Content-Type: application/json' -H 'Authorization: Token abc123' \
-X POST 'https://localhost:8080/api/projects/1/import' \
--data '[{"url": "http://example.com/test1.csv"}, {"url": "http://example.com/test2.csv"}]'

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.projects.import_tasks(
    id=1,
    request=[{"key": "value"}],
)

⚙️ Parameters

id: int — A unique integer value identifying this project.

request: typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]]

commit_to_project: typing.Optional[bool] — Set to "true" to immediately commit tasks to the project.

return_task_ids: typing.Optional[bool] — Set to "true" to return task IDs in the response.

preannotated_from_fields: typing.Optional[typing.Union[str, typing.Sequence[str]]] — 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"].

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.projects.validate_config(...)

📝 Description

Determine whether the label configuration for a specific project is valid. For more information about setting up labeling configs, see Configure labeling interface and our Tags reference.

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.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.projects.validate_config(
    id=1,
    label_config="label_config",
)

⚙️ Parameters

id: int — A unique integer value identifying this project.

label_config: str — Label config in XML format. See more about it in documentation

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Tasks

client.tasks.create_many_status(...)

📝 Description

Get information about an async project import operation. This can be especially useful to monitor status, as large import jobs can take time.

You will need the project ID and the unique ID of the import operation.

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 import ID is returned as part of the response when you call Import tasks.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.tasks.create_many_status(
    id=1,
    import_pk="import_pk",
)

⚙️ Parameters

id: int — The project ID.

import_pk: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.tasks.delete_all_tasks(...)

📝 Description

Delete all tasks from a specific project.

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.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.tasks.delete_all_tasks(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this project.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.tasks.list(...)

📝 Description

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.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
response = client.tasks.list()
for item in response:
    yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
    yield page

⚙️ Parameters

page: typing.Optional[int] — A page number within the paginated result set.

page_size: typing.Optional[int] — Number of results to return per page.

view: typing.Optional[int] — View ID

project: typing.Optional[int] — Project ID

resolve_uri: typing.Optional[bool] — Resolve task data URIs using Cloud Storage

fields: typing.Optional[TasksListRequestFields] — Set to "all" if you want to include annotations and predictions in the response

review: typing.Optional[bool] — Get tasks for review

include: typing.Optional[str] — Specify which fields to include in the response

query: typing.Optional[str]

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 > see data field 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"]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.tasks.create(...)

📝 Description

Create a new labeling task in Label Studio.

The data you provide depends on your labeling config and data type.

You will also need to provide a project ID. 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.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.tasks.create(
    data={"image": "https://example.com/image.jpg", "text": "Hello, world!"},
    project=1,
)

⚙️ Parameters

data: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] — Task data dictionary with arbitrary keys and values

project: typing.Optional[int] — Project ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.tasks.get(...)

📝 Description

Get task data, metadata, annotations and other attributes for a specific labeling task by task ID. The task ID is available from the Label Studio URL when viewing the task, or you can retrieve it programmatically with Get task list.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.tasks.get(
    id="id",
)

⚙️ Parameters

id: str — Task ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.tasks.delete(...)

📝 Description

Delete a task in Label Studio.

You will need the task ID. This is available from the Label Studio URL when viewing the task, or you can retrieve it programmatically with Get task list.

This action cannot be undone.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.tasks.delete(
    id="id",
)

⚙️ Parameters

id: str — Task ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.tasks.update(...)

📝 Description

Update the attributes of an existing labeling task.

You will need the task ID. This is available from the Label Studio URL when viewing the task, or you can retrieve it programmatically with Get task list.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.tasks.update(
    id="id",
    data={"image": "https://example.com/image.jpg", "text": "Hello, world!"},
    project=1,
)

⚙️ Parameters

id: str — Task ID

data: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] — Task data dictionary with arbitrary keys and values

project: typing.Optional[int] — Project ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

ImportStorage

client.import_storage.list_types()

📝 Description

Retrieve a list of the import storages types.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.list_types()

⚙️ Parameters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

ExportStorage

client.export_storage.list_types()

📝 Description

Retrieve a list of the export storages types.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.list_types()

⚙️ Parameters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Webhooks

client.webhooks.list(...)

📝 Description

List all webhooks set up for your organization.

Webhooks in Label Studio let you set up integrations that subscribe to certain events that occur inside Label Studio. When an event is triggered, Label Studio sends an HTTP POST request to the configured webhook URL.

For more information, see Set up webhooks in Label Studio.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.webhooks.list()

⚙️ Parameters

project: typing.Optional[str] — Project ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.webhooks.create(...)

📝 Description

Create a webhook. Label Studio provides several out-of-the box webhook events, which you can find listed here: Available Label Studio webhooks.

If you want to create your own custom webhook, refer to Create custom events for webhooks in Label Studio.

Label Studio makes two main types of events available to integrate with webhooks: project-level task events and organization events. If you want to use organization-level webhook events, you will need to set LABEL_STUDIO_ALLOW_ORGANIZATION_WEBHOOKS=true.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.webhooks.create(
    url="url",
)

⚙️ Parameters

url: str — URL of webhook

id: typing.Optional[int]

organization: typing.Optional[int]

project: typing.Optional[int]

send_payload: typing.Optional[bool] — If value is False send only action

send_for_all_actions: typing.Optional[bool] — If value is False - used only for actions from WebhookAction

headers: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] — Key Value Json of headers

is_active: typing.Optional[bool] — If value is False the webhook is disabled

actions: typing.Optional[typing.Sequence[WebhookActionsItem]]

created_at: typing.Optional[dt.datetime] — Creation time

updated_at: typing.Optional[dt.datetime] — Last update time

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.webhooks.info(...)

📝 Description

Get descriptions of all available webhook actions to set up webhooks. For more information, see the Webhook event reference.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.webhooks.info()

⚙️ Parameters

organization_only: typing.Optional[bool] — organization-only or not

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.webhooks.get(...)

📝 Description

Get information about a specific webhook. You will need to provide the webhook ID. You can get this from List all webhooks.

For more information about webhooks, see Set up webhooks in Label Studio and the Webhook event reference.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.webhooks.get(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this webhook.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.webhooks.delete(...)

📝 Description

Delete a webhook. You will need to provide the webhook ID. You can get this from List all webhooks.

For more information about webhooks, see Set up webhooks in Label Studio and the Webhook event reference.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.webhooks.delete(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this webhook.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.webhooks.update(...)

📝 Description

Update a webhook. You will need to provide the webhook ID. You can get this from List all webhooks.

For more information about webhooks, see Set up webhooks in Label Studio and the Webhook event reference.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.webhooks.update(
    id_=1,
    url="url",
    webhook_serializer_for_update_url="url",
)

⚙️ Parameters

id_: int — A unique integer value identifying this webhook.

url: str — URL of webhook

webhook_serializer_for_update_url: str — URL of webhook

send_payload: typing.Optional[bool] — If value is False send only action

send_for_all_actions: typing.Optional[bool] — If value is False - used only for actions from WebhookAction

headers: typing.Optional[str] — Key Value Json of headers

is_active: typing.Optional[bool] — If value is False the webhook is disabled

actions: typing.Optional[ typing.Union[ WebhooksUpdateRequestActionsItem, typing.Sequence[WebhooksUpdateRequestActionsItem], ] ]

id: typing.Optional[int]

organization: typing.Optional[int]

project: typing.Optional[int]

webhook_serializer_for_update_send_payload: typing.Optional[bool] — If value is False send only action

webhook_serializer_for_update_send_for_all_actions: typing.Optional[bool] — If value is False - used only for actions from WebhookAction

webhook_serializer_for_update_headers: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] — Key Value Json of headers

webhook_serializer_for_update_is_active: typing.Optional[bool] — If value is False the webhook is disabled

webhook_serializer_for_update_actions: typing.Optional[typing.Sequence[WebhookSerializerForUpdateActionsItem]]

created_at: typing.Optional[dt.datetime] — Creation time

updated_at: typing.Optional[dt.datetime] — Last update time

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Versions

client.versions.get()

📝 Description

Get version information about the Label Studio instance.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.versions.get()

⚙️ Parameters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Prompts

client.prompts.list()

📝 Description

Get a list of prompts.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.prompts.list()

⚙️ Parameters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.prompts.create(...)

📝 Description

Create a new prompt.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.prompts.create(
    title="title",
    input_fields=["input_fields"],
    output_classes=["output_classes"],
)

⚙️ Parameters

title: str — Title of the prompt

input_fields: typing.Sequence[str] — List of input fields

output_classes: typing.Sequence[str] — List of output classes

description: typing.Optional[str] — Description of the prompt

created_by: typing.Optional[PromptCreatedBy] — User ID of the creator of the prompt

created_at: typing.Optional[dt.datetime] — Date and time the prompt was created

updated_at: typing.Optional[dt.datetime] — Date and time the prompt was last updated

organization: typing.Optional[PromptOrganization] — Organization ID of the prompt

associated_projects: typing.Optional[typing.Sequence[PromptAssociatedProjectsItem]] — List of associated projects IDs or objects

skill_name: typing.Optional[str] — Name of the skill

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.prompts.get(...)

📝 Description

Get a prompt by ID.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.prompts.get(
    id=1,
)

⚙️ Parameters

id: int — Prompt ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.prompts.delete(...)

📝 Description

Delete a prompt by ID.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.prompts.delete(
    id=1,
)

⚙️ Parameters

id: int — Prompt ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.prompts.update(...)

📝 Description

Update a prompt by ID.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.prompts.update(
    id=1,
    title="title",
    input_fields=["input_fields"],
    output_classes=["output_classes"],
)

⚙️ Parameters

id: int — Prompt ID

title: str — Title of the prompt

input_fields: typing.Sequence[str] — List of input fields

output_classes: typing.Sequence[str] — List of output classes

description: typing.Optional[str] — Description of the prompt

created_by: typing.Optional[PromptCreatedBy] — User ID of the creator of the prompt

created_at: typing.Optional[dt.datetime] — Date and time the prompt was created

updated_at: typing.Optional[dt.datetime] — Date and time the prompt was last updated

organization: typing.Optional[PromptOrganization] — Organization ID of the prompt

associated_projects: typing.Optional[typing.Sequence[PromptAssociatedProjectsItem]] — List of associated projects IDs or objects

skill_name: typing.Optional[str] — Name of the skill

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.prompts.batch_predictions(...)

📝 Description

Create a new batch prediction.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.prompts.batch_predictions()

⚙️ Parameters

modelrun_id: typing.Optional[int] — Model Run ID to associate the prediction with

results: typing.Optional[typing.Sequence[PromptsBatchPredictionsRequestResultsItem]]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.prompts.batch_failed_predictions(...)

📝 Description

Create a new batch of failed predictions.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.prompts.batch_failed_predictions()

⚙️ Parameters

modelrun_id: typing.Optional[int] — Model Run ID where the failed predictions came from

failed_predictions: typing.Optional[ typing.Sequence[PromptsBatchFailedPredictionsRequestFailedPredictionsItem] ]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

ModelProviders

client.model_providers.list()

📝 Description

Get all model provider connections created by the user in the current organization.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.model_providers.list()

⚙️ Parameters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.model_providers.create(...)

📝 Description

Create a new model provider connection.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.model_providers.create(
    provider="OpenAI",
)

⚙️ Parameters

provider: ModelProviderConnectionProvider

api_key: typing.Optional[str]

deployment_name: typing.Optional[str]

endpoint: typing.Optional[str]

scope: typing.Optional[ModelProviderConnectionScope]

organization: typing.Optional[ModelProviderConnectionOrganization]

created_by: typing.Optional[ModelProviderConnectionCreatedBy]

created_at: typing.Optional[dt.datetime]

updated_at: typing.Optional[dt.datetime]

is_internal: typing.Optional[bool] — Whether the model provider connection is internal, not visible to the user.

budget_limit: typing.Optional[float] — Budget limit for the model provider connection (null if unlimited)

budget_last_reset_date: typing.Optional[dt.datetime] — Date and time the budget was last reset

budget_reset_period: typing.Optional[ModelProviderConnectionBudgetResetPeriod] — Budget reset period for the model provider connection (null if not reset)

budget_total_spent: typing.Optional[float] — Tracked total budget spent for the given provider connection within the current budget period

budget_alert_threshold: typing.Optional[float] — Budget alert threshold for the given provider connection

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.model_providers.get(...)

📝 Description

Get a model provider connection by ID.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.model_providers.get(
    pk=1,
)

⚙️ Parameters

pk: int — Model Provider Connection ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.model_providers.delete(...)

📝 Description

Delete a model provider connection by ID.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.model_providers.delete(
    pk=1,
)

⚙️ Parameters

pk: int — Model Provider Connection ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.model_providers.update(...)

📝 Description

Update a model provider connection by ID.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.model_providers.update(
    pk=1,
    provider="OpenAI",
)

⚙️ Parameters

pk: int — Model Provider Connection ID

provider: ModelProviderConnectionProvider

api_key: typing.Optional[str]

deployment_name: typing.Optional[str]

endpoint: typing.Optional[str]

scope: typing.Optional[ModelProviderConnectionScope]

organization: typing.Optional[ModelProviderConnectionOrganization]

created_by: typing.Optional[ModelProviderConnectionCreatedBy]

created_at: typing.Optional[dt.datetime]

updated_at: typing.Optional[dt.datetime]

is_internal: typing.Optional[bool] — Whether the model provider connection is internal, not visible to the user.

budget_limit: typing.Optional[float] — Budget limit for the model provider connection (null if unlimited)

budget_last_reset_date: typing.Optional[dt.datetime] — Date and time the budget was last reset

budget_reset_period: typing.Optional[ModelProviderConnectionBudgetResetPeriod] — Budget reset period for the model provider connection (null if not reset)

budget_total_spent: typing.Optional[float] — Tracked total budget spent for the given provider connection within the current budget period

budget_alert_threshold: typing.Optional[float] — Budget alert threshold for the given provider connection

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Comments

client.comments.list(...)

📝 Description

Get a list of comments for a specific project.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.comments.list()

⚙️ Parameters

project: typing.Optional[int] — Project ID

expand_created_by: typing.Optional[bool] — Expand the created_by field with object instead of ID

annotation: typing.Optional[int] — Annotation ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.comments.create(...)

📝 Description

Create a new comment.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.comments.create()

⚙️ Parameters

annotation: typing.Optional[int]

project: typing.Optional[int]

text: typing.Optional[str]

is_resolved: typing.Optional[bool]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.comments.get(...)

📝 Description

Get a specific comment.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.comments.get(
    id=1,
)

⚙️ Parameters

id: int — Comment ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.comments.delete(...)

📝 Description

Delete a specific comment.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.comments.delete(
    id=1,
)

⚙️ Parameters

id: int — Comment ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.comments.update(...)

📝 Description

Update a specific comment.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.comments.update(
    id=1,
)

⚙️ Parameters

id: int — Comment ID

annotation: typing.Optional[int]

project: typing.Optional[int]

text: typing.Optional[str]

is_resolved: typing.Optional[bool]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Workspaces

client.workspaces.list()

📝 Description

List all workspaces for your organization.

Workspaces in Label Studio let you organize your projects and users into separate spaces. This is useful for managing different teams, departments, or projects within your organization.

For more information, see Workspaces in Label Studio.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.workspaces.list()

⚙️ Parameters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.workspaces.create(...)

📝 Description

Create a new workspace.

Workspaces in Label Studio let you organize your projects and users into separate spaces. This is useful for managing different teams, departments, or projects within your organization.

For more information, see Workspaces in Label Studio.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.workspaces.create()

⚙️ Parameters

title: typing.Optional[str] — Workspace title

description: typing.Optional[str] — Workspace description

is_public: typing.Optional[bool] — Is workspace public

is_personal: typing.Optional[bool] — Is workspace personal

color: typing.Optional[str] — Workspace color in HEX format

is_archived: typing.Optional[bool] — Is workspace archived

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.workspaces.get(...)

📝 Description

Get information about a specific workspace. You will need to provide the workspace ID. You can find this using List workspaces.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.workspaces.get(
    id=1,
)

⚙️ Parameters

id: int — Workspace ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.workspaces.delete(...)

📝 Description

Delete a specific workspace. You will need to provide the workspace ID. You can find this using List workspaces.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.workspaces.delete(
    id=1,
)

⚙️ Parameters

id: int — Workspace ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.workspaces.update(...)

📝 Description

Update a specific workspace. You will need to provide the workspace ID. You can find this using List workspaces.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.workspaces.update(
    id=1,
)

⚙️ Parameters

id: int — Workspace ID

title: typing.Optional[str] — Workspace title

description: typing.Optional[str] — Workspace description

is_public: typing.Optional[bool] — Is workspace public

is_personal: typing.Optional[bool] — Is workspace personal

color: typing.Optional[str] — Workspace color in HEX format

is_archived: typing.Optional[bool] — Is workspace archived

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Tokens

client.tokens.blacklist(...)

📝 Description

Blacklist a refresh token to prevent its future use.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.tokens.blacklist(
    refresh="refresh",
)

⚙️ Parameters

refresh: str — JWT refresh token

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.tokens.get()

📝 Description

List all API tokens for the current user.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.tokens.get()

⚙️ Parameters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.tokens.create()

📝 Description

Create a new API token for the current user.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.tokens.create()

⚙️ Parameters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.tokens.refresh(...)

📝 Description

Get a new access token, using a refresh token.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.tokens.refresh(
    refresh="refresh",
)

⚙️ Parameters

refresh: str — JWT refresh token

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

JwtSettings

client.jwt_settings.get()

📝 Description

Retrieve JWT settings for the currently active organization.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.jwt_settings.get()

⚙️ Parameters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.jwt_settings.create(...)

📝 Description

Update JWT settings for the currently active organization.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.jwt_settings.create(
    api_tokens_enabled=True,
    legacy_api_tokens_enabled=True,
    api_token_ttl_days=1,
)

⚙️ Parameters

api_tokens_enabled: bool — Whether JWT API tokens are enabled

legacy_api_tokens_enabled: bool — Whether legacy API tokens are enabled

api_token_ttl_days: int — Number of days before API tokens expire

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

ExportStorage Azure

client.export_storage.azure.list(...)

📝 Description

You can connect your Microsoft Azure Blob storage container to Label Studio as a source storage or target storage. Use this API request to get a list of all Azure export (target) storage connections for a specific project.

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.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.azure.list()

⚙️ Parameters

project: typing.Optional[int] — Project ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.azure.create(...)

📝 Description

Create a new target storage connection to Microsoft Azure Blob storage.

For information about the required fields and prerequisites, see Microsoft Azure Blob storage in the Label Studio documentation.

After you add the storage, you should validate the connection before attempting to sync your data. Your data will not be exported until you sync your connection.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.azure.create()

⚙️ Parameters

can_delete_objects: typing.Optional[bool] — Deletion from storage enabled

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

container: typing.Optional[str] — Azure blob container

prefix: typing.Optional[str] — Azure blob prefix name

account_name: typing.Optional[str] — Azure Blob account name

account_key: typing.Optional[str] — Azure Blob account key

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.azure.validate(...)

📝 Description

Validate a specific Azure export storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to export data.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.azure.validate()

⚙️ Parameters

id: typing.Optional[int] — Storage ID. If set, storage with specified ID will be updated

can_delete_objects: typing.Optional[bool] — Deletion from storage enabled

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

container: typing.Optional[str] — Azure blob container

prefix: typing.Optional[str] — Azure blob prefix name

account_name: typing.Optional[str] — Azure Blob account name

account_key: typing.Optional[str] — Azure Blob account key

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.azure.get(...)

📝 Description

Get a specific Azure export storage connection. You will need to provide the export storage ID. You can find this using List export storages.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.azure.get(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this azure blob export storage.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.azure.delete(...)

📝 Description

Delete a specific Azure export storage connection. You will need to provide the export storage ID. You can find this using List export storages.

Deleting an export/target storage connection does not affect tasks with synced data in Label Studio. If you want to remove the tasks that were synced from the external storage, you will need to delete them manually from within the Label Studio UI or use the Delete tasks API.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.azure.delete(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this azure blob export storage.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.azure.update(...)

📝 Description

Update a specific Azure export storage connection. You will need to provide the export storage ID. You can find this using List export storages.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.azure.update(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this azure blob export storage.

can_delete_objects: typing.Optional[bool] — Deletion from storage enabled

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

container: typing.Optional[str] — Azure blob container

prefix: typing.Optional[str] — Azure blob prefix name

account_name: typing.Optional[str] — Azure Blob account name

account_key: typing.Optional[str] — Azure Blob account key

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.azure.sync(...)

📝 Description

Sync tasks to an Azure export/target storage connection. You will need to provide the export storage ID. You can find this using List export storages.

Sync operations with external containers only go one way. They either create tasks from objects in the container (source/import storage) or push annotations to the output container (export/target storage). Changing something on the Microsoft side doesn’t guarantee consistency in results.

Before proceeding, you should review How sync operations work - Source storage to ensure that your data remains secure and private.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.azure.sync(
    id=1,
)

⚙️ Parameters

id: int

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

ExportStorage Gcs

client.export_storage.gcs.list(...)

📝 Description

You can connect your Google Cloud Storage bucket to Label Studio as a source storage or target storage. Use this API request to get a list of all GCS export (target) storage connections for a specific project.

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.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.gcs.list()

⚙️ Parameters

project: typing.Optional[int] — Project ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.gcs.create(...)

📝 Description

Create a new target storage connection to Google Cloud Storage.

For information about the required fields and prerequisites, see Google Cloud Storage in the Label Studio documentation.

After you add the storage, you should validate the connection before attempting to sync your data. Your data will not be exported until you sync your connection.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.gcs.create()

⚙️ Parameters

can_delete_objects: typing.Optional[bool] — Deletion from storage enabled.

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

bucket: typing.Optional[str] — GCS bucket name

prefix: typing.Optional[str] — GCS bucket prefix

google_application_credentials: typing.Optional[str] — The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.

google_project_id: typing.Optional[str] — Google project ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.gcs.validate(...)

📝 Description

Validate a specific GCS export storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to export data.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.gcs.validate()

⚙️ Parameters

id: typing.Optional[int] — Storage ID. If set, storage with specified ID will be updated

can_delete_objects: typing.Optional[bool] — Deletion from storage enabled.

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

bucket: typing.Optional[str] — GCS bucket name

prefix: typing.Optional[str] — GCS bucket prefix

google_application_credentials: typing.Optional[str] — The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.

google_project_id: typing.Optional[str] — Google project ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.gcs.get(...)

📝 Description

Get a specific GCS export storage connection. You will need to provide the export storage ID. You can find this using List export storages.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.gcs.get(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this gcs export storage.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.gcs.delete(...)

📝 Description

Delete a specific GCS export storage connection. You will need to provide the export storage ID. You can find this using List export storages.

Deleting an export/target storage connection does not affect tasks with synced data in Label Studio. If you want to remove the tasks that were synced from the external storage, you will need to delete them manually from within the Label Studio UI or use the Delete tasks API.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.gcs.delete(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this gcs export storage.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.gcs.update(...)

📝 Description

Update a specific GCS export storage connection. You will need to provide the export storage ID. You can find this using List export storages.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.gcs.update(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this gcs export storage.

can_delete_objects: typing.Optional[bool] — Deletion from storage enabled.

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

bucket: typing.Optional[str] — GCS bucket name

prefix: typing.Optional[str] — GCS bucket prefix

google_application_credentials: typing.Optional[str] — The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.

google_project_id: typing.Optional[str] — Google project ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.gcs.sync(...)

📝 Description

Sync tasks to a GCS export/target storage connection. You will need to provide the export storage ID. You can find this using List export storages.

Sync operations with external buckets only go one way. They either create tasks from objects in the bucket (source/import storage) or push annotations to the output bucket (export/target storage). Changing something on the bucket side doesn’t guarantee consistency in results.

Before proceeding, you should review How sync operations work - Source storage to ensure that your data remains secure and private.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.gcs.sync(
    id=1,
)

⚙️ Parameters

id: int

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

ExportStorage Local

client.export_storage.local.list(...)

📝 Description

You can connect a local file directory to Label Studio as a source storage or target storage. Use this API request to get a list of all local file export (target) storage connections for a specific project.

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.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.local.list()

⚙️ Parameters

project: typing.Optional[int] — Project ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.local.create(...)

📝 Description

Create a new target storage connection to a local file directory.

For information about the required fields and prerequisites, see Local storage in the Label Studio documentation.

After you add the storage, you should validate the connection before attempting to sync your data. Your data will not be exported until you sync your connection.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.local.create()

⚙️ Parameters

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

path: typing.Optional[str] — Path to local directory

regex_filter: typing.Optional[str] — Regex for filtering objects

use_blob_urls: typing.Optional[bool] — Interpret objects as BLOBs and generate URLs. For example, if your directory contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.local.validate(...)

📝 Description

Validate a specific local file export storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to export data.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.local.validate()

⚙️ Parameters

id: typing.Optional[int] — Storage ID. If set, storage with specified ID will be updated

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

path: typing.Optional[str] — Path to local directory

regex_filter: typing.Optional[str] — Regex for filtering objects

use_blob_urls: typing.Optional[bool] — Interpret objects as BLOBs and generate URLs. For example, if your directory contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.local.get(...)

📝 Description

Get a specific local file export storage connection. You will need to provide the export storage ID. You can find this using List export storages.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.local.get(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this local files export storage.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.local.delete(...)

📝 Description

Delete a specific local file export storage connection. You will need to provide the export storage ID. You can find this using List export storages.

Deleting an export/target storage connection does not affect tasks with synced data in Label Studio. If you want to remove the tasks that were synced from the external storage, you will need to delete them manually from within the Label Studio UI or use the Delete tasks API.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.local.delete(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this local files export storage.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.local.update(...)

📝 Description

Update a specific local file export storage connection. You will need to provide the export storage ID. You can find this using List export storages.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.local.update(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this local files export storage.

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

path: typing.Optional[str] — Path to local directory

regex_filter: typing.Optional[str] — Regex for filtering objects

use_blob_urls: typing.Optional[bool] — Interpret objects as BLOBs and generate URLs. For example, if your directory contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.local.sync(...)

📝 Description

Sync tasks to an local file export/target storage connection. You will need to provide the export storage ID. You can find this using List export storages.

Sync operations with external local file directories only go one way. They either create tasks from objects in the directory (source/import storage) or push annotations to the output directory (export/target storage). Changing something on the local file side doesn’t guarantee consistency in results.

Before proceeding, you should review How sync operations work - Source storage to ensure that your data remains secure and private.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.local.sync(
    id=1,
)

⚙️ Parameters

id: int

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

ExportStorage Redis

client.export_storage.redis.list(...)

📝 Description

You can connect your Redis database to Label Studio as a source storage or target storage. Use this API request to get a list of all Redis export (target) storage connections for a specific project.

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.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.redis.list()

⚙️ Parameters

project: typing.Optional[int] — Project ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.redis.create(...)

📝 Description

Create a new target storage connection to Redis.

For information about the required fields and prerequisites, see Redis database in the Label Studio documentation.

After you add the storage, you should validate the connection before attempting to sync your data. Your data will not be exported until you sync your connection.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.redis.create()

⚙️ Parameters

db: typing.Optional[int] — Database ID of database to use

can_delete_objects: typing.Optional[bool] — Deletion from storage enabled.

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

path: typing.Optional[str] — Storage prefix (optional)

host: typing.Optional[str] — Server Host IP (optional)

port: typing.Optional[str] — Server Port (optional)

password: typing.Optional[str] — Server Password (optional)

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.redis.validate(...)

📝 Description

Validate a specific Redis export storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to export data.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.redis.validate()

⚙️ Parameters

id: typing.Optional[int] — Storage ID. If set, storage with specified ID will be updated

db: typing.Optional[int] — Database ID of database to use

can_delete_objects: typing.Optional[bool] — Deletion from storage enabled.

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

path: typing.Optional[str] — Storage prefix (optional)

host: typing.Optional[str] — Server Host IP (optional)

port: typing.Optional[str] — Server Port (optional)

password: typing.Optional[str] — Server Password (optional)

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.redis.get(...)

📝 Description

Get a specific Redis export storage connection. You will need to provide the export storage ID. You can find this using List export storages.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.redis.get(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this redis export storage.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.redis.delete(...)

📝 Description

Delete a specific Redis export storage connection. You will need to provide the export storage ID. You can find this using List export storages.

Deleting an export/target storage connection does not affect tasks with synced data in Label Studio. If you want to remove the tasks that were synced from the external storage, you will need to delete them manually from within the Label Studio UI or use the Delete tasks API.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.redis.delete(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this redis export storage.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.redis.update(...)

📝 Description

Update a specific Redis export storage connection. You will need to provide the export storage ID. You can find this using List export storages.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.redis.update(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this redis export storage.

db: typing.Optional[int] — Database ID of database to use

can_delete_objects: typing.Optional[bool] — Deletion from storage enabled.

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

path: typing.Optional[str] — Storage prefix (optional)

host: typing.Optional[str] — Server Host IP (optional)

port: typing.Optional[str] — Server Port (optional)

password: typing.Optional[str] — Server Password (optional)

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.redis.sync(...)

📝 Description

Sync tasks to an Redis export/target storage connection. You will need to provide the export storage ID. You can find this using List export storages.

Sync operations with external databases only go one way. They either create tasks from objects in the database (source/import storage) or push annotations to the output database (export/target storage). Changing something on the database side doesn’t guarantee consistency in results.

Before proceeding, you should review How sync operations work - Source storage to ensure that your data remains secure and private.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.redis.sync(
    id=1,
)

⚙️ Parameters

id: int

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

ExportStorage S3

client.export_storage.s3.list(...)

📝 Description

You can connect your S3 bucket to Label Studio as a source storage or target storage. Use this API request to get a list of all S3 export (target) storage connections for a specific project.

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.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.s3.list()

⚙️ Parameters

project: typing.Optional[int] — Project ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.s3.create(...)

📝 Description

Create a new target storage connection to S3 storage.

For information about the required fields and prerequisites, see Amazon S3 in the Label Studio documentation.

After you add the storage, you should validate the connection before attempting to sync your data. Your data will not be exported until you sync your connection.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.s3.create()

⚙️ Parameters

can_delete_objects: typing.Optional[bool] — Deletion from storage enabled.

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

bucket: typing.Optional[str] — S3 bucket name

prefix: typing.Optional[str] — S3 bucket prefix

aws_access_key_id: typing.Optional[str] — AWS_ACCESS_KEY_ID

aws_secret_access_key: typing.Optional[str] — AWS_SECRET_ACCESS_KEY

aws_session_token: typing.Optional[str] — AWS_SESSION_TOKEN

aws_sse_kms_key_id: typing.Optional[str] — AWS SSE KMS Key ID

region_name: typing.Optional[str] — AWS Region

s3endpoint: typing.Optional[str] — S3 Endpoint

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.s3.validate(...)

📝 Description

Validate a specific S3 export storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to export data.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.s3.validate()

⚙️ Parameters

id: typing.Optional[int] — Storage ID. If set, storage with specified ID will be updated

can_delete_objects: typing.Optional[bool] — Deletion from storage enabled.

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

bucket: typing.Optional[str] — S3 bucket name

prefix: typing.Optional[str] — S3 bucket prefix

aws_access_key_id: typing.Optional[str] — AWS_ACCESS_KEY_ID

aws_secret_access_key: typing.Optional[str] — AWS_SECRET_ACCESS_KEY

aws_session_token: typing.Optional[str] — AWS_SESSION_TOKEN

aws_sse_kms_key_id: typing.Optional[str] — AWS SSE KMS Key ID

region_name: typing.Optional[str] — AWS Region

s3endpoint: typing.Optional[str] — S3 Endpoint

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.s3.get(...)

📝 Description

Get a specific S3 export storage connection. You will need to provide the export storage ID. You can find this using List export storages.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.s3.get(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this s3 export storage.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.s3.delete(...)

📝 Description

Delete a specific S3 export storage connection. You will need to provide the export storage ID. You can find this using List export storages.

Deleting an export/target storage connection does not affect tasks with synced data in Label Studio. If you want to remove the tasks that were synced from the external storage, you will need to delete them manually from within the Label Studio UI or use the Delete tasks API.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.s3.delete(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this s3 export storage.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.s3.update(...)

📝 Description

Update a specific S3 export storage connection. You will need to provide the export storage ID. You can find this using List export storages.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.s3.update(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this s3 export storage.

can_delete_objects: typing.Optional[bool] — Deletion from storage enabled.

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

bucket: typing.Optional[str] — S3 bucket name

prefix: typing.Optional[str] — S3 bucket prefix

aws_access_key_id: typing.Optional[str] — AWS_ACCESS_KEY_ID

aws_secret_access_key: typing.Optional[str] — AWS_SECRET_ACCESS_KEY

aws_session_token: typing.Optional[str] — AWS_SESSION_TOKEN

aws_sse_kms_key_id: typing.Optional[str] — AWS SSE KMS Key ID

region_name: typing.Optional[str] — AWS Region

s3endpoint: typing.Optional[str] — S3 Endpoint

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.s3.sync(...)

📝 Description

Sync tasks to an S3 export/target storage connection. You will need to provide the export storage ID. You can find this using List export storages.

Sync operations with external buckets only go one way. They either create tasks from objects in the bucket (source/import storage) or push annotations to the output bucket (export/target storage). Changing something on the bucket side doesn’t guarantee consistency in results.

Before proceeding, you should review How sync operations work - Source storage to ensure that your data remains secure and private.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.s3.sync(
    id=1,
)

⚙️ Parameters

id: int

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

ExportStorage S3S

client.export_storage.s3s.list(...)

📝 Description

You can connect your S3 bucket to Label Studio as a source storage or target storage. Use this API request to get a list of all S3 export (target) storage connections for a specific project.

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.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.s3s.list()

⚙️ Parameters

project: typing.Optional[int] — Project ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.s3s.create(...)

📝 Description

Create a new target storage connection to a S3 bucket with IAM role access.

For information about the required fields and prerequisites, see Amazon S3 in the Label Studio documentation.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.s3s.create()

⚙️ Parameters

can_delete_objects: typing.Optional[bool] — Deletion from storage enabled.

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

bucket: typing.Optional[str] — S3 bucket name

prefix: typing.Optional[str] — S3 bucket prefix

external_id: typing.Optional[str] — AWS External ID

role_arn: typing.Optional[str] — AWS Role ARN

region_name: typing.Optional[str] — AWS Region

s3endpoint: typing.Optional[str] — S3 Endpoint

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.s3s.get(...)

📝 Description

Get a specific S3 export storage connection. You will need to provide the export storage ID. You can find this using List export storages.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.s3s.get(
    id=1,
)

⚙️ Parameters

id: int — Export storage ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.s3s.delete(...)

📝 Description

Delete a specific S3 export storage connection. You will need to provide the export storage ID. You can find this using List export storages.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.s3s.delete(
    id=1,
)

⚙️ Parameters

id: int — Export storage ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.s3s.update(...)

📝 Description

Update a specific S3 export storage connection. You will need to provide the export storage ID. You can find this using List export storages.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.s3s.update(
    id=1,
)

⚙️ Parameters

id: int — Export storage ID

can_delete_objects: typing.Optional[bool] — Deletion from storage enabled.

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

bucket: typing.Optional[str] — S3 bucket name

prefix: typing.Optional[str] — S3 bucket prefix

external_id: typing.Optional[str] — AWS External ID

role_arn: typing.Optional[str] — AWS Role ARN

region_name: typing.Optional[str] — AWS Region

s3endpoint: typing.Optional[str] — S3 Endpoint

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.export_storage.s3s.validate(...)

📝 Description

Validate a specific S3 export storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to export data.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.export_storage.s3s.validate()

⚙️ Parameters

can_delete_objects: typing.Optional[bool] — Deletion from storage enabled.

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

bucket: typing.Optional[str] — S3 bucket name

prefix: typing.Optional[str] — S3 bucket prefix

external_id: typing.Optional[str] — AWS External ID

role_arn: typing.Optional[str] — AWS Role ARN

region_name: typing.Optional[str] — AWS Region

s3endpoint: typing.Optional[str] — S3 Endpoint

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

ImportStorage Azure

client.import_storage.azure.list(...)

📝 Description

You can connect your Microsoft Azure Blob storage container to Label Studio as a source storage or target storage. Use this API request to get a list of all Azure import (source) storage connections for a specific project.

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.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.azure.list()

⚙️ Parameters

project: typing.Optional[int] — Project ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.azure.create(...)

📝 Description

Create a new source storage connection to Microsoft Azure Blob storage.

For information about the required fields and prerequisites, see Microsoft Azure Blob storage in the Label Studio documentation.

Ensure you configure CORS before adding cloud storage. This ensures you will be able to see the content of the data rather than just a link.

After you add the storage, you should validate the connection before attempting to sync your data. Your data will not be imported until you sync your connection.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.azure.create()

⚙️ Parameters

regex_filter: typing.Optional[str] — Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.

use_blob_urls: typing.Optional[bool] — Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.

presign: typing.Optional[bool] — Presign URLs for direct download

presign_ttl: typing.Optional[int] — Presign TTL in minutes

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

container: typing.Optional[str] — Azure blob container

prefix: typing.Optional[str] — Azure blob prefix name

account_name: typing.Optional[str] — Azure Blob account name

account_key: typing.Optional[str] — Azure Blob account key

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.azure.validate(...)

📝 Description

Validate a specific Azure import storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to import data.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.azure.validate()

⚙️ Parameters

id: typing.Optional[int] — Storage ID. If set, storage with specified ID will be updated

regex_filter: typing.Optional[str] — Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.

use_blob_urls: typing.Optional[bool] — Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.

presign: typing.Optional[bool] — Presign URLs for direct download

presign_ttl: typing.Optional[int] — Presign TTL in minutes

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

container: typing.Optional[str] — Azure blob container

prefix: typing.Optional[str] — Azure blob prefix name

account_name: typing.Optional[str] — Azure Blob account name

account_key: typing.Optional[str] — Azure Blob account key

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.azure.get(...)

📝 Description

Get a specific Azure import storage connection. You will need to provide the import storage ID. You can find this using List import storages.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.azure.get(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this azure blob import storage.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.azure.delete(...)

📝 Description

Delete a specific Azure import storage connection. You will need to provide the import storage ID. You can find this using List import storages.

Deleting a source storage connection does not affect tasks with synced data in Label Studio. The sync process is designed to import new or updated tasks from the connected storage into the project, but it does not track deletions of files from the storage. Therefore, if you remove the external storage connection, the tasks that were created from that storage will remain in the project.

If you want to remove the tasks that were synced from the external storage, you will need to delete them manually from within the Label Studio UI or use the Delete tasks API.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.azure.delete(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this azure blob import storage.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.azure.update(...)

📝 Description

Update a specific Azure import storage connection. You will need to provide the import storage ID. You can find this using List import storages.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.azure.update(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this azure blob import storage.

regex_filter: typing.Optional[str] — Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.

use_blob_urls: typing.Optional[bool] — Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.

presign: typing.Optional[bool] — Presign URLs for direct download

presign_ttl: typing.Optional[int] — Presign TTL in minutes

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

container: typing.Optional[str] — Azure blob container

prefix: typing.Optional[str] — Azure blob prefix name

account_name: typing.Optional[str] — Azure Blob account name

account_key: typing.Optional[str] — Azure Blob account key

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.azure.sync(...)

📝 Description

Sync tasks from an Azure import storage connection. You will need to provide the import storage ID. You can find this using List import storages.

Sync operations with external containers only go one way. They either create tasks from objects in the container (source/import storage) or push annotations to the output container (export/target storage). Changing something on the Microsoft side doesn’t guarantee consistency in results.

Before proceeding, you should review How sync operations work - Source storage to ensure that your data remains secure and private.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.azure.sync(
    id=1,
)

⚙️ Parameters

id: int — Storage ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

ImportStorage Gcs

client.import_storage.gcs.list(...)

📝 Description

You can connect your Google Cloud Storage bucket to Label Studio as a source storage or target storage. Use this API request to get a list of all Google import (source) storage connections for a specific project.

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.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.gcs.list()

⚙️ Parameters

project: typing.Optional[int] — Project ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.gcs.create(...)

📝 Description

Create a new source storage connection to a Google Cloud Storage bucket.

For information about the required fields and prerequisites, see Google Cloud Storage in the Label Studio documentation.

Ensure you configure CORS before adding cloud storage. This ensures you will be able to see the content of the data rather than just a link.

After you add the storage, you should validate the connection before attempting to sync your data. Your data will not be imported until you sync your connection.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.gcs.create()

⚙️ Parameters

regex_filter: typing.Optional[str] — Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.

use_blob_urls: typing.Optional[bool] — Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.

presign: typing.Optional[bool] — Presign URLs for direct download

presign_ttl: typing.Optional[int] — Presign TTL in minutes

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

bucket: typing.Optional[str] — GCS bucket name

prefix: typing.Optional[str] — GCS bucket prefix

google_application_credentials: typing.Optional[str] — The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.

google_project_id: typing.Optional[str] — Google project ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.gcs.validate(...)

📝 Description

Validate a specific GCS import storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to import data.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.gcs.validate()

⚙️ Parameters

id: typing.Optional[int] — Storage ID. If set, storage with specified ID will be updated

regex_filter: typing.Optional[str] — Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.

use_blob_urls: typing.Optional[bool] — Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.

presign: typing.Optional[bool] — Presign URLs for direct download

presign_ttl: typing.Optional[int] — Presign TTL in minutes

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

bucket: typing.Optional[str] — GCS bucket name

prefix: typing.Optional[str] — GCS bucket prefix

google_application_credentials: typing.Optional[str] — The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.

google_project_id: typing.Optional[str] — Google project ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.gcs.get(...)

📝 Description

Get a specific GCS import storage connection. You will need to provide the import storage ID. You can find this using List import storages.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.gcs.get(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this gcs import storage.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.gcs.delete(...)

📝 Description

Delete a specific GCS import storage connection. You will need to provide the import storage ID. You can find this using List import storages.

Deleting a source storage connection does not affect tasks with synced data in Label Studio. The sync process is designed to import new or updated tasks from the connected storage into the project, but it does not track deletions of files from the storage. Therefore, if you remove the external storage connection, the tasks that were created from that storage will remain in the project.

If you want to remove the tasks that were synced from the external storage, you will need to delete them manually from within the Label Studio UI or use the Delete tasks API.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.gcs.delete(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this gcs import storage.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.gcs.update(...)

📝 Description

Update a specific GCS import storage connection. You will need to provide the import storage ID. You can find this using List import storages.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.gcs.update(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this gcs import storage.

regex_filter: typing.Optional[str] — Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.

use_blob_urls: typing.Optional[bool] — Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.

presign: typing.Optional[bool] — Presign URLs for direct download

presign_ttl: typing.Optional[int] — Presign TTL in minutes

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

bucket: typing.Optional[str] — GCS bucket name

prefix: typing.Optional[str] — GCS bucket prefix

google_application_credentials: typing.Optional[str] — The content of GOOGLE_APPLICATION_CREDENTIALS json file. Check official Google Cloud Authentication documentation for more details.

google_project_id: typing.Optional[str] — Google project ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.gcs.sync(...)

📝 Description

Sync tasks from a GCS import storage connection. You will need to provide the import storage ID. You can find this using List import storages.

Sync operations with external buckets only go one way. They either create tasks from objects in the bucket (source/import storage) or push annotations to the output bucket (export/target storage). Changing something on the bucket side doesn’t guarantee consistency in results.

Before proceeding, you should review How sync operations work - Source storage to ensure that your data remains secure and private.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.gcs.sync(
    id=1,
)

⚙️ Parameters

id: int — Storage ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

ImportStorage Local

client.import_storage.local.list(...)

📝 Description

If you have local files that you want to add to Label Studio from a specific directory, you can set up a specific local directory on the machine where LS is running as source or target storage. Use this API request to get a list of all local file import (source) storage connections for a specific project.

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.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.local.list()

⚙️ Parameters

project: typing.Optional[int] — Project ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.local.create(...)

📝 Description

Create a new source storage connection to a local file directory.

For information about the required fields and prerequisites, see Local storage in the Label Studio documentation.

After you add the storage, you should validate the connection before attempting to sync your data. Your data will not be imported until you sync your connection.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.local.create()

⚙️ Parameters

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

path: typing.Optional[str] — Path to local directory

regex_filter: typing.Optional[str] — Regex for filtering objects

use_blob_urls: typing.Optional[bool] — Interpret objects as BLOBs and generate URLs. For example, if your directory contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.local.validate(...)

📝 Description

Validate a specific local file import storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to import data.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.local.validate()

⚙️ Parameters

id: typing.Optional[int] — Storage ID. If set, storage with specified ID will be updated

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

path: typing.Optional[str] — Path to local directory

regex_filter: typing.Optional[str] — Regex for filtering objects

use_blob_urls: typing.Optional[bool] — Interpret objects as BLOBs and generate URLs. For example, if your directory contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.local.get(...)

📝 Description

Get a specific local file import storage connection. You will need to provide the import storage ID. You can find this using List import storages.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.local.get(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this local files import storage.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.local.delete(...)

📝 Description

Delete a specific local import storage connection. You will need to provide the import storage ID. You can find this using List import storages.

Deleting a source storage connection does not affect tasks with synced data in Label Studio. The sync process is designed to import new or updated tasks from the connected storage into the project, but it does not track deletions of files from the storage. Therefore, if you remove the external storage connection, the tasks that were created from that storage will remain in the project.

If you want to remove the tasks that were synced from the external storage, you will need to delete them manually from within the Label Studio UI or use the Delete tasks API.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.local.delete(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this local files import storage.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.local.update(...)

📝 Description

Update a specific local import storage connection. You will need to provide the import storage ID. You can find this using List import storages.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.local.update(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this local files import storage.

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

path: typing.Optional[str] — Path to local directory

regex_filter: typing.Optional[str] — Regex for filtering objects

use_blob_urls: typing.Optional[bool] — Interpret objects as BLOBs and generate URLs. For example, if your directory contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.local.sync(...)

📝 Description

Sync tasks from a local import storage connection. You will need to provide the import storage ID. You can find this using List import storages.

Sync operations with external sources only go one way. They either create tasks from objects in the source directory (source/import storage) or push annotations to the output directory (export/target storage). Changing something on the local file side doesn’t guarantee consistency in results.

Before proceeding, you should review How sync operations work - Source storage to ensure that your data remains secure and private.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.local.sync(
    id=1,
)

⚙️ Parameters

id: int — Storage ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

ImportStorage Redis

client.import_storage.redis.list(...)

📝 Description

You can connect your Redis database to Label Studio as a source storage or target storage. Use this API request to get a list of all Redis import (source) storage connections for a specific project.

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.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.redis.list()

⚙️ Parameters

project: typing.Optional[int] — Project ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.redis.create(...)

📝 Description

Create a new source storage connection to a Redis database.

For information about the required fields and prerequisites, see Redis database in the Label Studio documentation.

After you add the storage, you should validate the connection before attempting to sync your data. Your data will not be imported until you sync your connection.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.redis.create()

⚙️ Parameters

regex_filter: typing.Optional[str] — Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.

use_blob_urls: typing.Optional[bool] — Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

path: typing.Optional[str] — Storage prefix (optional)

host: typing.Optional[str] — Server Host IP (optional)

port: typing.Optional[str] — Server Port (optional)

password: typing.Optional[str] — Server Password (optional)

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.redis.validate(...)

📝 Description

Validate a specific Redis import storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to import data.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.redis.validate()

⚙️ Parameters

id: typing.Optional[int] — Storage ID. If set, storage with specified ID will be updated

regex_filter: typing.Optional[str] — Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.

use_blob_urls: typing.Optional[bool] — Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

path: typing.Optional[str] — Storage prefix (optional)

host: typing.Optional[str] — Server Host IP (optional)

port: typing.Optional[str] — Server Port (optional)

password: typing.Optional[str] — Server Password (optional)

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.redis.get(...)

📝 Description

Get a specific Redis import storage connection. You will need to provide the import storage ID. You can find this using List import storages.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.redis.get(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this redis import storage.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.redis.delete(...)

📝 Description

Delete a specific Redis import storage connection. You will need to provide the import storage ID. You can find this using List import storages.

Deleting a source storage connection does not affect tasks with synced data in Label Studio. The sync process is designed to import new or updated tasks from the connected storage into the project, but it does not track deletions of files from the storage. Therefore, if you remove the external storage connection, the tasks that were created from that storage will remain in the project.

If you want to remove the tasks that were synced from the external storage, you will need to delete them manually from within the Label Studio UI or use the Delete tasks API.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.redis.delete(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this redis import storage.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.redis.update(...)

📝 Description

Update a specific Redis import storage connection. You will need to provide the import storage ID. You can find this using List import storages.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.redis.update(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this redis import storage.

regex_filter: typing.Optional[str] — Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.

use_blob_urls: typing.Optional[bool] — Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

path: typing.Optional[str] — Storage prefix (optional)

host: typing.Optional[str] — Server Host IP (optional)

port: typing.Optional[str] — Server Port (optional)

password: typing.Optional[str] — Server Password (optional)

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.redis.sync(...)

📝 Description

Sync tasks from a Redis import storage connection. You will need to provide the import storage ID. You can find this using List import storages.

Sync operations with external databases only go one way. They either create tasks from objects in the database (source/import storage) or push annotations to the output database (export/target storage). Changing something on the database side doesn’t guarantee consistency in results.

Before proceeding, you should review How sync operations work - Source storage to ensure that your data remains secure and private.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.redis.sync(
    id=1,
)

⚙️ Parameters

id: int — Storage ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

ImportStorage S3

client.import_storage.s3.list(...)

📝 Description

You can connect your S3 bucket to Label Studio as a source storage or target storage. Use this API request to get a list of all Google import (source) storage connections for a specific project.

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.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.s3.list()

⚙️ Parameters

project: typing.Optional[int] — Project ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.s3.create(...)

📝 Description

Create a new source storage connection to a S3 bucket.

For information about the required fields and prerequisites, see Amazon S3 in the Label Studio documentation.

Ensure you configure CORS before adding cloud storage. This ensures you will be able to see the content of the data rather than just a link.

After you add the storage, you should validate the connection before attempting to sync your data. Your data will not be imported until you sync your connection.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.s3.create()

⚙️ Parameters

regex_filter: typing.Optional[str] — Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.

use_blob_urls: typing.Optional[bool] — Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.

presign: typing.Optional[bool] — Presign URLs for download

presign_ttl: typing.Optional[int] — Presign TTL in minutes

recursive_scan: typing.Optional[bool] — Scan recursively

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

bucket: typing.Optional[str] — S3 bucket name

prefix: typing.Optional[str] — S3 bucket prefix

aws_access_key_id: typing.Optional[str] — AWS_ACCESS_KEY_ID

aws_secret_access_key: typing.Optional[str] — AWS_SECRET_ACCESS_KEY

aws_session_token: typing.Optional[str] — AWS_SESSION_TOKEN

aws_sse_kms_key_id: typing.Optional[str] — AWS SSE KMS Key ID

region_name: typing.Optional[str] — AWS Region

s3endpoint: typing.Optional[str] — S3 Endpoint

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.s3.validate(...)

📝 Description

Validate a specific S3 import storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to import data.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.s3.validate()

⚙️ Parameters

id: typing.Optional[int] — Storage ID. If set, storage with specified ID will be updated

regex_filter: typing.Optional[str] — Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.

use_blob_urls: typing.Optional[bool] — Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.

presign: typing.Optional[bool] — Presign URLs for download

presign_ttl: typing.Optional[int] — Presign TTL in minutes

recursive_scan: typing.Optional[bool] — Scan recursively

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

bucket: typing.Optional[str] — S3 bucket name

prefix: typing.Optional[str] — S3 bucket prefix

aws_access_key_id: typing.Optional[str] — AWS_ACCESS_KEY_ID

aws_secret_access_key: typing.Optional[str] — AWS_SECRET_ACCESS_KEY

aws_session_token: typing.Optional[str] — AWS_SESSION_TOKEN

aws_sse_kms_key_id: typing.Optional[str] — AWS SSE KMS Key ID

region_name: typing.Optional[str] — AWS Region

s3endpoint: typing.Optional[str] — S3 Endpoint

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.s3.get(...)

📝 Description

Get a specific S3 import storage connection. You will need to provide the import storage ID. You can find this using List import storages.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.s3.get(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this s3 import storage.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.s3.delete(...)

📝 Description

Delete a specific S3 import storage connection. You will need to provide the import storage ID. You can find this using List import storages.

Deleting a source storage connection does not affect tasks with synced data in Label Studio. The sync process is designed to import new or updated tasks from the connected storage into the project, but it does not track deletions of files from the storage. Therefore, if you remove the external storage connection, the tasks that were created from that storage will remain in the project.

If you want to remove the tasks that were synced from the external storage, you will need to delete them manually from within the Label Studio UI or use the Delete tasks API.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.s3.delete(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this s3 import storage.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.s3.update(...)

📝 Description

Update a specific S3 import storage connection. You will need to provide the import storage ID. You can find this using List import storages.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.s3.update(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this s3 import storage.

regex_filter: typing.Optional[str] — Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.

use_blob_urls: typing.Optional[bool] — Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.

presign: typing.Optional[bool] — Presign URLs for download

presign_ttl: typing.Optional[int] — Presign TTL in minutes

recursive_scan: typing.Optional[bool] — Scan recursively

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

bucket: typing.Optional[str] — S3 bucket name

prefix: typing.Optional[str] — S3 bucket prefix

aws_access_key_id: typing.Optional[str] — AWS_ACCESS_KEY_ID

aws_secret_access_key: typing.Optional[str] — AWS_SECRET_ACCESS_KEY

aws_session_token: typing.Optional[str] — AWS_SESSION_TOKEN

aws_sse_kms_key_id: typing.Optional[str] — AWS SSE KMS Key ID

region_name: typing.Optional[str] — AWS Region

s3endpoint: typing.Optional[str] — S3 Endpoint

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.s3.sync(...)

📝 Description

Sync tasks from an S3 import storage connection. You will need to provide the import storage ID. You can find this using List import storages.

Sync operations with external buckets only go one way. They either create tasks from objects in the bucket (source/import storage) or push annotations to the output bucket (export/target storage). Changing something on the bucket side doesn’t guarantee consistency in results.

Before proceeding, you should review How sync operations work - Source storage to ensure that your data remains secure and private.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.s3.sync(
    id=1,
)

⚙️ Parameters

id: int — Storage ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

ImportStorage S3S

client.import_storage.s3s.list(...)

📝 Description

You can connect your S3 bucket to Label Studio as a source storage or target storage. Use this API request to get a list of all Google import (source) storage connections for a specific project.

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.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.s3s.list()

⚙️ Parameters

project: typing.Optional[int] — Project ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.s3s.create(...)

📝 Description

Create a new source storage connection to a S3 bucket.

For information about the required fields and prerequisites, see Amazon S3 in the Label Studio documentation.

Ensure you configure CORS before adding cloud storage. This ensures you will be able to see the content of the data rather than just a link.

After you add the storage, you should validate the connection before attempting to sync your data. Your data will not be imported until you sync your connection.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.s3s.create()

⚙️ Parameters

regex_filter: typing.Optional[str] — Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.

use_blob_urls: typing.Optional[bool] — Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.

presign: typing.Optional[bool] — Presign URLs for download

presign_ttl: typing.Optional[int] — Presign TTL in minutes

recursive_scan: typing.Optional[bool] — Scan recursively

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

bucket: typing.Optional[str] — S3 bucket name

prefix: typing.Optional[str] — S3 bucket prefix

external_id: typing.Optional[str] — AWS External ID

role_arn: typing.Optional[str] — AWS Role ARN

region_name: typing.Optional[str] — AWS Region

s3endpoint: typing.Optional[str] — S3 Endpoint

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.s3s.get(...)

📝 Description

Get a specific S3 import storage connection. You will need to provide the import storage ID. You can find this using List import storages.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.s3s.get(
    id=1,
)

⚙️ Parameters

id: int — Import storage ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.s3s.delete(...)

📝 Description

Delete a specific S3 import storage connection. You will need to provide the import storage ID. You can find this using List import storages.

Deleting a source storage connection does not affect tasks with synced data in Label Studio. The sync process is designed to import new or updated tasks from the connected storage into the project, but it does not track deletions of files from the storage. Therefore, if you remove the external storage connection, the tasks that were created from that storage will remain in the project.

If you want to remove the tasks that were synced from the external storage, you will need to delete them manually from within the Label Studio UI or use the Delete tasks API.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.s3s.delete(
    id=1,
)

⚙️ Parameters

id: int — Import storage ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.s3s.update(...)

📝 Description

Update a specific S3 import storage connection. You will need to provide the import storage ID. You can find this using List import storages.

For more information about working with external storage, see Sync data from external storage.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.s3s.update(
    id=1,
)

⚙️ Parameters

id: int — Import storage ID

regex_filter: typing.Optional[str] — Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.

use_blob_urls: typing.Optional[bool] — Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.

presign: typing.Optional[bool] — Presign URLs for download

presign_ttl: typing.Optional[int] — Presign TTL in minutes

recursive_scan: typing.Optional[bool] — Scan recursively

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

bucket: typing.Optional[str] — S3 bucket name

prefix: typing.Optional[str] — S3 bucket prefix

external_id: typing.Optional[str] — AWS External ID

role_arn: typing.Optional[str] — AWS Role ARN

region_name: typing.Optional[str] — AWS Region

s3endpoint: typing.Optional[str] — S3 Endpoint

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.s3s.validate(...)

📝 Description

Validate a specific S3 import storage connection. This is useful to ensure that the storage configuration settings are correct and operational before attempting to import data.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.s3s.validate()

⚙️ Parameters

regex_filter: typing.Optional[str] — Cloud storage regex for filtering objects. You must specify it otherwise no objects will be imported.

use_blob_urls: typing.Optional[bool] — Interpret objects as BLOBs and generate URLs. For example, if your bucket contains images, you can use this option to generate URLs for these images. If set to False, it will read the content of the file and load it into Label Studio.

presign: typing.Optional[bool] — Presign URLs for download

presign_ttl: typing.Optional[int] — Presign TTL in minutes

recursive_scan: typing.Optional[bool] — Scan recursively

title: typing.Optional[str] — Storage title

description: typing.Optional[str] — Storage description

project: typing.Optional[int] — Project ID

bucket: typing.Optional[str] — S3 bucket name

prefix: typing.Optional[str] — S3 bucket prefix

external_id: typing.Optional[str] — AWS External ID

role_arn: typing.Optional[str] — AWS Role ARN

region_name: typing.Optional[str] — AWS Region

s3endpoint: typing.Optional[str] — S3 Endpoint

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.import_storage.s3s.sync(...)

📝 Description

Sync tasks from an S3 import storage connection. You will need to provide the import storage ID. You can find this using List import storages.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.import_storage.s3s.sync(
    id=1,
)

⚙️ Parameters

id: int — Storage ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Projects Pauses

client.projects.pauses.list(...)

📝 Description

Return a list of pause objects for the specified project and user.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.projects.pauses.list(
    project_pk=1,
    user_pk=1,
)

⚙️ Parameters

project_pk: int — Project ID

user_pk: int — User ID

include_deleted: typing.Optional[bool] — Include deleted pauses

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.projects.pauses.create(...)

📝 Description

Create a new pause object for the specified project and user.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.projects.pauses.create(
    project_pk=1,
    user_pk=1,
    reason="reason",
)

⚙️ Parameters

project_pk: int — Project ID

user_pk: int — User ID

reason: str

verbose_reason: typing.Optional[str]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.projects.pauses.get(...)

📝 Description

Return detailed information about a specific pause.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.projects.pauses.get(
    project_pk=1,
    user_pk=1,
    id=1,
)

⚙️ Parameters

project_pk: int — Project ID

user_pk: int — User ID

id: int — Pause ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.projects.pauses.delete(...)

📝 Description

Remove a pause from the database.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.projects.pauses.delete(
    project_pk=1,
    user_pk=1,
    id=1,
)

⚙️ Parameters

project_pk: int — Project ID

user_pk: int — User ID

id: int — Pause ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.projects.pauses.update(...)

📝 Description

Partially update one or more fields of an existing pause.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.projects.pauses.update(
    project_pk=1,
    user_pk=1,
    id=1,
    reason="reason",
)

⚙️ Parameters

project_pk: int — Project ID

user_pk: int — User ID

id: int — Pause ID

reason: str

verbose_reason: typing.Optional[str]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Projects Exports

client.projects.exports.list_formats(...)

📝 Description

Before exporting annotations, you can check with formats are supported by the specified project. For more information about export formats, see Export formats supported by Label Studio.

You must provide a project ID. 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.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.projects.exports.list_formats(
    id=1,
)

⚙️ Parameters

id: int — A unique integer value identifying this project.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.projects.exports.list(...)

📝 Description

Returns a list of export file (snapshots) for a specific project by ID. 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.

Included in the response is information about each snapshot, such as who created it and what format it is in.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.projects.exports.list(
    project_id=1,
)

⚙️ Parameters

project_id: int — A unique integer value identifying this project.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.projects.exports.create(...)

📝 Description

Create a new export request to start a background task and generate an export file (snapshot) for a specific project by ID. 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.

A snapshot is a static export of your project's data and annotations at a specific point in time. It captures the current state of your tasks, annotations, and other relevant data, allowing you to download and review them later. Snapshots are particularly useful for large projects as they help avoid timeouts during export operations by processing the data asynchronously.

For more information, see the Label Studio documentation on exporting annotations.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.projects.exports.create(
    project_id=1,
)

⚙️ Parameters

project_id: int — A unique integer value identifying this project.

title: typing.Optional[str]

id: typing.Optional[int]

created_by: typing.Optional[UserSimple]

created_at: typing.Optional[dt.datetime] — Creation time

finished_at: typing.Optional[dt.datetime] — Complete or fail time

status: typing.Optional[ExportSnapshotStatus]

md5: typing.Optional[str]

counters: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]

converted_formats: typing.Optional[typing.Sequence[ConvertedFormat]]

task_filter_options: typing.Optional[TaskFilterOptions]

annotation_filter_options: typing.Optional[AnnotationFilterOptions]

serialization_options: typing.Optional[SerializationOptions]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.projects.exports.get(...)

📝 Description

Retrieve information about a specific export file (snapshot).

You will need the export ID. You can find this in the response when you create the snapshot via the API or using List all export snapshots.

You will also need the project ID. This can be found in the URL when viewing the project in Label Studio, or you can retrieve all project IDs using List all projects.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.projects.exports.get(
    project_id=1,
    export_pk="export_pk",
)

⚙️ Parameters

project_id: int — A unique integer value identifying this project.

export_pk: str — Primary key identifying the export file.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.projects.exports.delete(...)

📝 Description

Delete an export file by specified export ID.

You will need the export ID. You can find this in the response when you create the snapshot via the API or using List all export snapshots.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.projects.exports.delete(
    project_id=1,
    export_pk="export_pk",
)

⚙️ Parameters

project_id: int — A unique integer value identifying this project.

export_pk: str — Primary key identifying the export file.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.projects.exports.convert(...)

📝 Description

You can use this to convert an export snapshot into the selected format.

To see what formats are supported, you can use Get export formats or see Export formats supported by Label Studio.

You will need to provide the project ID and export ID (export_pk). The export ID is returned when you create the export or you can use List all export snapshots.

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.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.projects.exports.convert(
    project_id=1,
    export_pk="export_pk",
)

⚙️ Parameters

project_id: int — A unique integer value identifying this project.

export_pk: str — Primary key identifying the export file.

export_type: typing.Optional[ExportFormat]

download_resources: typing.Optional[bool] — If true, download all resource files such as images, audio, and others relevant to the tasks.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Prompts Versions

client.prompts.versions.list(...)

📝 Description

Get a list of prompt versions.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.prompts.versions.list(
    id=1,
)

⚙️ Parameters

id: int — Prompt ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.prompts.versions.create(...)

📝 Description

Create a new version of a prompt.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.prompts.versions.create(
    id=1,
)

⚙️ Parameters

id: int — Prompt ID

title: typing.Optional[str]

parent_model: typing.Optional[int]

model_provider_connection: typing.Optional[int]

prompt: typing.Optional[str]

provider: typing.Optional[PromptVersionProvider]

provider_model_id: typing.Optional[str]

created_by: typing.Optional[PromptVersionCreatedBy]

created_at: typing.Optional[dt.datetime]

updated_at: typing.Optional[dt.datetime]

organization: typing.Optional[PromptVersionOrganization]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.prompts.versions.get(...)

📝 Description

Get a prompt version by ID.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.prompts.versions.get(
    id=1,
    version_id=1,
)

⚙️ Parameters

id: int — Prompt ID

version_id: int — Prompt Version ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.prompts.versions.delete(...)

📝 Description

Delete a prompt version by ID.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.prompts.versions.delete(
    id=1,
    version_id=1,
)

⚙️ Parameters

id: int — Prompt ID

version_id: int — Prompt Version ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.prompts.versions.update(...)

📝 Description

Update a prompt version by ID.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.prompts.versions.update(
    id=1,
    version_id=1,
)

⚙️ Parameters

id: int — Prompt ID

version_id: int — Prompt Version ID

title: typing.Optional[str]

parent_model: typing.Optional[int]

model_provider_connection: typing.Optional[int]

prompt: typing.Optional[str]

provider: typing.Optional[PromptVersionProvider]

provider_model_id: typing.Optional[str]

created_by: typing.Optional[PromptVersionCreatedBy]

created_at: typing.Optional[dt.datetime]

updated_at: typing.Optional[dt.datetime]

organization: typing.Optional[PromptVersionOrganization]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.prompts.versions.cost_estimate(...)

📝 Description

Get cost estimate for running a prompt version on a particular project/subset

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.prompts.versions.cost_estimate(
    prompt_id=1,
    version_id=1,
    project_id=1,
    project_subset=1,
)

⚙️ Parameters

prompt_id: int — Prompt ID

version_id: int — Prompt Version ID

project_id: int — ID of the project to get an estimate for running on

project_subset: int — Subset of the project to get an estimate for running on (e.g. 'All', 'Sample', or 'HasGT')

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.prompts.versions.get_refined_prompt(...)

📝 Description

Get the refined prompt based on the refinement_job_id.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.prompts.versions.get_refined_prompt(
    prompt_id=1,
    version_id=1,
    refinement_job_id="refinement_job_id",
)

⚙️ Parameters

prompt_id: int — Prompt ID

version_id: int — Prompt Version ID

refinement_job_id: str — Refinement Job ID acquired from the POST /api/prompts/{prompt_id}/versions/{version_id}/refine endpoint

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.prompts.versions.refine_prompt(...)

📝 Description

Refine a prompt version using a teacher model and save the refined prompt as a new version.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.prompts.versions.refine_prompt(
    prompt_id=1,
    version_id=1,
)

⚙️ Parameters

prompt_id: int — Prompt ID

version_id: int — Base Prompt Version ID

async_: typing.Optional[bool] — Run the refinement job asynchronously

teacher_model_provider_connection_id: typing.Optional[int] — Model Provider Connection ID to use to refine the prompt

teacher_model_name: typing.Optional[str] — Name of the model to use to refine the prompt

project_id: typing.Optional[int] — Project ID to target the refined prompt for

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Prompts Runs

client.prompts.runs.list(...)

📝 Description

Get information (status, etadata, etc) about an existing inference run

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.prompts.runs.list(
    id=1,
    version_id=1,
    project=1,
    project_subset="All",
)

⚙️ Parameters

id: int — Prompt ID

version_id: int — Prompt Version ID

project: int — The ID of the project that this Interence Run makes predictions on

project_subset: RunsListRequestProjectSubset — Defines which tasks are operated on (e.g. HasGT will only operate on tasks with a ground truth annotation, but All will operate on all records)

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.prompts.runs.create(...)

📝 Description

Run a prompt inference.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.prompts.runs.create(
    id=1,
    version_id=1,
    project=1,
    project_subset="All",
)

⚙️ Parameters

id: int — Prompt ID

version_id: int — Prompt Version ID

project: int

project_subset: InferenceRunProjectSubset

organization: typing.Optional[InferenceRunOrganization]

model_version: typing.Optional[int]

created_by: typing.Optional[InferenceRunCreatedBy]

status: typing.Optional[InferenceRunStatus]

job_id: typing.Optional[str]

created_at: typing.Optional[dt.datetime]

triggered_at: typing.Optional[dt.datetime]

predictions_updated_at: typing.Optional[dt.datetime]

completed_at: typing.Optional[dt.datetime]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Prompts Indicators

client.prompts.indicators.list(...)

📝 Description

Get key indicators for the Prompt dashboard.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.prompts.indicators.list(
    pk=1,
)

⚙️ Parameters

pk: int — Inference run ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.prompts.indicators.get(...)

📝 Description

Get a specific key indicator for the Prompt dashboard.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.prompts.indicators.get(
    indicator_key="indicator_key",
    pk=1,
)

⚙️ Parameters

indicator_key: str — Key of the indicator

pk: int — Inference run ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Workspaces Members

client.workspaces.members.list(...)

📝 Description

List all workspace memberships for a specific workspace. You will need to provide the workspace ID. You can find this using List workspaces.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.workspaces.members.list(
    id=1,
)

⚙️ Parameters

id: int — Workspace ID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.workspaces.members.create(...)

📝 Description

Create a new workspace membership. You will need to provide the workspace ID. You can find this using List workspaces.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.workspaces.members.create(
    id=1,
)

⚙️ Parameters

id: int — Workspace ID

user: typing.Optional[int] — User ID of the workspace member

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.workspaces.members.delete(...)

📝 Description

Delete a specific workspace membership. You will need to provide the workspace ID and the user ID. You can find this using List workspace memberships.

🔌 Usage

from label_studio_sdk import LabelStudio

client = LabelStudio(
    api_key="YOUR_API_KEY",
)
client.workspaces.members.delete(
    id=1,
)

⚙️ Parameters

id: int — Workspace ID

user: typing.Optional[int] — User ID of the workspace member

request_options: typing.Optional[RequestOptions] — Request-specific configuration.