D
DreamLake

API Reference

Collections

A Collection is a named collection of node IDs (files from the node tree). Can belong to a Dataset or be standalone.

Collection "front-camera-clips"
  members: [nodeId1, nodeId2, nodeId3]   ← leaf nodes (video, audio, etc.)
  datasetId: "dataset-id"                ← optional parent

POST /namespaces/:slug/projects/:projectSlug/collections

Create a collection.

PropertyValue
AuthJWT
DB roundtrips3–4
#QueryCondition
1namespace.findUnique({ slug })Always
2space.findFirst({ nameprojectId, slug })Always
3dataset.findFirst({ id })If datasetId provided
4collection.create()Always

Body

FieldTypeRequiredDescription
namestringYesCollection name (unique within space)
descriptionstringNoDescription
tagsstring[]NoTags
metadataobjectNoMetadata
datasetIdstringNoParent dataset ID (null = standalone)
membersstring[]NoArray of node IDs

Response 201

{
  "id": "collection-id",
  "name": "front-camera-clips",
  "members": ["nodeId1", "nodeId2"],
  "datasetId": "dataset-id",
  "projectId": "space-id",
  "tags": [],
  "createdAt": "2026-04-15T..."
}

Errors

StatusCondition
400name missing
404Namespace /project / dataset not found
409Collection name already exists in this project

GET /namespaces/:slug/projects/:projectSlug/collections

List collections with pagination. Optionally filter by dataset.

PropertyValue
AuthJWT
DB roundtrips4 (3 effective)
#QueryConditionParallel
1namespace.findUnique({ slug })Always
2space.findFirst({ nameprojectId, slug })Always
3collection.findMany({ projectId })Always
4collection.count({ projectId })Always

Query

ParamTypeDefaultDescription
pagenumber1Page number (1-based)
pageSizenumber50Items per page (max 200)
datasetIdstringFilter by parent dataset

Response 200

{
  "collections": [
    { "id": "...", "name": "front-camera-clips", "members": ["nodeId1", "nodeId2"], "datasetId": "..." }
  ],
  "page": 1,
  "pageSize": 50,
  "total": 1,
  "totalPages": 1
}

GET /namespaces/:slug/projects/:projectSlug/collections/:name

Get a collection with its members.

PropertyValue
AuthJWT
DB roundtrips3

Response 200

{
  "id": "collection-id",
  "name": "front-camera-clips",
  "description": null,
  "tags": [],
  "members": ["nodeId1", "nodeId2", "nodeId3"],
  "datasetId": "dataset-id",
  "projectId": "space-id"
}

Errors

StatusCondition
404Collection not found

PATCH /namespaces/:slug/projects/:projectSlug/collections/:name

Update a collection. Can change name, description, tags, members (full replace), or move to a different dataset.

PropertyValue
AuthJWT
DB roundtrips4

Body (all optional)

FieldTypeDescription
namestringNew name
descriptionstringDescription
tagsstring[]Tags
metadataobjectMetadata
datasetIdstring | nullMove to dataset or set null for standalone
membersstring[]Full replace of members array

Response 200 — updated collection object.

Errors

StatusCondition
404Collection not found

DELETE /namespaces/:slug/projects/:projectSlug/collections/:name

Soft-delete a collection.

PropertyValue
AuthJWT
DB roundtrips4

Response 200{ "success": true }


POST /namespaces/:slug/projects/:projectSlug/collections/:name/members

Add node IDs to a collection. Merges with existing members and deduplicates.

PropertyValue
AuthJWT
DB roundtrips4

Body

FieldTypeRequiredDescription
addstring[]YesNode IDs to add

Response 200

{
  "members": ["nodeId1", "nodeId2", "nodeId3", "nodeId4"],
  "added": 2,
  "total": 4
}

Errors

StatusCondition
400add is empty or not an array
404Collection not found

DELETE /namespaces/:slug/projects/:projectSlug/collections/:name/members

Remove node IDs from a collection.

PropertyValue
AuthJWT
DB roundtrips4

Body

FieldTypeRequiredDescription
removestring[]YesNode IDs to remove

Response 200

{
  "members": ["nodeId1", "nodeId3"],
  "removed": 2,
  "total": 2
}

Errors

StatusCondition
400remove is empty or not an array
404Collection not found