Skip to Content

Batch Delete Entities

The Batch Delete Entities endpoint allows you to delete multiple records from a specific entity in a single API call, based on flexible search criteria. The request body uses the BSH Search object to specify which records to remove.

DELETE /api/entities/:entityName/batch

Request Body

{ "entity": "users", "query": [ { "field": "name", "operator": "ilike", "value": "john" } ] }
PropertyTypeRequiredDescription
entitystringyesThe name of the entity to delete records from.
queryarraynoAn array of conditions that match the records you want to delete. Supports all BSH query operators.

If no query is provided, the endpoint will delete all records from the entity.

Response

A successful response returns an object indicating how many records were deleted:

{ "data": [ { "effected": 1 } ], "timestamp": 1234567890, "code": 200, "status": "OK", "meta": {} }

The effected property in the response indicates how many records matched the query and were deleted.

This endpoint only processes the entity and query properties from the BSH Search object. Any other properties will be ignored.