# 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 <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

### Responses

#### 200 Response for status 200

`$schema` string <uri>

Canonical JSON Schema URL for this response body. The server also sends it in the \`Link: rel="describedby"\` response header.

`data` object required

- `provider` string required
- `url` string <uri> 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 <uri>

Canonical JSON Schema URL for this response body. The server also sends it in the \`Link: rel="describedby"\` response header.

- `type` string required
- `title` string required
- `status` integer required
- `detail` string required
- `code` string required
- `pointer` string
- `details` object

Machine-readable context keyed by the error code.

- `suggestions` string[]

Recovery steps safe to show to a person.

- `next` string[]

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

- `requestId` string required

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

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

#### JavaScript

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

#### Python

```python
import requests

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

### Response

#### 200 default

```json
{
  "$schema": "http://example.com",
  "data": {
    "provider": "phpmyadmin",
    "url": "http://example.com"
  }
}
```

```json
{
  "$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"
}
```
