Directories
REST endpoints for directories. Bearer-auth required.
GET /api/directories
List directories with pagination.
Query parameters
limit(optional): Page size (1–100, default 100).after(optional): Keyset cursor — return the page after this row (next page).before(optional): Keyset cursor — return the page before this row (prev page).ids(optional): Comma-separated list of IDs. Narrows results to these IDs within the caller's accessible scope (does not bypass access checks).filter(optional): Nested filter expression (<Entity>Filter): AND/OR/NOT + per-field comparison operators + relation traversal. JSON-encoded on the query string.orderBy(optional): Multi-key sort (<Entity>OrderBy[]): array of{ field: direction }applied in order. Directions: asc/desc plus the four explicit nulls variants. JSON-encoded on the query string.workspace_id(optional): Filter directories to this workspace.parent_id(optional): Filter to direct children of this parent directory.include_deleted(optional): Soft-deleted directory visibility.false(default) — active rows only.true— active plus soft-deleted.only— soft-deleted only (trash view).is_root(optional): Shorthand: filter whereisRootequals this value.created_by(optional): Shorthand: filter wherecreatedByequals this value.
Response
JSON
{
"data": [
{
"id": "<...>",
"workspaceId": "<...>",
"parentId": "<...>",
"name": "<...>",
"slug": "<...>",
"slugPath": "<...>",
"isRoot": "<...>",
"createdBy": "<...>",
"createdAt": "<...>",
"updatedAt": "<...>"
}
],
"pageInfo": {
"total": "number",
"hasNextPage": "boolean",
"hasPreviousPage": "boolean",
"startCursor": "string",
"endCursor": "string"
}
}POST /api/directories
Create directory
Request body
JSON
{
"workspaceId": "string",
"parentId?": "string",
"name": "string",
"slug?": "string"
}Response
JSON
{
"id": "string",
"workspaceId": "string",
"parentId": "string",
"name": "string",
"slug": "string",
"slugPath": "string",
"isRoot": "boolean",
"createdBy": "string",
"createdAt": "string",
"updatedAt": "string"
}GET /api/directories/{id}
Get a single directory by ID.
Path parameters
id(required): Directory to retrieve.
Response
JSON
{
"id": "string",
"workspaceId": "string",
"parentId": "string",
"name": "string",
"slug": "string",
"slugPath": "string",
"isRoot": "boolean",
"createdBy": "string",
"createdAt": "string",
"updatedAt": "string"
}PATCH /api/directories/{id}
Rename or move directory
Path parameters
id(required): The directory's prefixed ID (e.g.dir_...).
Request body
JSON
{
"name?": "string",
"parentId?": "string"
}Response
JSON
{
"id": "string",
"workspaceId": "string",
"parentId": "string",
"name": "string",
"slug": "string",
"slugPath": "string",
"isRoot": "boolean",
"createdBy": "string",
"createdAt": "string",
"updatedAt": "string"
}DELETE /api/directories/{id}
Delete directory
Soft-delete a directory. The row stays with deletedAt set and is hidden from list/get; restore via POST /api/directories/{id}/restore before retention expires. Cannot delete the workspace root directory.
Path parameters
id(required): The directory's prefixed ID (e.g.dir_...).
Response
JSON
{
"success": "boolean"
}DELETE /api/directories/{id}/purge
Permanently delete a soft-deleted directory.
Path parameters
id(required): Soft-deleted directory to permanently delete.
Response
JSON
{
"success": "boolean"
}POST /api/directories/{id}/restore
Restore a soft-deleted directory.
Path parameters
id(required): Soft-deleted directory to restore.
Response
JSON
{
"id": "string",
"workspaceId": "string",
"parentId": "string",
"name": "string",
"slug": "string",
"slugPath": "string",
"isRoot": "boolean",
"createdBy": "string",
"createdAt": "string",
"updatedAt": "string"
}