where
conditions. This endpoint allows you to remove existing records from your database by specifying which records to delete.
What Does This Endpoint Do?
This endpoint removes records from your database tables that match specific criteria. Think of it like removing rows from a spreadsheet based on certain conditions - you specify which table to delete from and what conditions the records must meet to be deleted.When to Use Delete Data
You’ll find this endpoint useful when you need to:- Remove inactive users: Delete user accounts that are no longer active
- Clean up old data: Remove outdated or expired records
- Delete completed tasks: Remove tasks that have been finished
- Implement data retention policies: Delete data that’s beyond your retention period
- Remove test data: Clean up test or temporary records
- Handle user requests: Delete user data upon request (e.g., for privacy compliance)
How It Works
- You specify the table name where you want to delete records
- You provide the where conditions to identify which records to delete
- The API deletes matching records and returns the count of deleted records
Code Examples
Example 1: Delete Records with a Single Condition
This example shows how to delete records that match a single condition.Example 2: Delete Records with Multiple Conditions
This example shows how to delete records that match multiple conditions.Request Body Explained
The name of the table where you want to delete records. For example,
users
, products
, or orders
.The conditions that records must match to be deleted. This is an object where each key is a field name and each value is the value to match.For example,
{"status": "inactive"}
will match records where the status field equals “inactive”.Response Fields Explained
true
if the delete operation was successful, false
otherwise.The number of records that were deleted by this operation.
A human-readable message describing the result of the operation.
Example Response
Common Errors and How to Fix Them
Error | Cause | Solution |
---|---|---|
”Table not found” | The specified table doesn’t exist | Check your table name for typos |
”Missing where conditions” | The where parameter is empty | Provide at least one condition in the where object |
”No records match the conditions” | No records matched your where conditions | This is not an error, but check your conditions if you expected records to be deleted |
”Unauthorized” | Invalid or missing API key | Check that you’re using a valid API key |
Tips for Successful Deletions
- Always use specific conditions to avoid accidentally deleting too many records
- Consider using a query first to verify which records will be deleted
- Be careful with delete operations as they cannot be undone
- Use multiple conditions when needed to precisely target records
- Consider soft deletes (updating a status field instead of actually deleting) for data that might need to be recovered