update_surface
Rename, reslug, reorder, OR replace the column schema of a surface. Pass any subset of name, new_surface_slug, position, columns. Position is 0-based and is normalised across siblings so positions stay contiguous. Editor role required. Emits surface.updated.
Column schema (columns): table surfaces only. Pass a full ColumnDef[] to REPLACE the existing schema atomically (no per-column add/remove churn, no row data loss — existing row.data keys that are no longer mapped are preserved on disk and surface in future writes' unmapped_fields). Each ColumnDef = { key, label, type, position, width?, hidden?, description?, options? }. Type ∈ text | longtext | url | status | owner | date | number; options is required on status/owner. Reject 400 with a table-only error if the surface is a doc or html kind. Use get_workspace_schema first to fetch the current shape, mutate it, send it back.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | New display name. 1-64 chars. | |
| slug | Yes | The workspace slug. Accepts either the bare slug ('my-workspace') or the org-prefixed form ('my-org/my-workspace') as shown in the dashboard URL; both resolve to the same workspace. | |
| columns | No | Optional. Full replacement ColumnDef[] for the surface's table schema. Table surfaces only — doc/html surfaces 400 with a table-only error. Each item: `{ key, label, type, position, width?, hidden?, description?, options? }`. type ∈ text|longtext|url|status|owner|date|number. Existing row.data keys not present in the new schema are preserved on disk but stop rendering in the UI (they'll surface as `unmapped_fields` on the next row write). Use get_workspace_schema → mutate → send the full array back; this is a REPLACE, not a merge. | |
| position | No | 0-based index in the tab strip. Other surfaces shift to keep positions contiguous. | |
| surface_slug | Yes | The current slug of the surface to update. | |
| new_surface_slug | No | New slug for the surface (lowercase kebab-case, 3-64 chars). Must be unique within the workspace. |