Collections
Group assets into collections — folders you own, optionally nested one inside another.
Endpoints
| Method | Path | |
|---|---|---|
| POST | /v1/collections | Create |
| GET | /v1/collections | List collections |
| GET | /v1/collections/{id}/assets | List assets in one |
| POST | /v1/collections/{id}/assets | Add assets |
| POST | /v1/collections/{id}/assets/remove | Remove assets |
| PATCH | /v1/collections/{id} | Rename |
| DELETE | /v1/collections/{id} | Delete |
Create a collection
POST/v1/collections
| Parameter | Description |
|---|---|
| nameREQUIRED string | Collection name, 1–255 characters. |
| parentIdOPTIONAL string | Id of another collection to nest this one under. Omit for a top-level collection. |
request
curl -X POST https://api.picoberry.ai/v1/collections \
-H "Authorization: Bearer pb_live_xxx" -H "Content-Type: application/json" \
-d '{"name":"Hero Props"}'requests.post(f"{BASE}/v1/collections", headers=headers,
json={"name": "Hero Props"})await fetch(`${BASE}/v1/collections`, { method: "POST",
headers: { ...headers, "Content-Type": "application/json" },
body: JSON.stringify({ name: "Hero Props" }) });response · 200
{ "success": true, "data": { "id": "019…", "name": "Hero Props", "parentId": null } }List collections
GET/v1/collections
Returns your collections in data.
request
curl https://api.picoberry.ai/v1/collections \
-H "Authorization: Bearer pb_live_xxx"List assets in a collection
GET/v1/collections/{id}/assets
| Parameter | Description |
|---|---|
| pageOPTIONALdefault 1 integer | 1-based page number. |
| limitOPTIONALdefault 20 integer | Page size, up to 100. |
data is an array of assets, each the same shape as GET /v1/assets/{id}.
Add assets
POST/v1/collections/{id}/assets
| Parameter | Description |
|---|---|
| assetIdsREQUIRED string[] | Asset ids to add — 1 to 200 per call. |
request
curl -X POST https://api.picoberry.ai/v1/collections/019…/assets \
-H "Authorization: Bearer pb_live_xxx" -H "Content-Type: application/json" \
-d '{"assetIds":["019a…","019b…"]}'requests.post(f"{BASE}/v1/collections/{id}/assets", headers=headers,
json={"assetIds": ["019a…", "019b…"]})await fetch(`${BASE}/v1/collections/${id}/assets`, { method: "POST",
headers: { ...headers, "Content-Type": "application/json" },
body: JSON.stringify({ assetIds: ["019a…", "019b…"] }) });response · 200
{ "success": true, "data": { "id": "019…" } }Remove assets
POST/v1/collections/{id}/assets/remove
Body { assetIds } — a string array. Removes those assets from the collection; the assets themselves are not deleted.
request
curl -X POST https://api.picoberry.ai/v1/collections/019…/assets/remove \
-H "Authorization: Bearer pb_live_xxx" -H "Content-Type: application/json" \
-d '{"assetIds":["019a…"]}'Rename
PATCH/v1/collections/{id}
Body { name } — the new name, 1–255 characters.
request
curl -X PATCH https://api.picoberry.ai/v1/collections/019… \
-H "Authorization: Bearer pb_live_xxx" -H "Content-Type: application/json" \
-d '{"name":"Boss Props"}'Delete
DELETE/v1/collections/{id}
Deletes the collection. Assets that were in it are not deleted — they stay in your library.
request
curl -X DELETE https://api.picoberry.ai/v1/collections/019… \
-H "Authorization: Bearer pb_live_xxx"Everything is scoped to your key You can only see and modify collections and assets your API key owns; anything else returns
404. See Errors.