curl --request POST \
--url https://api.rafftechnologies.com/api/v1/databases/{database_id}/restore \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"clone_to_new": true,
"in_place": true,
"backup_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pitr_timestamp": "2023-11-07T05:31:56Z",
"new_name": "<string>",
"ha_enabled": false
}
'import requests
url = "https://api.rafftechnologies.com/api/v1/databases/{database_id}/restore"
payload = {
"clone_to_new": True,
"in_place": True,
"backup_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pitr_timestamp": "2023-11-07T05:31:56Z",
"new_name": "<string>",
"ha_enabled": False
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
clone_to_new: true,
in_place: true,
backup_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
pitr_timestamp: '2023-11-07T05:31:56Z',
new_name: '<string>',
ha_enabled: false
})
};
fetch('https://api.rafftechnologies.com/api/v1/databases/{database_id}/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.rafftechnologies.com/api/v1/databases/{database_id}/restore",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'clone_to_new' => true,
'in_place' => true,
'backup_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'pitr_timestamp' => '2023-11-07T05:31:56Z',
'new_name' => '<string>',
'ha_enabled' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://api.rafftechnologies.com/api/v1/databases/{database_id}/restore"
payload := strings.NewReader("{\n \"clone_to_new\": true,\n \"in_place\": true,\n \"backup_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pitr_timestamp\": \"2023-11-07T05:31:56Z\",\n \"new_name\": \"<string>\",\n \"ha_enabled\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.post("https://api.rafftechnologies.com/api/v1/databases/{database_id}/restore")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"clone_to_new\": true,\n \"in_place\": true,\n \"backup_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pitr_timestamp\": \"2023-11-07T05:31:56Z\",\n \"new_name\": \"<string>\",\n \"ha_enabled\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rafftechnologies.com/api/v1/databases/{database_id}/restore")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"clone_to_new\": true,\n \"in_place\": true,\n \"backup_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pitr_timestamp\": \"2023-11-07T05:31:56Z\",\n \"new_name\": \"<string>\",\n \"ha_enabled\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"new_database_id": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Restore database
Restore a database to a backup or a point in time, either into a new database (clone_to_new: true) or over this one (in_place: true).
Choose the restore point with backup_id (a completed backup with restorable: true) or, for PostgreSQL, pitr_timestamp (any time from restore_window_start on the backup list until now). Omit both to restore the latest available state. A point outside the window returns 400.
- New database: inherits the source’s plan, storage, VPC, and project, starts with no read replicas, and bills pay-as-you-go. High availability is an explicit choice via
ha_enabled, never inherited. Ifnew_nameis taken, the platform adds a suffix (-2,-3, …). PollGET /api/v1/databases/{new_database_id}like any create. Free databases cannot restore into a new database. - In place: overwrites this database. A safety backup is taken first, the status is
restoringwhile it runs, andnew_database_idis empty. Data written after the restore point is lost.
curl --request POST \
--url https://api.rafftechnologies.com/api/v1/databases/{database_id}/restore \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"clone_to_new": true,
"in_place": true,
"backup_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pitr_timestamp": "2023-11-07T05:31:56Z",
"new_name": "<string>",
"ha_enabled": false
}
'import requests
url = "https://api.rafftechnologies.com/api/v1/databases/{database_id}/restore"
payload = {
"clone_to_new": True,
"in_place": True,
"backup_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pitr_timestamp": "2023-11-07T05:31:56Z",
"new_name": "<string>",
"ha_enabled": False
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
clone_to_new: true,
in_place: true,
backup_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
pitr_timestamp: '2023-11-07T05:31:56Z',
new_name: '<string>',
ha_enabled: false
})
};
fetch('https://api.rafftechnologies.com/api/v1/databases/{database_id}/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.rafftechnologies.com/api/v1/databases/{database_id}/restore",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'clone_to_new' => true,
'in_place' => true,
'backup_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'pitr_timestamp' => '2023-11-07T05:31:56Z',
'new_name' => '<string>',
'ha_enabled' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://api.rafftechnologies.com/api/v1/databases/{database_id}/restore"
payload := strings.NewReader("{\n \"clone_to_new\": true,\n \"in_place\": true,\n \"backup_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pitr_timestamp\": \"2023-11-07T05:31:56Z\",\n \"new_name\": \"<string>\",\n \"ha_enabled\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.post("https://api.rafftechnologies.com/api/v1/databases/{database_id}/restore")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"clone_to_new\": true,\n \"in_place\": true,\n \"backup_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pitr_timestamp\": \"2023-11-07T05:31:56Z\",\n \"new_name\": \"<string>\",\n \"ha_enabled\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rafftechnologies.com/api/v1/databases/{database_id}/restore")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"clone_to_new\": true,\n \"in_place\": true,\n \"backup_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pitr_timestamp\": \"2023-11-07T05:31:56Z\",\n \"new_name\": \"<string>\",\n \"ha_enabled\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"new_database_id": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
API key for authentication. Each key is bound to a specific account.
Path Parameters
Database ID (UUID) or short id (the database_id field, e.g. a1b2c3d4)
Body
Set exactly one of clone_to_new or in_place to true.
Restore into a new database
Restore over this database. Data written after the restore point is lost.
Restore from this completed backup. Omit to use pitr_timestamp or the latest state.
Point-in-time restore target (RFC 3339). PostgreSQL only — Valkey restores from snapshots via backup_id.
Name for the new database. Defaults to {source-name}-restored; auto-suffixed (-2, -3, …) if taken.
Enable high availability on the new database (+70% of the plan price). Never inherited from the source.