List exportable tables and the schema fence - Spacefast Docs
List exportable tables and the schema fence
Returns the live capsule’s declared table names in ascending order, plus the schemaHash that fences this export. Send that hash to the per-table page read, which rejects a table whose shape has changed since instead of mixing it into the export. Rows there come back in createdAt then id order, and consistency holds within one page rather than across the export.
GET/v1/spaces/{spaceId}/db/export
Authorization
Authorization Bearer token · header requiredAuthorization: Bearer <key> with the Space key (sfc_ prefix) of an unclaimed Space. The same key is the fragment of the claim URL and the token in the Space's /_/__/<key> sign-in URL.
orAuthorization Bearer token · header requiredAuthorization: Bearer <token> with an API key (sfa_ prefix), an OAuth access token, a session token, or a Space machine credential (sfm_ prefix).
Path parameters
spaceId string required
Responses
200 Response for status 200
$schema string
Canonical JSON Schema URL for this response body. The server also sends it in the Link: rel="describedby" response header.
data object required
spaceIdstring | any requiredversionIdstring | any requiredschemaHashstring requiredconsistencystring requiredorderingobject requiredtablesstring requiredrowsstring required
tablesstring[] required
default Error
Every 4xx and 5xx response is one RFC 9457 problem document served as application/problem+json.
$schema string
Canonical JSON Schema URL for this response body. The server also sends it in the Link: rel="describedby" response header.
typestring requiredtitlestring requiredstatusinteger requireddetailstring requiredcodestring requiredpointerstringdetailsobjectsuggestionsstring[]nextstring[]requestIdstring required
Try it
Server
Base URL https://api.spacefast.com
Authorization
Bearer token Remember on this device Include my values in samples
Parameters
spaceId path *
Request
cURL
curl -X GET "https://api.spacefast.com/v1/spaces/string/db/export" \
-H "Authorization: Bearer YOUR_TOKEN"
JavaScript
const response = await fetch("https://api.spacefast.com/v1/spaces/string/db/export", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_TOKEN"
}
});
Python
import requests
response = requests.get(
"https://api.spacefast.com/v1/spaces/string/db/export",
headers={
"Authorization": "Bearer YOUR_TOKEN"
},
)
Response
200 default
{
"$schema": "http://example.com",
"data": {
"spaceId": "string",
"versionId": "string",
"schemaHash": "string",
"consistency": "per_page",
"ordering": {
"tables": "name_asc",
"rows": "created_at_id_asc"
},
"tables": [
"string"
]
}
}
{
"$schema": "http://example.com",
"type": "string",
"title": "string",
"status": -9007199254740991,
"detail": "string",
"code": "string",
"pointer": "string",
"details": {
"property1": null,
"property2": null
},
"suggestions": [
"string"
],
"next": [
"string"
],
"requestId": "string"
}