API reference Collections
Add assets to a collection
Adds Library assets to an existing collection; ids already in it or not in this workspace are skipped.
POST
/api/v1/public/collections/{collection_id}/assetsScope: write. The key's creator needs permission to manage collections.
Path parameters
collection_idstringpathrequiredThe collection's UUID.
Body parameters
asset_idsarraybodyrequiredAsset UUIDs to add, 1 to 200.
Response
collection.idstringCollection UUID.
collection.namestringName.
collection.urlstringApp path of the collection.
addedintegerAssets added.
skippedintegerDistinct ids not added: already in the collection, or not in this workspace's Library.
summarystringA one-line Markdown summary.
Example request
curl -X POST https://api.pipory.com/api/v1/public/collections/5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9/assets \
-H "Authorization: Bearer pip_your_key" \
-H "Content-Type: application/json" \
-d '{"asset_ids": ["8f2c4a1e-6b3d-4c9f-a2e1-7d5b3c1a9e8f", "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d"]}'
Example response
{
"collection": {
"id": "5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9",
"name": "Q4 winners",
"url": "/collections/5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9"
},
"added": 1,
"skipped": 1,
"summary": "Added 1 asset to **[Q4 winners](/collections/5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9)**. 1 were already there or not found."
}
Errors
| Status | Code | Meaning |
|---|---|---|
401 | invalid_api_key | Missing, unknown, revoked or expired key |
403 | insufficient_scope | The key has no write scope, or its creator cannot manage collections |
403 | upgrade_required | The workspace is not on a paid plan |
404 | none | No collection with that id in this workspace |
422 | none | asset_ids empty, over 200, or not UUIDs |
429 | rate_limited | Over the key's rate limit |