D
DreamLake

API Reference

Episodes

An episode is a time-bounded recording unit within a project — e.g. a robot run, an experiment session.


POST /namespaces/:slug/projects/:projectSlug/episodes

Create or update an episode. If an episode with the same name already exists, it is updated (upsert).

PropertyValue
AuthJWT
DB roundtrips3–5
#QueryCondition
1namespace.findUnique({ slug })Always
2space.findFirst / space.createAlways (upsert)
3node.upsert (per folder segment)If folder provided
4episode.findFirst({ projectId, name })Always
5episode.create / episode.updateAlways

Params

ParamTypeDescription
slugstringNamespace slug
projectSlugstringProject slug

Body

FieldTypeRequiredDescription
namestringYesEpisode name (unique within space)
descriptionstringNoDescription
tagsstring[]NoTags
folderstringNoFolder path (e.g. /experiments/batch-1) — auto-created
writeProtectedbooleanNoLock episode for immutability
metadataobjectNoArbitrary metadata

Response 201 (created) / 200 (updated)

{
  "episode": {
    "id": "episode-id",
    "name": "run-042",
    "description": null,
    "tags": [],
    "projectId": "space-id",
    "folderId": null,
    "writeProtected": false,
    "status": "running",
    "metadata": null
  },
  "workspace": { "id": "space-id", "slug": "robotics" },
  "folder": null,
  "namespace": { "id": "namespace-id", "slug": "alice" }
}

Errors

StatusCondition
400name is missing
403Existing episode is write-protected
404Nameproject not found
410Episode was previously deleted

GET /namespaces/:slug/projects/:projectSlug/episodes

List episodes in a project with pagination.

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

Params

ParamTypeDescription
slugstringNamespace slug
projectSlugstringProject slug

Query

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

Response 200

{
  "episodes": [
    {
      "id": "episode-id",
      "name": "run-042",
      "description": null,
      "tags": [],
      "status": "running",
      "writeProtected": false,
      "folderId": null,
      "createdAt": "2026-04-14T...",
      "updatedAt": "2026-04-14T..."
    }
  ],
  "page": 1,
  "pageSize": 50,
  "total": 1,
  "totalPages": 1
}

Errors

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

PATCH /namespaces/:slug/projects/:projectSlug/episodes/:episodeName

Update an episode. Write-protected episodes cannot be updated.

PropertyValue
AuthJWT
DB roundtrips3–5
#QueryCondition
1namespace.findUnique({ slug })Always
2space.findFirst({ nameprojectId, slug })Always
3episode.findFirst({ projectId, name })Always
4node.upsert (per folder segment)If folder provided
5episode.update({ id })Always

Params

ParamTypeDescription
slugstringNamespace slug
projectSlugstringProject slug
episodeNamestringEpisode name

Body (all fields optional)

FieldTypeDescription
namestringNew episode name
descriptionstringDescription
tagsstring[]Tags
statusstringrunning, completed, failed, archived
writeProtectedbooleanLock episode
folderstringFolder path — auto-created
metadataobjectArbitrary metadata

Response 200

{
  "id": "episode-id",
  "name": "run-042",
  "description": "Updated description",
  "tags": ["batch-1"],
  "status": "completed",
  "writeProtected": true,
  "folderId": "folder-id",
  "metadata": null,
  "createdAt": "2026-04-14T...",
  "updatedAt": "2026-04-14T..."
}

Errors

StatusCondition
403Episode is write-protected
404Namespace /project / episode not found