Skip to content
API reference Create collection
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/collections

Scope: 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

namestringbodyrequired
Collection name, 1 to 120 characters.
descriptionstringbody
Up to 500 characters.
asset_idsarraybodydefault []
Asset UUIDs to add, up to 200.

Response

Status 201 Created.

collection.idstring
The new collection's UUID.
collection.namestring
Name.
collection.urlstring
App path of the collection.
addedinteger
Assets added.
skippedinteger
Distinct ids that were not added because they are not in this workspace's Library. A repeated id counts once.
summarystring
A 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

StatusCodeMeaning
401invalid_api_keyMissing, unknown, revoked or expired key
403insufficient_scopeThe key has no write scope, or its creator cannot manage collections
403upgrade_requiredThe workspace is not on a paid plan
422nonename missing or too long, or an id is not a UUID
429rate_limitedOver the key's rate limit