You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/guide/api.md
+51-10Lines changed: 51 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,23 +11,15 @@ section: "Integrate & Extend"
11
11
12
12
---
13
13
14
+
<divclass="opensource-only">
15
+
14
16
You can use the Label Studio API to import data for labeling, export annotations, set up machine learning with Label Studio, and sync tasks with cloud storage.
15
17
16
18
See the [API reference documentation](https://api.labelstud.io/api-reference/introduction/getting-started) for further guidance and interactive examples. If you want to write Python scripts using the API, use the [Label Studio Python SDK](sdk.html).
17
19
18
20
!!! info Tip
19
21
For additional guidance on using our API, see [5 Tips and Tricks for Label Studio’s API and SDK](https://labelstud.io/blog/5-tips-and-tricks-for-label-studio-s-api-and-sdk/).
20
22
21
-
<divclass="enterprise-only">
22
-
23
-
<p>
24
-
The Label Studio Enterprise API shares many endpoints with the Label Studio Community Edition API, but includes extra payload options and additional endpoints specific to Enterprise features. Access the full Label Studio Enterprise API reference documentation by doing the following:</p>
25
-
<ol>
26
-
<li>Log in to Label Studio Enterprise</li>
27
-
<li>Open the menu and click <b>API</b></li>
28
-
</ol>
29
-
30
-
</div>
31
23
32
24
### Authenticate to the API
33
25
@@ -66,3 +58,52 @@ Retrieve a paginated list of tasks for a specific project. If you want, you can
66
58
To export annotations, first see [which formats are available to export for your project](https://api.labelstud.io/api-reference/api-reference/projects/exports/list-formats).
67
59
68
60
Choose your selected format from the response and then call the export endpoint. See the [export annotations](https://api.labelstud.io/api-reference/api-reference/tasks/list) endpoint documentation for more details.
61
+
62
+
</div>
63
+
64
+
<divclass="enterprise-only">
65
+
66
+
You can use the Label Studio API to import data for labeling, export annotations, set up machine learning with Label Studio, and sync tasks with cloud storage.
67
+
68
+
See the [API reference documentation](https://app.humansignal.com/docs/api) for further guidance and interactive examples. If you want to write Python scripts using the API, use the [Label Studio Python SDK](sdk.html).
69
+
70
+
!!! info Tip
71
+
For additional guidance on using our API, see [5 Tips and Tricks for Label Studio’s API and SDK](https://labelstud.io/blog/5-tips-and-tricks-for-label-studio-s-api-and-sdk/).
72
+
73
+
### Authenticate to the API
74
+
75
+
You must retrieve your access token so that you can authenticate to the API.
76
+
77
+
1. In the Label Studio UI, click the user icon in the upper right.
78
+
2. Click **Account & Settings**.
79
+
3. Copy the access token. For more information, see [Access tokens](access_tokens).
80
+
81
+
In your first API call, specify the access token in the headers:
82
+
```bash
83
+
curl -X <method><Label Studio URL>/api/<endpoint> -H 'Authorization: Bearer <token>'
84
+
```
85
+
86
+
### List all projects
87
+
88
+
To perform most tasks with the Label Studio API, you must specify the project ID, sometimes referred to as the `pk`, or primary key. If you don't know what your project ID is, you might want to get a list of all projects in Label Studio that you can access. See the [List your projects API endpoint documentation](https://app.humansignal.com/docs/api#tag/Projects/operation/api_projects_list).
89
+
90
+
### Create and set up a project
91
+
92
+
Create a project and set up the labeling interface in Label Studio using the API. See the [Create new project API endpoint documentation](https://app.humansignal.com/docs/api#tag/Projects/operation/api_projects_create).
93
+
94
+
If you want to make sure the configuration for your labeling interface is valid before submitting it using the API, you can use the [validate label config](https://app.humansignal.com/docs/api#tag/Projects/operation/api_projects_validate_create) API endpoint.
95
+
96
+
### Import tasks using the API
97
+
98
+
To import tasks using the API, make sure you know the project ID that you want to add tasks to. See additional examples and parameter descriptions in the [import data endpoint documentation](https://app.humansignal.com/docs/api#tag/Tasks/operation/api_tasks_create)
99
+
100
+
### Retrieve tasks
101
+
Retrieve a paginated list of tasks for a specific project. If you want, you can also retrieve tasks and annotations using this API endpoint, as an alternative to exporting annotations. See details and parameters in the [list project tasks endpoint documentation](https://app.humansignal.com/docs/api#tag/Tasks/operation/api_tasks_list).
102
+
103
+
### Export annotations
104
+
105
+
To export annotations, first see [which formats are available to export for your project](https://app.humansignal.com/docs/api#tag/Export/operation/api_projects_export_formats_read).
106
+
107
+
Choose your selected format from the response and then call the export endpoint. See the [export annotations](https://app.humansignal.com/docs/api#tag/Export/operation/api_projects_exports_create) endpoint documentation for more details.
0 commit comments