Move assets to a folder
curl --request POST \
--url https://api.zerogen.com/v1/projects/{projectId}/folders/{folderId}/assets/move \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"assetIds": [
"3f6c2a1e-8b4d-4e2a-9c7f-1a2b3c4d5e6f"
],
"fromFolderId": "7c1d2e3f-4a5b-4c6d-8e9f-0a1b2c3d4e5f"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
assetIds: ['3f6c2a1e-8b4d-4e2a-9c7f-1a2b3c4d5e6f'],
fromFolderId: '7c1d2e3f-4a5b-4c6d-8e9f-0a1b2c3d4e5f'
})
};
fetch('https://api.zerogen.com/v1/projects/{projectId}/folders/{folderId}/assets/move', 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}/folders/{folderId}/assets/move"
payload = {
"assetIds": ["3f6c2a1e-8b4d-4e2a-9c7f-1a2b3c4d5e6f"],
"fromFolderId": "7c1d2e3f-4a5b-4c6d-8e9f-0a1b2c3d4e5f"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"folderId": "<string>",
"updatedAssetIds": [
"<string>"
],
"skippedAssetIds": [
"<string>"
]
}{
"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": {}
}
}Folders
Move assets to a folder
Moves up to 100 assets out of fromFolderId and into this folder; their other folders keep them. An asset that isn’t in fromFolderId is still added. The response lists the assets changed and those skipped.
Needs the library:organize scope.
POST
/
projects
/
{projectId}
/
folders
/
{folderId}
/
assets
/
move
Move assets to a folder
curl --request POST \
--url https://api.zerogen.com/v1/projects/{projectId}/folders/{folderId}/assets/move \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"assetIds": [
"3f6c2a1e-8b4d-4e2a-9c7f-1a2b3c4d5e6f"
],
"fromFolderId": "7c1d2e3f-4a5b-4c6d-8e9f-0a1b2c3d4e5f"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
assetIds: ['3f6c2a1e-8b4d-4e2a-9c7f-1a2b3c4d5e6f'],
fromFolderId: '7c1d2e3f-4a5b-4c6d-8e9f-0a1b2c3d4e5f'
})
};
fetch('https://api.zerogen.com/v1/projects/{projectId}/folders/{folderId}/assets/move', 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}/folders/{folderId}/assets/move"
payload = {
"assetIds": ["3f6c2a1e-8b4d-4e2a-9c7f-1a2b3c4d5e6f"],
"fromFolderId": "7c1d2e3f-4a5b-4c6d-8e9f-0a1b2c3d4e5f"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"folderId": "<string>",
"updatedAssetIds": [
"<string>"
],
"skippedAssetIds": [
"<string>"
]
}{
"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 100 assets
Required array length:
1 - 100 elementsPattern:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$The folder to take the assets out of; their other folders keep them
Pattern:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$