Restore Row
curl --request POST \
--url https://api.sublay.io/v8/:projectId/db/:tableName/:rowId/restore \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/v8/:projectId/db/:tableName/:rowId/restore"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sublay.io/v8/:projectId/db/:tableName/:rowId/restore', 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/v8/:projectId/db/:tableName/:rowId/restore",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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/v8/:projectId/db/:tableName/:rowId/restore"
req, _ := http.NewRequest("POST", 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.post("https://api.sublay.io/v8/:projectId/db/:tableName/:rowId/restore")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/db/:tableName/:rowId/restore")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"row": {}
}Custom Tables — Rows
Restore Row
Bring back a soft-deleted row on a paranoid table
Restore Row
curl --request POST \
--url https://api.sublay.io/v8/:projectId/db/:tableName/:rowId/restore \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/v8/:projectId/db/:tableName/:rowId/restore"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sublay.io/v8/:projectId/db/:tableName/:rowId/restore', 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/v8/:projectId/db/:tableName/:rowId/restore",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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/v8/:projectId/db/:tableName/:rowId/restore"
req, _ := http.NewRequest("POST", 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.post("https://api.sublay.io/v8/:projectId/db/:tableName/:rowId/restore")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/db/:tableName/:rowId/restore")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"row": {}
}Clears a row’s
deletedAt, returning it to normal reads.
Only works on a paranoid table — one created with paranoid: true, where deletes are soft by default. Restoring on a non-paranoid table fails with database/not-paranoid, since a delete there removed the row permanently and there is nothing to bring back.
Row endpoints capture the caller’s identity but enforce no authorization. See Security: open row CRUD.
Path Parameters
string
required
Logical name of the custom table — pass
orders, not custom_orders.string
required
UUID of the soft-deleted row to restore.
Response
object
The restored row, with
deletedAt cleared.Error Responses
Invalid Parameters — 400
Invalid Parameters — 400
{ "error": "Bad Request", "code": "database/invalid-params" }
Table Not Paranoid — 400
Table Not Paranoid — 400
The table does not soft-delete, so it has nothing to restore.
{ "error": "Bad Request", "code": "database/not-paranoid" }
Table Not Found — 404
Table Not Found — 404
{ "error": "Not Found", "code": "database/table-not-found" }
Row Not Found — 404
Row Not Found — 404
{ "error": "Not Found", "code": "database/row-not-found" }
Server Error — 500
Server Error — 500
{ "error": "Internal Server Error", "code": "database/server-error" }

