where
conditions. This endpoint allows you to modify existing records in your database by specifying which records to update and what data to change.
What Does This Endpoint Do?
Imagine you have a database table with user information, and you need to change a user’s status from “inactive” to “active” or update their name. This endpoint lets you do exactly that!When to Use Update Data
You’ll find this endpoint useful when you need to:- Update user profiles: Change names, emails, or other profile information
- Change status values: Mark orders as “shipped” or tasks as “completed”
- Update inventory: Adjust product quantities or prices
- Modify settings: Change configuration values in your application
- Mark notifications: Set notifications as “read” or “unread”
- Process workflows: Update records as they move through approval stages
How It Works
- You specify the table name where your data is stored
- You provide where conditions to identify which records to update
- You include the new data you want to set for those records
- The API updates the matching records and returns the updated data
Code Examples
Example 1: Multiple Where Conditions
This example shows how to update records that match multiple conditions (both ID and email).Example 2: Single Where Condition
This example shows how to update all records that match a single condition (status = “inactive”).Request Body Explained
The name of the table where you want to update records. For example,
users
, products
, or orders
.Conditions to identify which records to update. This works like a filter - only records matching ALL conditions will be updated.For example:
{"id": "123", "status": "inactive"}
will update only records where both the ID is “123” AND the status is “inactive”.The new values you want to set for the matching records. Each key-value pair represents a field name and its new value.For example:
{"status": "active", "last_login": "2025-08-01T12:00:00Z"}
will set the status field to “active” and the last_login field to the specified timestamp.Response Fields Explained
true
if the update was successful, false
otherwise.An array containing the updated records with their new values. This shows you exactly what was changed in the database.
The number of records that were updated. If this is 0, it means no records matched your where conditions.
How long the update operation took to complete, measured in milliseconds.
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 |
”No records matched the update criteria” | Your where conditions didn’t match any records | Verify your where conditions are correct |
”Missing required field” | You didn’t provide a required parameter | Make sure you include table, where, and data fields |
”Unauthorized” | Invalid or missing API key | Check that you’re using a valid API key |
Tips for Successful Updates
- Always use specific where conditions to avoid updating too many records by accident
- Consider fetching the records first to verify which ones will be updated
- Remember that updates are permanent - consider backing up important data before updates
- For large tables, updates might take longer to complete