Remove a label from assets
curl --request POST \
--url https://api.zerogen.com/v1/projects/{projectId}/labels/{labelId}/assets/remove \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"assetIds": [
"3f6c2a1e-8b4d-4e2a-9c7f-1a2b3c4d5e6f"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({assetIds: ['3f6c2a1e-8b4d-4e2a-9c7f-1a2b3c4d5e6f']})
};
fetch('https://api.zerogen.com/v1/projects/{projectId}/labels/{labelId}/assets/remove', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.zerogen.com/v1/projects/{projectId}/labels/{labelId}/assets/remove"
payload = { "assetIds": ["3f6c2a1e-8b4d-4e2a-9c7f-1a2b3c4d5e6f"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"labelId": "<string>",
"projectId": "<string>",
"assetIds": [
"<string>"
],
"assigned": true
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}Labels
Remove a label from assets
Removes an organization label from up to 50 assets in the project, all or none. The label itself stays.
Needs the library:organize scope.
POST
/
projects
/
{projectId}
/
labels
/
{labelId}
/
assets
/
remove
Remove a label from assets
curl --request POST \
--url https://api.zerogen.com/v1/projects/{projectId}/labels/{labelId}/assets/remove \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"assetIds": [
"3f6c2a1e-8b4d-4e2a-9c7f-1a2b3c4d5e6f"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({assetIds: ['3f6c2a1e-8b4d-4e2a-9c7f-1a2b3c4d5e6f']})
};
fetch('https://api.zerogen.com/v1/projects/{projectId}/labels/{labelId}/assets/remove', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.zerogen.com/v1/projects/{projectId}/labels/{labelId}/assets/remove"
payload = { "assetIds": ["3f6c2a1e-8b4d-4e2a-9c7f-1a2b3c4d5e6f"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"labelId": "<string>",
"projectId": "<string>",
"assetIds": [
"<string>"
],
"assigned": true
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}Authorizations
A ZeroGen API key: zg_ for a live key, zg_test_ for a test key.
Headers
Makes retries safe: a retry with the same key and body returns the first response for 24 hours instead of repeating the work. Reusing a key with a different body returns 409.
Required string length:
1 - 255Pattern:
^[\x21-\x7e]+$Body
application/json
Up to 50 assets
Required array length:
1 - 50 elementsPattern:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$