---
title: "Rename, reslug, reorder, OR replace a surface's column schema"
method: PATCH
path: "/api/workspaces/{slug}/surfaces/{surfaceSlug}"
tags: ["Surfaces"]
---

# Rename, reslug, reorder, OR replace a surface's column schema

`PATCH /api/workspaces/{slug}/surfaces/{surfaceSlug}`

## Request

- Base URL: `https://trydock.ai`
- URL: `https://trydock.ai/api/workspaces/{slug}/surfaces/{surfaceSlug}`
- Auth: HTTP bearer

Rename, change the URL slug, move a surface within its workspace's tab strip, OR replace the column schema (table surfaces only). Pass any subset of `name`, `slug`, `position`, `columns`. Position uses 0-based indexing and other tabs shift to keep positions contiguous. Column replace fires `surface.columns_updated`; row.data keys not in the new schema are preserved on disk. Editor role required. Slug renames preserve old URLs via the surface alias table.

## Path parameters

- `slug` string, required
- `surfaceSlug` string, required

## Request body

- object
  - `name` string: New display name.
  - `slug` string: New URL slug. Lowercase kebab-case, 3-64 chars. Must be unique within the workspace; old slug stays redirectable via the surface alias table.
  - `position` integer: Optional reorder. Equivalent to POST /surfaces/{slug}/move when only repositioning.
  - `columns` object[]: Wholesale replacement of the table surface's column schema. Table surfaces only — doc/html surfaces 400 with a table-only error. Each ColumnDef: `{ key, label, type, position, width?, hidden?, description?, options? }`. `type` ∈ text | longtext | url | status | owner | date | number. `options` is required on status/owner. Existing row.data keys not in the new column set are preserved on disk (they just stop rendering until a column with that key is added back). Fires `surface.columns_updated`.
    - `key` string, required
    - `label` string, required
    - `type` 'text' | 'longtext' | 'number' | 'status' | 'person' | 'date' | 'url' | 'checkbox' | 'select', required
    - `position` integer, required
    - `width` integer
    - `hidden` boolean
    - `wrap` boolean
    - `description` string
    - `options` object[]
      - `value` string, required
      - `label` string, required
      - `color` string

## Response `200`

Updated.

- object
  - `surface` object, required
    - `id` string, required
    - `slug` string, required
    - `name` string, required
    - `kind` 'table' | 'doc', required: Whether this tab is a typed-row table or a TipTap rich-text doc.
    - `position` integer, required: Tab order within the workspace, 0-indexed.
    - `columns` object[], nullable: Column schema for table surfaces. `null` on doc/html surfaces.
      - `key` string, required
      - `label` string, required
      - `type` 'text' | 'longtext' | 'number' | 'status' | 'person' | 'date' | 'url' | 'checkbox' | 'select', required
      - `position` integer, required
      - `width` integer
      - `hidden` boolean
      - `wrap` boolean
      - `description` string
      - `options` object[]
        - `value` string, required
        - `label` string, required
        - `color` string

## Other responses

- `403`: Caller lacks editor role.
- `409`: Slug collides with another surface in the workspace.

## Changes

- **2026-11-05** `dd96ae96a412`: 2 info
  - added the new optional request property `columns/items/wrap`
  - added the optional property `surface/columns/items/wrap` to the response with the `200` status
- **2026-11-05** `767beae124a8`: 1 breaking, 1 info
  - the `surface/columns/items/description` response property's maxLength was increased from `280` to `4000` for the response status `200`
  - the `columns/items/description` request property's maxLength was increased from `280` to `4000`

[Operation history](https://skmtc.dev/trydock/apis/dock-rest-api/changes/api/workspaces/:slug/surfaces/:surfaceSlug/patch.md)

---

[API](https://skmtc.dev/trydock/apis/dock-rest-api.md) - [All operations](https://skmtc.dev/trydock/apis/dock-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/trydock/apis/dock-rest-api/revisions/dd96ae96a412?raw)
