> Source: https://wexa.ai/docs/data-tables/edit-column

# edit-column

Change one column of a Data Table. Supply at least one property to change; only the properties you supply change. Needs the `fabric:table.write` grant.

**Edit a column**

**Wexa MCP server**

```bash
curl -sS -X POST https://fabric.wexa.ai/mcp/$FABRIC_PROJECT_ID \
  -H "authorization: Bearer $FABRIC_API_KEY" \
  -H "Mcp-Session-Id: $MCP_SESSION_ID" \
  -H "content-type: application/json" -H "accept: application/json" \
  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"edit-column","arguments":{"table_id":"6ab196817566f41b5c28e31f","column_id":"6ab1968193a7cbd766d5cd74","column_name":"notes_renamed"}}}'
```

```json
{
  "content": [
    {
      "type": "text",
      "text": "{\"lifecycle_id\":\"qlc_000204\",\"result\":{\"table_id\":\"6ab196817566f41b5c28e31f\",\"column\":{\"column_id\":\"6ab1968193a7cbd766d5cd74\",\"column_name\":\"notes_renamed\",\"column_type\":\"String\"},\"triggers_preserved\":0}}"
    }
  ],
  "isError": false
}
```

**REST API**

```bash
curl -sS https://fabric.wexa.ai/v1/edit-column \
  -H "authorization: Bearer $FABRIC_API_KEY" \
  -H "content-type: application/json" \
  -d '{"table_id":"6ab196817566f41b5c28e31f","column_id":"6ab1968193a7cbd766d5cd74","column_name":"notes_renamed"}'
```

```json
{
  "lifecycle_id": "qlc_000204",
  "result": {
    "table_id": "6ab196817566f41b5c28e31f",
    "column": {
      "column_id": "6ab1968193a7cbd766d5cd74",
      "column_name": "notes_renamed",
      "column_type": "String"
    },
    "triggers_preserved": 0
  }
}
```

**TypeScript SDK**

```ts
import { Fabric } from '@wexa-fabric/sdk'

const fabric = new Fabric()
const result = await fabric.editColumn({
  table_id: '6ab196817566f41b5c28e31f',
  column_id: '6ab1968193a7cbd766d5cd74',
  column_name: 'notes_renamed'
})
```

```ts
// result is the payload itself, with no `.result` to read
{
  table_id: '6ab196817566f41b5c28e31f',
  column: {
    column_id: '6ab1968193a7cbd766d5cd74',
    column_name: 'notes_renamed',
    column_type: 'String'
  },
  triggers_preserved: 0
}
```

**Python SDK**

```python
from wexa import Fabric

fabric = Fabric()
out = fabric.edit_column(
    table_id="6ab196817566f41b5c28e31f",
    column_id="6ab1968193a7cbd766d5cd74",
    column_name="notes_renamed",
)
```

```python
# out is the result, already unwrapped
{
    "table_id": "6ab196817566f41b5c28e31f",
    "column": {
        "column_id": "6ab1968193a7cbd766d5cd74",
        "column_name": "notes_renamed",
        "column_type": "String"
    },
    "triggers_preserved": 0
}
```

## Parameters

| Parameter | Type | Required | Notes |
| --- | --- | --- | --- |
| `table_id` | string | Required | Table id from `list-tables`, a 24-character hex id. A table in this project. |
| `column_id` | string | Required | Column id from `get-table`. A column on that table. |
| `column_name` | string | Optional | New name. |
| `column_type` | string | Optional | New type. |
| `array_type` | string | Optional | Item type, for an Array column. |
| `default_value` | any | Optional | Default value for the column. |
| `enum_options` | array | Optional | Allowed values, for an Enum column. |

**Errors**

- `ValidationError` (400 / 422): no property to change was supplied. Pass at least one of `column_name`, `column_type`, `array_type`, `default_value` or `enum_options`.

**Show full response**

A real response, captured from a live call to `edit-column`:

**Result of edit-column**

**REST API**

```json
{
  "lifecycle_id": "qlc_000204",
  "result": {
    "column": {
      "array_type": null,
      "column_id": "6ab1968193a7cbd766d5cd74",
      "column_name": "notes_renamed",
      "column_type": "String",
      "default_value": null,
      "enum_options": null,
      "has_triggers": false,
      "object_fields": null
    },
    "table_id": "6ab196817566f41b5c28e31f",
    "triggers_preserved": 0
  }
}
```

**TypeScript SDK**

```ts
// the object you get back IS the result — there is no `.result` to read
{
  column: {
    array_type: null,
    column_id: '6ab1968193a7cbd766d5cd74',
    column_name: 'notes_renamed',
    column_type: 'String',
    default_value: null,
    enum_options: null,
    has_triggers: false,
    object_fields: null
  },
  table_id: '6ab196817566f41b5c28e31f',
  triggers_preserved: 0
}

// The TS SDK names these camelCase — lifecycleId, traceId — where Python uses
// lifecycle_id and trace_id. Both are non-enumerable: readable, but omitted by
// Object.keys() and JSON.stringify(). `result.lifecycleId` here is undefined.
result.lifecycleId // 'qlc_000204'
```

**Python SDK**

```python
# a dict subclass; `result` is already unwrapped
{
 "column": {
  "array_type": None,
  "column_id": "6ab1968193a7cbd766d5cd74",
  "column_name": "notes_renamed",
  "column_type": "String",
  "default_value": None,
  "enum_options": None,
  "has_triggers": False,
  "object_fields": None
 },
 "table_id": "6ab196817566f41b5c28e31f",
 "triggers_preserved": 0
}

out.lifecycle_id  # 'qlc_000204' — an attribute, not a key
```

**More details**

The column is read back first and its triggers are written with it, so editing a column never disables its automation. The result reports `triggers_preserved`.

`edit-column` changes a table but is not marked consequential: it is audited lightly and the project's write gate never holds it.

Every tool call works the same way: [How every tool call works](/docs/sdks-and-apis/how-every-tool-call-works).
