update_surface
Rename, reslug, reorder, restore, OR replace the column schema of a surface. Pass any subset of name, new_surface_slug, position, columns, archived. Restore: pass archived: false with the archived surface's surface_slug (find it with list_surfaces archived: true) to unarchive it; its rows and doc body come back, it is placed last among the workspace's surfaces, and it emits surface.unarchived. Refused if another live surface now owns that slug. To archive, use delete_surface. 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 | number | status | person | date | url | checkbox | select; options lists the allowed values of a status/select column. 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|number|status|person|date|url|checkbox|select. 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. | |
| archived | No | Pass `false` to restore (unarchive) an archived surface. No-op on a live surface. Only `false` is accepted; archive with `delete_surface`. | |
| position | No | 0-based position among the workspace's surfaces. 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. |