API reference Collections
Create a collection
Creates a collection in the key's workspace, optionally filled with assets, and fires the collection.created webhook.
POST
/api/v1/public/collectionsScope: write. The key's creator needs permission to manage collections.
Asset ids that are not in this workspace's Library (other workspaces, deleted, or staged) are skipped, not rejected, and counted in skipped.
Body parameters
namestringbodyrequiredCollection name, 1 to 120 characters.
descriptionstringbodyUp to 500 characters.
asset_idsarraybodydefault []Asset UUIDs to add, up to 200.
Response
Status 201 Created.
collection.idstringThe new collection's UUID.
collection.namestringName.
collection.urlstringApp path of the collection.
addedintegerAssets added.
skippedintegerDistinct ids that were not added because they are not in this workspace's Library. A repeated id counts once.
summarystringA one-line Markdown summary, the same text Pip shows.
Example request
curl -X POST https://api.pipory.com/api/v1/public/collections \
-H "Authorization: Bearer pip_your_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Q4 winners",
"description": "Top spenders for the holiday push",
"asset_ids": ["8f2c4a1e-6b3d-4c9f-a2e1-7d5b3c1a9e8f"]
}'
Example response
{
"collection": {
"id": "5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9",
"name": "Q4 winners",
"url": "/collections/5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9"
},
"added": 1,
"skipped": 0,
"summary": "Created **[Q4 winners](/collections/5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9)** with 1 asset."
}
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 |
422 | none | name missing or too long, or an id is not a UUID |
429 | rate_limited | Over the key's rate limit |