Open a database console - Spacefast Docs

Open a database console

Mints a short-lived, single-use phpMyAdmin sign-in URL for the Space’s own MySQL and returns it. Treat the URL as a credential: it carries full SQL authority over that database, which is why this requires write access to the Space. Returns runtime_not_provisioned when the Space has no site behind it yet.

POST /v1/spaces/{spaceId}/db/console

Authorization

Authorization Bearer token · header required

`Authorization: Bearer ` 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 `/__/` sign-in URL.

or

Authorization Bearer token · header required

`Authorization: Bearer ` 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

Time-limited phpMyAdmin sign-in URL for this Space's MySQL. Anyone holding it is signed in, so treat it as a credential.

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.

Machine-readable context keyed by the error code.

Recovery steps safe to show to a person.

Commands or API requests to run next, usable as written.

ID of this request, from the `X-Request-Id` header or generated. Quote it when contacting support.

Try it

Server

Base URL https://api.spacefast.com

Custom base URL Overrides the selected server when set.

Authorization

Bearer token Remember on this device Include my values in samples

Parameters

spaceId path *

Send

Request

cURL

curl -X POST "https://api.spacefast.com/v1/spaces/string/db/console" \
  -H "Authorization: Bearer YOUR_TOKEN"

JavaScript

const response = await fetch("https://api.spacefast.com/v1/spaces/string/db/console", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_TOKEN"
  }
});

Python

import requests

response = requests.post(
    "https://api.spacefast.com/v1/spaces/string/db/console",
    headers={
        "Authorization": "Bearer YOUR_TOKEN"
    },
)

Response

200 default

{
  "$schema": "http://example.com",
  "data": {
    "provider": "phpmyadmin",
    "url": "http://example.com"
  }
}
{
  "$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"
}