API · Endpoints

Surfaces

A workspace holds one or more surfaces (tabs). Each surface is either a typed-row table or a TipTap rich-text doc. These endpoints add, list, reorder, and remove tabs.

Generated from src/lib/api-paths/surfaces.ts — what you see here matches what the runtime validates.

get/api/workspaces/{slug}/surfaces

List surfaces in a workspace

Returns every surface (tab) in the workspace, in tab order.

Auth: Bearer token (API key or OAuth access token).

Path parameters

NameTypeRequiredDescription
slugstringyes

Responses

StatusBodyDescription
200objectSurface list.
403ErrorCaller can't access this workspace.

post/api/workspaces/{slug}/surfaces

Add a surface (tab)

Append a new surface to the workspace. Editor role required.

Auth: Bearer token (API key or OAuth access token).

Path parameters

NameTypeRequiredDescription
slugstringyes

Request body

FieldTypeRequiredDescription
kind"table" | "doc"yesWhether this tab is a typed-row table or a TipTap rich-text doc.
namestringnoDisplay name. Auto-generated if omitted.
slugstringnoURL slug. Auto-derived from name if omitted.

Responses

StatusBodyDescription
200objectCreated.
403ErrorCaller lacks editor role.

delete/api/workspaces/{slug}/surfaces/{surfaceSlug}

Delete a surface

Remove a tab. The workspace must keep at least one surface; deleting the last one returns 400.

Auth: Bearer token (API key or OAuth access token).

Path parameters

NameTypeRequiredDescription
slugstringyes
surfaceSlugstringyes

Responses

StatusBodyDescription
200objectDeleted.
400ErrorWorkspace would have no surfaces left.

post/api/workspaces/{slug}/surfaces/{surfaceSlug}/move

Reorder a surface

Change a surface's tab position. Other tabs shift accordingly.

Auth: Bearer token (API key or OAuth access token).

Path parameters

NameTypeRequiredDescription
slugstringyes
surfaceSlugstringyes

Request body

FieldTypeRequiredDescription
positionintegeryesNew 0-indexed tab position. Other tabs shift to accommodate.

Responses

StatusBodyDescription
200objectMoved.