Skip to main content

Delete a Resource (DELETE)

Delete one or more rows by targeting them with a filter:

DELETEhttps://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.10' \
  --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 DELETE" to see the live response
Always filter before you delete

A DELETE request without a precise filter will delete all rows in the table. There is no undo. Always double-check your filter in the query params before sending.


How it Works

DELETE uses only a filter in the query string — no request body needed:

DELETE /minimal/api/rest/auto/v1/{org_abbr}/{project_abbr}/{db_type}/{db_name}/{table}?{column}={operator}.{value}

Every row matching the filter is permanently removed.

URL Structure
/v1/acme/demo/ms/demo_db
│ │ │ │
│ │ │ └── database name
│ │ └── ms = MySQL
│ └── project abbreviation
└── org abbreviation

Query Parameters (Filter)

Filters use the same operator format as GET and PUT:

?<column>=<operator>.<value>
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
liContains (LIKE)name=li.alice
rliStarts withname=rli.ali

Multiple filters are combined with AND:

?id=gt.5&is_active=eq.0

Request Body

DELETE does not require a request body. The filter in the query string is all that is needed.


Response

200 OK — returns the number of rows deleted:

{
"rows_affected": 1
}

200 OK with zero rows — filter matched nothing. 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

Delete a single row by ID:

DELETE /minimal/api/rest/auto/v1/acme/demo/ms/demo_db/users?id=eq.10

Delete a range of rows:

DELETE /minimal/api/rest/auto/v1/acme/demo/ms/demo_db/users?id=bw.10.20

Delete all inactive users:

DELETE /minimal/api/rest/auto/v1/acme/demo/ms/demo_db/users?is_active=eq.0

Delete specific IDs:

DELETE /minimal/api/rest/auto/v1/acme/demo/ms/demo_db/users?id=in.6,7,8

Delete users from a domain:

DELETE /minimal/api/rest/auto/v1/acme/demo/ms/demo_db/users?email=li.@test.com

Common Errors

CodeCause
401Missing required header
406No filter provided — DELETE requires at least one filter
417Unknown or unsupported filter operator