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.
| Property | Value |
|---|---|
| Auth | JWT |
| DB roundtrips | 5 (3 effective latency) |
| # | Query | Condition | Parallel |
|---|---|---|---|
| 1 | namespace.findUnique({ slug }) | Always | — |
| 2 | space.findMany({ nameprojectId }) → IDs only | Always | — |
| 3 | video.count({ projectId: { in: ids } }) | Always | ✓ |
| 4 | audio.count({ projectId: { in: ids } }) | Always | ✓ |
| 5 | labelTrack.count({ projectId: { in: ids } }) | Always | ✓ |
| 6 | textTrack.count({ projectId: { in: ids } }) | Always | ✓ |
Queries 3–6 run in parallel via
Promise.all.
Params
| Param | Type | Description |
|---|---|---|
slug | string | Namespace 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
| Status | Condition |
|---|---|
| 404 | Nameproject not found or deleted |
PATCH /namespaces/:slug
Update a namespace. Only the namespace owner can update.
| Property | Value |
|---|---|
| Auth | JWT |
| DB roundtrips | 2 |
| # | Query | Condition |
|---|---|---|
| 1 | namespace.findUnique({ slug }) | Always |
| 2 | namespace.update({ id }) | Always |
Params
| Param | Type | Description |
|---|---|---|
slug | string | Current namespace slug |
Body (all fields optional)
| Field | Type | Description |
|---|---|---|
slug | string | New namespace slug |
metadata | object | Arbitrary metadata |
Response 200
{
"id": "namespace-id",
"slug": "new-slug",
"metadata": { "description": "Alice's workspace" }
}Errors
| Status | Condition |
|---|---|
| 403 | Caller is not the namespace owner |
| 404 | Nameproject not found or deleted |