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
| Name | Type | Required | Description |
|---|---|---|---|
slug | string | yes |
Responses
| Status | Body | Description |
|---|---|---|
200 | object | Surface list. |
403 | Error | Caller 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
| Name | Type | Required | Description |
|---|---|---|---|
slug | string | yes |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
kind | "table" | "doc" | yes | Whether this tab is a typed-row table or a TipTap rich-text doc. |
name | string | no | Display name. Auto-generated if omitted. |
slug | string | no | URL slug. Auto-derived from name if omitted. |
Responses
| Status | Body | Description |
|---|---|---|
200 | object | Created. |
403 | Error | Caller 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
| Name | Type | Required | Description |
|---|---|---|---|
slug | string | yes | |
surfaceSlug | string | yes |
Responses
| Status | Body | Description |
|---|---|---|
200 | object | Deleted. |
400 | Error | Workspace 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
| Name | Type | Required | Description |
|---|---|---|---|
slug | string | yes | |
surfaceSlug | string | yes |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
position | integer | yes | New 0-indexed tab position. Other tabs shift to accommodate. |
Responses
| Status | Body | Description |
|---|---|---|
200 | object | Moved. |
Related
- Workspaces API — surfaces live inside workspaces.
- Rows API — write to a table surface.
- Doc API — write to a doc surface.