Skip to main content
PATCH/extensions-admin/{slug}/tables/{table}/rows/{rowId}

Update Extension Table Row

Changes the columns named in set on one row, and answers with the row as stored.

Only the row's author or a PROJECT_ADMIN may change it; anyone else is refused 403 with context.reason: "not_author". id, created_by and created_at never change, and updated_at is set by the server.

Send back the updated_at you read as expect_updated_at to avoid overwriting someone else's edit: if the row changed since, the update is refused 409 with context.reason: "stale" and nothing is written.

The comparison is on the instant, to the microsecond, in any offset.

The change and one extension.table_row.updated audit event commit together; the event names the table and the row id, never a column value.

Only a signed-in operator reaches it: a plugin token, a personal access token, a service token and an end user are refused.

The caller needs a project membership; an org role alone gets nothing here.

The table must be one the installed version's manifest lists in schema.user_tables, and the caller's project role must be in the set its min_role names: PROJECT_ANALYST admits analysts, editors, authors and admins, never an auditor alone.

Parameters
projectSlug *path

The project's slug.

slug *path

The installed extension's slug.

table *path

A table the extension's manifest lists in schema.user_tables.

rowId *path

The row's id.

Request body
set *object

Column name to value. id, created_by, created_at and updated_at are the server's: a value sent for any of them is ignored.

expect_updated_atstring

The updated_at you last read, sent back unchanged.

When it no longer matches the row, the update is refused 409 K9O_STATE_CONFLICT with context.reason: "stale" and nothing is written.

Responses
HTTPK9O CodeDescription
200Success
400K9O_INVALID_FIELD_VALUEThe body is not JSON, holds a key outside the operation's set (`context.unknown` names it), or a value does not fit its column.
401K9O_UNAUTHENTICATEDThe caller is not signed in.
403K9O_FORBIDDENThe caller is not an operator session (`context.reason: "principal_not_admitted"`), or their project role is not in the table's `min_role` set (`context.reason: "below_min_role"`, `context.minRole`).
403K9O_ACCESS_DENIEDThe caller has no membership in this project; an org role alone does not count.
403K9O_IAM_POLICY_DENIEDA bound IAM policy denies extensions:table_read or extensions:table_write on this extension.
403K9O_EXTENSION_DISABLEDThe extension is installed but not enabled.
403K9O_FORBIDDENThe caller is neither the row's author nor a `PROJECT_ADMIN` (`context.reason: "not_author"`); nothing is written.
404K9O_EXTENSION_NOT_INSTALLEDNo extension with this slug is installed on the project.
404K9O_EXTENSION_TABLE_NOT_FOUNDThe extension has no user table by this name: it is not in the manifest's `schema.user_tables`, or it does not exist. Both answer the same.
404K9O_NOT_FOUNDNo row with this id in the table.
409K9O_STATE_CONFLICTThe table does not have the user-table shape (`context.reason: "user_table_shape"`, `context.column`): an `id text` primary key, `created_by text NOT NULL`, and `created_at` and `updated_at` `timestamptz NOT NULL`.
409K9O_STATE_CONFLICT`expect_updated_at` no longer matches the row (`context.reason: "stale"`); nothing is written.
413K9O_PAYLOAD_TOO_LARGEThe body is over 256 KiB.
429K9O_EXTENSION_BFF_RATE_LIMITEDToo many calls from this caller to this extension; retry after a second.
Response body (200)
data *object

The row as stored.

row *object

One row: every column of the table as stored, in the column's type.

It always has id (the xrw_ id the server minted), created_by (the author's user id), created_at and updated_at.

Timestamps are ISO 8601 with an offset, to the microsecond.

meta *any
cURL
curl -X PATCH 'https://<org>.api-<region>.k9o.io/@storefront/extensions-admin/demoext/tables/<table>/rows/<rowId>' \
  -H 'Authorization: Bearer $K9O_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{}'

Showing example in cURL

Request example
{
  "expect_updated_at": "string"
}
Response example (200)
{
  "data": {}
}

More in Extensions