cURL
curl --request POST \
--url http://studio.premai.io/api/v1/public/datasets/{datasetId}/create-labels \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label_definitions": [
{
"name": "<string>",
"description": "<string>"
}
]
}
'import requests
url = "http://studio.premai.io/api/v1/public/datasets/{datasetId}/create-labels"
payload = { "label_definitions": [
{
"name": "<string>",
"description": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({label_definitions: [{name: '<string>', description: '<string>'}]})
};
fetch('http://studio.premai.io/api/v1/public/datasets/{datasetId}/create-labels', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"message": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Datasets API
Create Labels
Create labels linked to the given dataset.
POST
/
api
/
v1
/
public
/
datasets
/
{datasetId}
/
create-labels
cURL
curl --request POST \
--url http://studio.premai.io/api/v1/public/datasets/{datasetId}/create-labels \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label_definitions": [
{
"name": "<string>",
"description": "<string>"
}
]
}
'import requests
url = "http://studio.premai.io/api/v1/public/datasets/{datasetId}/create-labels"
payload = { "label_definitions": [
{
"name": "<string>",
"description": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({label_definitions: [{name: '<string>', description: '<string>'}]})
};
fetch('http://studio.premai.io/api/v1/public/datasets/{datasetId}/create-labels', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"message": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Array of label definitions to use for auto-labeling
Required array length:
1 - 10 elementsShow child attributes
Show child attributes
Response
Labels created successfully
Was this page helpful?