Database Queries

Update data in database (REST API)

Changed on

Update existing rows in your database using REST API.

Security: Row-Level Security ensures you can only update data you have access to

Safety: Requires at least one filter to prevent accidental mass updates. A request with no filters is rejected with 400 (mirrors delete). This matters for service-key queries, which run with full access and bypass RLS.

Note: If RLS blocks the update, an empty result is returned (not an error)

Branch-targeted. Runs against the named branch instead of the parent database, using the branch's own credentials. The branch must be active and unexpired. Nothing about this request can reach the parent's data.

post/databases/{databaseName}/branches/{branchName}/query/update

Request

  • Base URL
    https://api.volcano.dev
  • Auth
    HTTP bearer

Path parameters

databaseName, string required

Database name (unique within project, lowercase letters, numbers, and underscores only)

branchName, string required

Branch name (unique within the parent database, lowercase letters, numbers, and underscores only)

Request body

DatabaseUpdateRequest required
table, string required

Table name

values, object required

Column values to update. JSON objects and arrays are stored as JSON, so send them to json or jsonb columns. For a Postgres array column, send an array literal string such as "{a,b}".

filters, DatabaseQueryFilter[] required

WHERE conditions for which rows to update. At least one filter is required; a filterless update is rejected to avoid rewriting every row.

Example request

{
  "table": "posts",
  "values": {
    "title": "Updated Title",
    "status": "published"
  },
  "filters": [
    {
      "column": "id",
      "operator": "eq",
      "value": "post-uuid"
    }
  ]
}

Response

Update successful

DatabaseQueryResult required

Rows returned by a data API request. RLS-filtered unless the request was made with a service key.

data, object[]

Result rows

count, integer

Number of rows returned

Changes

    • breaking

      added the new path request parameter branchName

    • breaking

      added the new path request parameter databaseName

    • breaking

      added the new required request property filters

    24 more changes in this revision