Drop Table
curl --request DELETE \
--url https://api.sublay.io/v7/:projectId/db/tables/:tableName \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/v7/:projectId/db/tables/:tableName"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sublay.io/v7/:projectId/db/tables/:tableName', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sublay.io/v7/:projectId/db/tables/:tableName",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sublay.io/v7/:projectId/db/tables/:tableName"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.sublay.io/v7/:projectId/db/tables/:tableName")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v7/:projectId/db/tables/:tableName")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"dropped": "<string>"
}Custom Tables — Management
Drop Table
Permanently drop a custom table and all of its rows
Drop Table
curl --request DELETE \
--url https://api.sublay.io/v7/:projectId/db/tables/:tableName \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/v7/:projectId/db/tables/:tableName"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sublay.io/v7/:projectId/db/tables/:tableName', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sublay.io/v7/:projectId/db/tables/:tableName",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sublay.io/v7/:projectId/db/tables/:tableName"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.sublay.io/v7/:projectId/db/tables/:tableName")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v7/:projectId/db/tables/:tableName")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"dropped": "<string>"
}Drops a custom table.
This is irreversible and takes every row with it. A table’s
paranoid setting protects rows from deletion, not the table itself — dropping a paranoid table destroys its soft-deleted rows too.Service or master key required.
Path Parameters
string
required
Logical name of the table to drop — pass
orders, not custom_orders. Only custom tables can be dropped here; a built-in or bundle table returns database/table-not-found.Response
string
The logical name of the dropped table.
Error Responses
Invalid Parameters — 400
Invalid Parameters — 400
{ "error": "Bad Request", "code": "database/invalid-params" }
Not A Custom Table — 400
Not A Custom Table — 400
{ "error": "Bad Request", "code": "database/not-a-custom-table" }
Elevated Auth Required — 403
Elevated Auth Required — 403
{
"error": "Service or master key required.",
"code": "auth/elevated-auth-required"
}
Table Not Found — 404
Table Not Found — 404
{ "error": "Not Found", "code": "database/table-not-found" }
Server Error — 500
Server Error — 500
{ "error": "Internal Server Error", "code": "database/server-error" }

