Directory
Directory — hierarchical organization for files within a workspace. Every workspace has a synthetic root directory created on workspace.created; user-created directories descend from it. Both a display `name` and a URL-safe `slug`. Sibling slugs are unique per parent.
Definition
TypeScript
interface Directory {
id: string;
workspaceId: string;
parentId: string | null;
name: string;
slug: string;
slugPath: string;
isRoot: boolean;
createdBy: string | null;
createdAt: string;
updatedAt: string;
}Fields
| Field | Type | Notes |
|---|---|---|
id | string | readonly required |
workspaceId | string | required — Workspace that owns this directory. |
parentId | string | null | required — Parent directory; null for the workspace root directory. |
name | string | required — Display name shown in the UI. |
slug | string | required — URL-safe identifier, unique among siblings sharing the same parent. |
slugPath | string | required — Denormalized slug-based path from workspace root, e.g. '/photos/trips/'. Always ends with '/'. |
isRoot | boolean | required — True for the synthetic workspace root directory. |
createdBy | string | null | required — User who created the directory; null for the workspace root. |
createdAt | string | readonly required — ISO-8601 timestamp of creation. |
updatedAt | string | readonly required — ISO-8601 timestamp of the last update. |