Skip to main content

Update a Resource (PUT)

Update one or more existing rows entirely through query parameters — no request body needed:

PUThttps://demo.littlebit.in:443/minimal/api/rest/auto/v1/btec/tst/ms//
📋 Schema — demo_db.users
-- demo_db.users schema
CREATE TABLE users (
  id INT AUTO_INCREMENT PRIMARY KEY,
  name VARCHAR(100) NOT NULL,
  email VARCHAR(100) NOT NULL UNIQUE,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB;
curl --location 'https://demo.littlebit.in:443/minimal/api/rest/auto/v1/btec/tst/ms/demo_db/users?id=eq.1&set=name.Steve%20Cat%2033%20Steve%20Cat%2034' \
  --header 'X-Org-Id: 01KKBPGAE4CR13W14E4T4ACSAB' \
  --header 'X-Project-Id: 01KF6G55AK87WWGQ145SDA2AC9' \
  --header 'X-Space-Id: 01KF6G55AK87WWGQ145SDA25X9' \
  --header 'X-User-Id: 01KBY3K9NDC5XW523M2V1Z0373' \
  --header 'X-User-Roles: users, admin'
// Hit "Send PUT" to see the live response

How it Works

PUT uses only query parameters — a filter to select which rows to update, and a set param to define what changes:

PUT /minimal/api/rest/auto/v1/{org_abbr}/{project_abbr}/{db_type}/{db_name}/{table}?{filter}&set={column}.{new value}

Example — rename "Steve Cat 33" to "Steve Cat 34" for user id=1:

PUT /minimal/api/rest/auto/v1/acme/demo/ms/demo_db/users?id=eq.1&set=name.Steve%20Cat%2034
URL Structure
/v1/acme/demo/ms/demo_db
│ │ │ │
│ │ │ └── database name
│ │ └── ms = MySQL
│ └── project abbreviation
└── org abbreviation

Query Parameters

Filter — selects which rows to update

At least one filter is required. Uses the same operators as GET:

OperatorMeaningExample
eqEqualsid=eq.10
neNot equalsid=ne.10
ltLess thanid=lt.100
gtGreater thanid=gt.5
leLess than or equalid=le.50
geGreater than or equalid=ge.10
bwBetween (inclusive)id=bw.10.20
inValue is in listid=in.6,7,8
ninValue is not in listid=nin.1,2,3
liContainsname=li.alice
rliStarts withname=rli.ali

set — defines the update

ParamFormatDescription
setset=column.new valueColumn, dot, new value

The format is:

set=<column>.<new value>

Decoded example:

column →  name
new → Steve Cat 34

set=name.Steve Cat 34

URL-encoded:

set=name.Steve%20Cat%2034
URL Encoding

Spaces within new value must be encoded as %20.

Multiple filters are combined with AND. Only one set param per request:

?id=eq.1&set=name.Steve%20Cat%2034

Request Body

PUT does not require a request body. Send an empty body or omit it entirely.


Response

200 OK — returns the number of rows updated:

{
"rows_affected": 1
}

200 OK with zero rows — No error is raised:

{
"rows_affected": 0
}

Required Headers

All requests to Minimal must include these headers.

They are mandatory — missing any header results in a 400 Bad Request.

HeaderFormatDescription
X-Org-IdStringOrganization identifier
X-Project-IdStringProject identifier within the organization
X-Space-IdStringWorkspace/environment identifier within the project
X-User-IdStringAuthenticated user's identifier
X-User-RolesComma-separated stringUser's roles (e.g., admin,editor)

Examples

Rename a user:

PUT /minimal/api/rest/auto/v1/acme/demo/ms/demo_db/users?id=eq.1&set=name.Steve%20Cat%2034

Update an email address:

PUT /minimal/api/rest/auto/v1/acme/demo/ms/demo_db/users?id=eq.5&set=email.new%40example.com

Update a simple single-word value:

PUT /minimal/api/rest/auto/v1/acme/demo/ms/demo_db/users?id=eq.3&set=status.active

Update all users in an ID range:

PUT /minimal/api/rest/auto/v1/acme/demo/ms/demo_db/users?id=bw.10.20&set=is_active.0

Update by matching name pattern:

PUT /minimal/api/rest/auto/v1/acme/demo/ms/demo_db/users?name=rli.test&set=is_active.1

Common Errors

CodeCause
400set param is missing or malformed
401Missing required header
406No filter provided — PUT requires at least one filter
417Unknown or unsupported filter operator
422New value violates a schema constraint (type mismatch, unique violation)