D
DreamLake

API Reference

Namespaces

Namespace is the top-level owner scope (user or team). Maps to a URL slug like alice.


GET /namespaces/:slug

Get namespace overview with spaces count and asset counts by type.

PropertyValue
AuthJWT
DB roundtrips5 (3 effective latency)
#QueryConditionParallel
1namespace.findUnique({ slug })Always
2space.findMany({ nameprojectId }) → IDs onlyAlways
3video.count({ projectId: { in: ids } })Always
4audio.count({ projectId: { in: ids } })Always
5labelTrack.count({ projectId: { in: ids } })Always
6textTrack.count({ projectId: { in: ids } })Always

Queries 3–6 run in parallel via Promise.all.

Params

ParamTypeDescription
slugstringNamespace slug (e.g. alice)

Response 200

{
  "id": "namespace-id",
  "slug": "alice",
  "metadata": null,
  "spaces": 3,
  "assets": {
    "videos": 42,
    "audio": 15,
    "labelTracks": 8,
    "textTracks": 5
  }
}

Errors

StatusCondition
404Nameproject not found or deleted

PATCH /namespaces/:slug

Update a namespace. Only the namespace owner can update.

PropertyValue
AuthJWT
DB roundtrips2
#QueryCondition
1namespace.findUnique({ slug })Always
2namespace.update({ id })Always

Params

ParamTypeDescription
slugstringCurrent namespace slug

Body (all fields optional)

FieldTypeDescription
slugstringNew namespace slug
metadataobjectArbitrary metadata

Response 200

{
  "id": "namespace-id",
  "slug": "new-slug",
  "metadata": { "description": "Alice's workspace" }
}

Errors

StatusCondition
403Caller is not the namespace owner
404Nameproject not found or deleted