cURL
curl --request PATCH \
--url https://app.teable.ai/api/space/%7BspaceId%7D/data-db \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--header 'content-type: application/json' \
--data '{"url":"string","spaceId":"string","targetMode":"initialize-empty","internalSchema":"string","confirmLargeMigration":true,"switchOnCompletion":true}'const url = 'https://app.teable.ai/api/space/%7BspaceId%7D/data-db';
const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer REPLACE_BEARER_TOKEN',
'content-type': 'application/json'
},
body: '{"url":"string","spaceId":"string","targetMode":"initialize-empty","internalSchema":"string","confirmLargeMigration":true,"switchOnCompletion":true}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}const http = require('https');
const options = {
method: 'PATCH',
hostname: 'app.teable.ai',
port: null,
path: '/api/space/%7BspaceId%7D/data-db',
headers: {
Authorization: 'Bearer REPLACE_BEARER_TOKEN',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
url: 'string',
spaceId: 'string',
targetMode: 'initialize-empty',
internalSchema: 'string',
confirmLargeMigration: true,
switchOnCompletion: true
}));
req.end();import http.client
conn = http.client.HTTPSConnection("app.teable.ai")
payload = "{\"url\":\"string\",\"spaceId\":\"string\",\"targetMode\":\"initialize-empty\",\"internalSchema\":\"string\",\"confirmLargeMigration\":true,\"switchOnCompletion\":true}"
headers = {
'Authorization': "Bearer REPLACE_BEARER_TOKEN",
'content-type': "application/json"
}
conn.request("PATCH", "/api/space/%7BspaceId%7D/data-db", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.teable.ai/api/space/{spaceId}/data-db",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'url' => '<string>',
'spaceId' => '<string>',
'targetMode' => 'initialize-empty',
'internalSchema' => '<string>',
'confirmLargeMigration' => true,
'switchOnCompletion' => true
]),
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.teable.ai/api/space/{spaceId}/data-db"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"spaceId\": \"<string>\",\n \"targetMode\": \"initialize-empty\",\n \"internalSchema\": \"<string>\",\n \"confirmLargeMigration\": true,\n \"switchOnCompletion\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://app.teable.ai/api/space/{spaceId}/data-db")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"spaceId\": \"<string>\",\n \"targetMode\": \"initialize-empty\",\n \"internalSchema\": \"<string>\",\n \"confirmLargeMigration\": true,\n \"switchOnCompletion\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.teable.ai/api/space/{spaceId}/data-db")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"spaceId\": \"<string>\",\n \"targetMode\": \"initialize-empty\",\n \"internalSchema\": \"<string>\",\n \"confirmLargeMigration\": true,\n \"switchOnCompletion\": true\n}"
response = http.request(request)
puts response.read_body{
"mode": "default",
"state": "ready",
"provider": "postgres",
"displayHost": "<string>",
"displayDatabase": "<string>",
"internalSchema": "<string>",
"schemaVersion": "<string>",
"lastValidatedAt": "<string>",
"lastError": "<string>",
"capabilities": {
"createSchema": true,
"createTable": true,
"createFunction": true,
"createTrigger": true,
"createRole": true,
"grantPrivileges": true,
"inspectActivity": true
},
"health": {
"state": "healthy",
"reason": "<string>",
"changedAt": "<string>",
"lastCheckAt": "<string>"
},
"migration": {
"jobId": "<string>",
"state": "pending",
"targetInternalSchema": "<string>",
"switchOnCompletion": true,
"lastError": "<string>"
},
"relatedSpaces": {
"primarySpaceId": "<string>",
"hasCrossSpaceLinks": true,
"spaces": [
{
"spaceId": "<string>",
"name": "<string>",
"isPrimary": true,
"baseIds": [
"<string>"
],
"tableIds": [
"<string>"
],
"dataDbMode": "default",
"dataDbState": "ready",
"dataDbConnectionId": "<string>",
"dataDbUrlFingerprint": "<string>",
"dataDbDatabaseFingerprint": "<string>",
"dataDbDisplayHost": "<string>",
"dataDbDisplayDatabase": "<string>",
"dataDbInternalSchema": "<string>"
}
],
"links": [
{
"fromSpaceId": "<string>",
"fromTableId": "<string>",
"fromFieldId": "<string>",
"toSpaceId": "<string>",
"toTableId": "<string>"
}
]
}
}space
Patch space data db
Update PostgreSQL credentials or connection parameters for the existing BYODB database
Required token scopes: space|update
PATCH
/
space
/
{spaceId}
/
data-db
cURL
curl --request PATCH \
--url https://app.teable.ai/api/space/%7BspaceId%7D/data-db \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--header 'content-type: application/json' \
--data '{"url":"string","spaceId":"string","targetMode":"initialize-empty","internalSchema":"string","confirmLargeMigration":true,"switchOnCompletion":true}'const url = 'https://app.teable.ai/api/space/%7BspaceId%7D/data-db';
const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer REPLACE_BEARER_TOKEN',
'content-type': 'application/json'
},
body: '{"url":"string","spaceId":"string","targetMode":"initialize-empty","internalSchema":"string","confirmLargeMigration":true,"switchOnCompletion":true}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}const http = require('https');
const options = {
method: 'PATCH',
hostname: 'app.teable.ai',
port: null,
path: '/api/space/%7BspaceId%7D/data-db',
headers: {
Authorization: 'Bearer REPLACE_BEARER_TOKEN',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
url: 'string',
spaceId: 'string',
targetMode: 'initialize-empty',
internalSchema: 'string',
confirmLargeMigration: true,
switchOnCompletion: true
}));
req.end();import http.client
conn = http.client.HTTPSConnection("app.teable.ai")
payload = "{\"url\":\"string\",\"spaceId\":\"string\",\"targetMode\":\"initialize-empty\",\"internalSchema\":\"string\",\"confirmLargeMigration\":true,\"switchOnCompletion\":true}"
headers = {
'Authorization': "Bearer REPLACE_BEARER_TOKEN",
'content-type': "application/json"
}
conn.request("PATCH", "/api/space/%7BspaceId%7D/data-db", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.teable.ai/api/space/{spaceId}/data-db",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'url' => '<string>',
'spaceId' => '<string>',
'targetMode' => 'initialize-empty',
'internalSchema' => '<string>',
'confirmLargeMigration' => true,
'switchOnCompletion' => true
]),
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.teable.ai/api/space/{spaceId}/data-db"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"spaceId\": \"<string>\",\n \"targetMode\": \"initialize-empty\",\n \"internalSchema\": \"<string>\",\n \"confirmLargeMigration\": true,\n \"switchOnCompletion\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://app.teable.ai/api/space/{spaceId}/data-db")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"spaceId\": \"<string>\",\n \"targetMode\": \"initialize-empty\",\n \"internalSchema\": \"<string>\",\n \"confirmLargeMigration\": true,\n \"switchOnCompletion\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.teable.ai/api/space/{spaceId}/data-db")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"spaceId\": \"<string>\",\n \"targetMode\": \"initialize-empty\",\n \"internalSchema\": \"<string>\",\n \"confirmLargeMigration\": true,\n \"switchOnCompletion\": true\n}"
response = http.request(request)
puts response.read_body{
"mode": "default",
"state": "ready",
"provider": "postgres",
"displayHost": "<string>",
"displayDatabase": "<string>",
"internalSchema": "<string>",
"schemaVersion": "<string>",
"lastValidatedAt": "<string>",
"lastError": "<string>",
"capabilities": {
"createSchema": true,
"createTable": true,
"createFunction": true,
"createTrigger": true,
"createRole": true,
"grantPrivileges": true,
"inspectActivity": true
},
"health": {
"state": "healthy",
"reason": "<string>",
"changedAt": "<string>",
"lastCheckAt": "<string>"
},
"migration": {
"jobId": "<string>",
"state": "pending",
"targetInternalSchema": "<string>",
"switchOnCompletion": true,
"lastError": "<string>"
},
"relatedSpaces": {
"primarySpaceId": "<string>",
"hasCrossSpaceLinks": true,
"spaces": [
{
"spaceId": "<string>",
"name": "<string>",
"isPrimary": true,
"baseIds": [
"<string>"
],
"tableIds": [
"<string>"
],
"dataDbMode": "default",
"dataDbState": "ready",
"dataDbConnectionId": "<string>",
"dataDbUrlFingerprint": "<string>",
"dataDbDatabaseFingerprint": "<string>",
"dataDbDisplayHost": "<string>",
"dataDbDisplayDatabase": "<string>",
"dataDbInternalSchema": "<string>"
}
],
"links": [
{
"fromSpaceId": "<string>",
"fromTableId": "<string>",
"fromFieldId": "<string>",
"toSpaceId": "<string>",
"toTableId": "<string>"
}
]
}
}授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
路径参数
请求体
application/json
响应
200 - application/json
Returns the refreshed data database binding summary.
可用选项:
default, byodb 可用选项:
ready, validating, initializing, migrating, error, disabled 可用选项:
postgres Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
最后修改于 2026年9月15日
此页面对您有帮助吗?

