curl --request PUT \
--url https://app.base44.com/api/apps/{app_id}/entities/{entity_name}/trash/restore \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": {
"$in": [
"6886b8d390dc7e2f4a2c91b3",
"6886b8d390dc7e2f4a2c91b4"
]
}
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/entities/{entity_name}/trash/restore"
payload = { "id": { "$in": ["6886b8d390dc7e2f4a2c91b3", "6886b8d390dc7e2f4a2c91b4"] } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({id: {$in: ['6886b8d390dc7e2f4a2c91b3', '6886b8d390dc7e2f4a2c91b4']}})
};
fetch('https://app.base44.com/api/apps/{app_id}/entities/{entity_name}/trash/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://app.base44.com/api/apps/{app_id}/entities/{entity_name}/trash/restore",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'id' => [
'$in' => [
'6886b8d390dc7e2f4a2c91b3',
'6886b8d390dc7e2f4a2c91b4'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.base44.com/api/apps/{app_id}/entities/{entity_name}/trash/restore"
payload := strings.NewReader("{\n \"id\": {\n \"$in\": [\n \"6886b8d390dc7e2f4a2c91b3\",\n \"6886b8d390dc7e2f4a2c91b4\"\n ]\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://app.base44.com/api/apps/{app_id}/entities/{entity_name}/trash/restore")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": {\n \"$in\": [\n \"6886b8d390dc7e2f4a2c91b3\",\n \"6886b8d390dc7e2f4a2c91b4\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/entities/{entity_name}/trash/restore")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": {\n \"$in\": [\n \"6886b8d390dc7e2f4a2c91b3\",\n \"6886b8d390dc7e2f4a2c91b4\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"restored": 3
}Restore entity records
Brings back every deleted record in the entity’s trash that matches a filter, and returns how many it restored.
Send the filter as the body, written the same way as the q parameter of List entity records. For example, {"id": {"$in": ["6886b8d390dc7e2f4a2c91b3", "6886b8d390dc7e2f4a2c91b4"]}} restores those two records. An empty object, {}, restores everything in the trash.
Unlike Restore entity record, this doesn’t trigger the app’s webhooks.
curl --request PUT \
--url https://app.base44.com/api/apps/{app_id}/entities/{entity_name}/trash/restore \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": {
"$in": [
"6886b8d390dc7e2f4a2c91b3",
"6886b8d390dc7e2f4a2c91b4"
]
}
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/entities/{entity_name}/trash/restore"
payload = { "id": { "$in": ["6886b8d390dc7e2f4a2c91b3", "6886b8d390dc7e2f4a2c91b4"] } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({id: {$in: ['6886b8d390dc7e2f4a2c91b3', '6886b8d390dc7e2f4a2c91b4']}})
};
fetch('https://app.base44.com/api/apps/{app_id}/entities/{entity_name}/trash/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://app.base44.com/api/apps/{app_id}/entities/{entity_name}/trash/restore",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'id' => [
'$in' => [
'6886b8d390dc7e2f4a2c91b3',
'6886b8d390dc7e2f4a2c91b4'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.base44.com/api/apps/{app_id}/entities/{entity_name}/trash/restore"
payload := strings.NewReader("{\n \"id\": {\n \"$in\": [\n \"6886b8d390dc7e2f4a2c91b3\",\n \"6886b8d390dc7e2f4a2c91b4\"\n ]\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://app.base44.com/api/apps/{app_id}/entities/{entity_name}/trash/restore")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": {\n \"$in\": [\n \"6886b8d390dc7e2f4a2c91b3\",\n \"6886b8d390dc7e2f4a2c91b4\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/entities/{entity_name}/trash/restore")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": {\n \"$in\": [\n \"6886b8d390dc7e2f4a2c91b3\",\n \"6886b8d390dc7e2f4a2c91b4\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"restored": 3
}Authorizations
Personal access token, sent as Authorization: Bearer <token>.
Path Parameters
ID of the app that owns the entity.
Name of the entity, exactly as List entity schemas reports it. Don't pass User here. It doesn't fail, but it reads and writes a separate, disconnected set of records stored under that name, not the app's real user accounts, which are managed through their own endpoints.
Body
Filter selecting the deleted records to restore, in the same form as q. Send {} to restore everything in the trash.
Was this page helpful?