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.
| Property | Value |
|---|---|
| Auth | JWT |
| DB roundtrips | 3 (2 effective latency) |
| # | Query | Condition | Parallel |
|---|---|---|---|
| 1 | namespace.findUnique({ slug }) | Always | — |
| 2 | space.findMany({ nameprojectId }) | Always | ✓ |
| 3 | space.count({ nameprojectId }) | Always | ✓ |
Queries 2–3 run in parallel via
Promise.all.
Params
| Param | Type | Description |
|---|---|---|
slug | string | Namespace slug |
Query
| Param | Type | Default | Description |
|---|---|---|---|
page | number | 1 | Page number (1-based) |
pageSize | number | 50 | Items 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
| Status | Condition |
|---|---|
| 404 | Nameproject not found or deleted |
POST /namespaces/:slug/spaces
Create a newproject in a namespace.
| Property | Value |
|---|---|
| Auth | JWT |
| DB roundtrips | 2 |
| # | Query | Condition |
|---|---|---|
| 1 | namespace.findUnique({ slug }) | Always |
| 2 | space.create() | Always |
Params
| Param | Type | Description |
|---|---|---|
slug | string | Namespace slug |
Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display name |
slug | string | No | URL slug (auto-derived from name if omitted) |
description | string | No | Space description |
tags | string[] | No | Tags for categorization |
metadata | object | No | Arbitrary metadata |
Response 201
{
"id": "space-id",
"name": "Robotics Lab",
"slug": "robotics-lab",
"description": "Main robotics project",
"tags": ["robotics"],
"metadata": null
}Errors
| Status | Condition |
|---|---|
| 400 | name is missing |
| 404 | Nameproject not found or deleted |
| 409 | Project slug already exists in this namespace |
PATCH /namespaces/:slug/projects/:projectSlug
Update a project. Only provided fields are updated.
| Property | Value |
|---|---|
| Auth | JWT |
| DB roundtrips | 3 |
| # | Query | Condition |
|---|---|---|
| 1 | namespace.findUnique({ slug }) | Always |
| 2 | space.findFirst({ nameprojectId, slug }) | Always |
| 3 | space.update({ id }) | Always |
Params
| Param | Type | Description |
|---|---|---|
slug | string | Namespace slug |
projectSlug | string | Currentproject slug |
Body (all fields optional)
| Field | Type | Description |
|---|---|---|
name | string | Display name |
slug | string | New URL slug |
description | string | Space description |
tags | string[] | Tags |
metadata | object | Arbitrary metadata |
Response 200
{
"id": "space-id",
"name": "Robotics Lab",
"slug": "robotics-lab",
"description": "Updated description",
"tags": ["robotics", "production"],
"metadata": { "team": "lab-a" }
}Errors
| Status | Condition |
|---|---|
| 404 | Nameproject not found or deleted |
| 404 | Space not found or deleted |