D
DreamLake

API Reference

Spaces

Aproject is a project or workspace within a namespace. Contains episodes, assets, and folder hierarchy.


GET /namespaces/:slug/spaces

List all spaces in a namespace with pagination.

PropertyValue
AuthJWT
DB roundtrips3 (2 effective latency)
#QueryConditionParallel
1namespace.findUnique({ slug })Always
2space.findMany({ nameprojectId })Always
3space.count({ nameprojectId })Always

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

Params

ParamTypeDescription
slugstringNamespace slug

Query

ParamTypeDefaultDescription
pagenumber1Page number (1-based)
pageSizenumber50Items per page (max 200)

Response 200

{
  "spaces": [
    {
      "id": "space-id",
      "name": "Robotics Lab",
      "slug": "robotics-lab",
      "description": "Main robotics project",
      "tags": ["robotics"]
    }
  ],
  "page": 1,
  "pageSize": 50,
  "total": 1,
  "totalPages": 1
}

Errors

StatusCondition
404Nameproject not found or deleted

POST /namespaces/:slug/spaces

Create a newproject in a namespace.

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

Params

ParamTypeDescription
slugstringNamespace slug

Body

FieldTypeRequiredDescription
namestringYesDisplay name
slugstringNoURL slug (auto-derived from name if omitted)
descriptionstringNoSpace description
tagsstring[]NoTags for categorization
metadataobjectNoArbitrary metadata

Response 201

{
  "id": "space-id",
  "name": "Robotics Lab",
  "slug": "robotics-lab",
  "description": "Main robotics project",
  "tags": ["robotics"],
  "metadata": null
}

Errors

StatusCondition
400name is missing
404Nameproject not found or deleted
409Project slug already exists in this namespace

PATCH /namespaces/:slug/projects/:projectSlug

Update a project. Only provided fields are updated.

PropertyValue
AuthJWT
DB roundtrips3
#QueryCondition
1namespace.findUnique({ slug })Always
2space.findFirst({ nameprojectId, slug })Always
3space.update({ id })Always

Params

ParamTypeDescription
slugstringNamespace slug
projectSlugstringCurrentproject slug

Body (all fields optional)

FieldTypeDescription
namestringDisplay name
slugstringNew URL slug
descriptionstringSpace description
tagsstring[]Tags
metadataobjectArbitrary metadata

Response 200

{
  "id": "space-id",
  "name": "Robotics Lab",
  "slug": "robotics-lab",
  "description": "Updated description",
  "tags": ["robotics", "production"],
  "metadata": { "team": "lab-a" }
}

Errors

StatusCondition
404Nameproject not found or deleted
404Space not found or deleted