컬렉션
자산을 컬렉션으로 묶습니다 — 본인이 소유한 폴더이며, 선택적으로 다른 컬렉션 안에 중첩할 수 있습니다.
엔드포인트
| 메서드 | 경로 | |
|---|---|---|
| POST | /v1/collections | 생성 |
| GET | /v1/collections | 컬렉션 목록 |
| GET | /v1/collections/{id}/assets | 컬렉션 내 자산 목록 |
| POST | /v1/collections/{id}/assets | 자산 추가 |
| POST | /v1/collections/{id}/assets/remove | 자산 제거 |
| PATCH | /v1/collections/{id} | 이름 변경 |
| DELETE | /v1/collections/{id} | 삭제 |
컬렉션 생성
POST/v1/collections
| 파라미터 | 설명 |
|---|---|
| name필수 string | 컬렉션 이름, 1–255자. |
| parentId선택 string | 이 컬렉션을 중첩할 상위 컬렉션의 id. 생략하면 최상위 컬렉션이 됩니다. |
요청
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" }) });응답 · 200
{ "success": true, "data": { "id": "019…", "name": "Hero Props", "parentId": null } }컬렉션 목록
GET/v1/collections
data에 여러분의 컬렉션 목록을 반환합니다.
요청
curl https://api.picoberry.ai/v1/collections \
-H "Authorization: Bearer pb_live_xxx"컬렉션 내 자산 목록
GET/v1/collections/{id}/assets
| 파라미터 | 설명 |
|---|---|
| page선택기본 1 integer | 1부터 시작하는 페이지 번호. |
| limit선택기본 20 integer | 페이지 크기, 최대 100. |
data는 자산 배열이며, 각 항목은 GET /v1/assets/{id}와 같은 형태입니다.
자산 추가
POST/v1/collections/{id}/assets
| 파라미터 | 설명 |
|---|---|
| assetIds필수 string[] | 추가할 자산 id — 호출당 1~200개. |
요청
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…"] }) });응답 · 200
{ "success": true, "data": { "id": "019…" } }자산 제거
POST/v1/collections/{id}/assets/remove
본문 { assetIds } — 문자열 배열. 해당 자산을 컬렉션에서 제거하며, 자산 자체는 삭제되지 않습니다.
요청
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…"]}'이름 변경
PATCH/v1/collections/{id}
본문 { name } — 새 이름, 1–255자.
요청
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/v1/collections/{id}
컬렉션을 삭제합니다. 안에 있던 자산은 삭제되지 않으며 라이브러리에 그대로 남습니다.
요청
curl -X DELETE https://api.picoberry.ai/v1/collections/019… \
-H "Authorization: Bearer pb_live_xxx"모든 것은 여러분의 키 범위로 한정됩니다 여러분의 API 키가 소유한 컬렉션과 자산만 조회·수정할 수 있으며, 그 외에는
404를 반환합니다. 에러를 참고하세요.