Skip to main content
DELETE
/
db
/
delete
JavaScript
const response = await fetch('https://api.worqhat.com/db/delete', {
  method: 'DELETE',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_API_KEY'
  },
  body: JSON.stringify({
    table: "users",
    where: {id: "123"},
    environment: "production"
  })
});
const data = await response.json();
console.log(data);
{
  "success": true,
  "data": [
    {}
  ],
  "count": 123,
  "message": "Data deleted successfully"
}

Authorizations

Authorization
string
header
required

API key authentication. Format - "Bearer YOUR_API_KEY"

Body

application/json
table
string
required

Table name to delete from

Example:

"users"

where
object
required

Where conditions

Example:
{ "id": "123" }
environment
enum<string>

Environment to delete from (development, staging, production)

Available options:
development,
staging,
production
Example:

"production"

Response

Data deleted successfully

success
boolean
Example:

true

data
object[]
count
integer

Number of records deleted

message
string
Example:

"Data deleted successfully"