Dump a Space's database rows - Spacefast Docs
Dump a Space's database rows
Returns rows read from the live capsule’s declared tables through the Space’s own runtime, up to limit rows per table, 25 by default and 100 at most. Set table to dump one table instead of every declared table. Only a Zero capsule declares a table set: a worker returns runtime_kind_mismatch and a Space with no database returns db_not_available. A Space whose box is unreachable fails with runtime_management_unavailable rather than answering with an empty dump.
GET /v1/spaces/{spaceId}/db/dump
Authorization
Authorization Bearer token · header required
Authorization: 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.
or
Authorization Bearer token · header required
Authorization: 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
Query parameters
table string
min length 1 · max length 128 · matches ^[A-Za-z_][A-Za-z0-9_]*
limit integer required
min 1 · max 100 · default: 25
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
Show properties
versionIdstring | any required
Any of:
string
any
artifactIdstring | any required
Any of:
string
any
schemaHashstring | any required
Any of:
string
any
tablesobject[] required
default: []
Array of object
namestring required
min length 1 · max length 128 · matches ^[A-Za-z_][A-Za-z0-9_]*
rowsobject[] required
default: []
default Error. Every 4xx and 5xx response is one RFC 9457 problem document served as application/problem+json.
200 default
{
"$schema": "http://example.com",
"data": {
"versionId": "string",
"artifactId": "string",
"schemaHash": "string",
"tables": []
}
}
{
"$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"
}
Try it
Server
Base URL https://api.spacefast.com
Authorization
Bearer token
Remember on this device
Include my values in samples
Parameters
spaceId path*table querylimit query*
Send
Request
curl -X GET "https://api.spacefast.com/v1/spaces/string/db/dump?limit=25" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.spacefast.com/v1/spaces/string/db/dump?limit=25", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_TOKEN"
}
});
import requests
response = requests.get(
"https://api.spacefast.com/v1/spaces/string/db/dump?limit=25",
headers={
"Authorization": "Bearer YOUR_TOKEN"
},
)