> Source: https://wexa.ai/docs/tools/update-table-row

# update-table-row

Change one row in a Data Table, addressed by its row_id (the row's _id as query-table-rows returns it). Only the keys present in 'row' are written.

## What it is called on each surface

The wire name is `update-table-row` everywhere: it is what the Wexa MCP server advertises, the REST path is
`POST /v1/update-table-row`, and each SDK exposes it under its own language's naming convention.

| Surface | Name |
| --- | --- |
| Wexa MCP server | `update-table-row` |
| REST API | `POST /v1/update-table-row` |
| TypeScript SDK | `fabric.updateTableRow()` |
| Python SDK | `fabric.update_table_row()` |

## Arguments

3 of the 3 arguments are required. Omitting a required one is refused before the tool runs, at the validation stage, so it costs nothing and changes nothing.

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `row` | object | Required | Columns to change, keyed by column_id from get-table. |
| `row_id` | string | Required | Row id from query-table-rows. |
| `table_id` | string | Required | Table id from list-tables. |

`project_id`, `projectID`, `organization_id` and `executed_by` are not arguments you pass: the
platform binds all four from the credential you authenticated with, and both SDKs refuse them
before the request leaves your process — see
[server-bound arguments](/docs/get-started/scope-and-server-bound-arguments).

## What it returns

The three surfaces wrap this differently, and code written against one will not read another
correctly — see [return shape](/docs/tools/overview#return-shape).

A real response, captured from a live call to `update-table-row`:

**Result of update-table-row**

**REST API**

```json
{
  "lifecycle_id": "qlc_000199",
  "result": {
    "result": {
      "6ab1944e12917e3705beb0b9": true,
      "6ab1944e56ac670306c8deed": 120,
      "6ab1944eb6557622b2632872": "Acme",
      "_id": "6ab1945e7566f41b5c28e301",
      "coworker_user_id": "6a79a770b6c128ccc24bfca7",
      "row_id": 1
    },
    "row_id": "6ab1945e7566f41b5c28e301",
    "table_id": "6ab1944e7566f41b5c28e2eb"
  }
}
```

**TypeScript SDK**

```ts
// the object you get back IS the result — there is no `.result` to read
{
  result: {
    '6ab1944e12917e3705beb0b9': true,
    '6ab1944e56ac670306c8deed': 120,
    '6ab1944eb6557622b2632872': 'Acme',
    _id: '6ab1945e7566f41b5c28e301',
    coworker_user_id: '6a79a770b6c128ccc24bfca7',
    row_id: 1
  },
  row_id: '6ab1945e7566f41b5c28e301',
  table_id: '6ab1944e7566f41b5c28e2eb'
}

// 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_000199'
```

**Python SDK**

```python
# a dict subclass; `result` is already unwrapped
{
 "result": {
  "6ab1944e12917e3705beb0b9": True,
  "6ab1944e56ac670306c8deed": 120,
  "6ab1944eb6557622b2632872": "Acme",
  "_id": "6ab1945e7566f41b5c28e301",
  "coworker_user_id": "6a79a770b6c128ccc24bfca7",
  "row_id": 1
 },
 "row_id": "6ab1945e7566f41b5c28e301",
 "table_id": "6ab1944e7566f41b5c28e2eb"
}

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

Keeping the `lifecycle_id` is what lets you ask later why a call was allowed, refused or held.

## Calling it

The same call on all four surfaces. Pick a tab once and every code block in the documentation follows it.

The ids in this example are real: they resolve against the project the documentation is written
against, so the call runs as written once you point it at your own deployment. Swap them for the
ids of your own objects.

**Call update-table-row**

**REST API**

```bash
curl -sS https://fabric.wexa.ai/v1/update-table-row \
  -H "authorization: Bearer $FABRIC_API_KEY" \
  -H "content-type: application/json" \
  -d '{"row":{"6ab1944eb6557622b2632872":"Acme"},"row_id":"6ab1945e7566f41b5c28e301","table_id":"6ab1944e7566f41b5c28e2eb"}'
```

**TypeScript SDK**

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

const fabric = new Fabric()
const { result } = await fabric.updateTableRow({
  row: { '6ab1944eb6557622b2632872': 'Acme' },
  row_id: "6ab1945e7566f41b5c28e301",
  table_id: "6ab1944e7566f41b5c28e2eb"
})
```

**Python SDK**

```python
from wexa import Fabric

fabric = Fabric()
out = fabric.update_table_row(row={'6ab1944eb6557622b2632872': 'Acme'}, row_id="6ab1945e7566f41b5c28e301", table_id="6ab1944e7566f41b5c28e2eb")
```

## Errors

Both SDKs raise the same typed errors, chosen from the gateway's own error string first and its
HTTP status second. `update-table-row` checks the `fabric:table.write` grant, and reaches the seven classes every
tool reaches — listed under [the common set](/docs/tools/errors#the-common-set). These are the ones specific to it:

| Error | Status | Raised when |
| --- | --- | --- |
| `NotFound` | 404 | `table_id` matches no table in this project, or `row_id` no row in that table. |
| `ConfigurationError` | 5xx | `update-table-row` is not available to you. Retrying will not help. |

## Governance

Every call to `update-table-row` runs through the same ten-stage lifecycle as every other Wexa tool: the
credential is resolved to a scope, the `fabric:table.write` grant is checked, quota is drawn down, the arguments are
validated, policy rules are evaluated, the call is executed, the result is shaped and redacted, and an audit
record is written. The `lifecycle_id` in the response is the handle to that record.

`update-table-row` is marked consequential, which means it changes something rather than only reading. It is audited
in full, and a call made with an API key or an SDK session waits for a person to approve it: the call returns
`202` and an `ApprovalRequired` error carrying the approval id and a resume token, and the SDKs can wait for the
decision and resume rather than making you call again. This gate is on by default for every project, admin API
keys included. It is a breaking change for code that expected this call to run at once. A project admin can turn
the gate off, or back on, in the project's settings. Actions taken by a person in the console are not held.

## See also

[The tool index](/docs/tools/overview), [errors](/docs/tools/errors),
and [which identifier goes where](/docs/tools/identifiers).
