API Documentation

List Webspace Databases

Lists the MariaDB databases of a webspace. Each has a number: the :n the other database endpoints take in their path. 0 is the database an installed application uses.

Request

Required scope: webspace:db · Role: Collaborator or higher on the webspace

Path Parameters

Parameter Type Description
id string The webspace ID

Headers

Header Required Value
Authorization Yes Bearer YOUR_API_KEY

Response

{
  "data": {
    "databases": [
      { "database": 0, "name": "ws_0862c_db0", "bytes": 48234496 },
      { "database": 1, "name": "ws_0862c_db1", "bytes": 0 }
    ]
  }
}

Response Fields

Field Type Description
database number The number of the database, 0 to 99
name string Its name on the server
bytes number Its size. All databases count into the webspace's storage

Errors

Status Code Description
403 FORBIDDEN The API key lacks the webspace:db scope, or you are not at least Collaborator on the webspace
404 NOT_FOUND The webspace does not exist or is not among the resources the API key is restricted to
429 RATE_LIMITED More than 120 requests within a minute

Example

curl "https://site.quest/api/v1/webspaces/69e80ac1ab57a244bb5273fd/databases" \
  -H "Authorization: Bearer YOUR_API_KEY"

MCP

This action is also available via the webspace_db_list MCP tool.

Create Webspace Database

Creates a new, empty MariaDB database on a webspace, with an account of its own that reaches only this database. The password is returned once; it is not stored anywhere. There is no fixed number of databases: all of them count into the webspace's storage and go into its backups.

Request

Required scope: webspace:db · Role: Administrator or Owner on the webspace

Path Parameters

Parameter Type Description
id string The webspace ID

Headers

Header Required Value
Authorization Yes Bearer YOUR_API_KEY

No request body is required.

Response

201 Created

{
  "data": {
    "database": 1,
    "dbHost": "localhost",
    "dbName": "ws_0862c_db1",
    "dbUser": "ws_0862c_u1",
    "dbPassword": "Z9v…"
  }
}

Response Fields

Field Type Description
database number The number of the new database, for the other endpoints
dbHost string Always localhost: the database is reachable from inside the webspace only
dbName string The database's name
dbUser string Its account
dbPassword string Returned only once. A new one: Reset Database Password

Errors

Status Code Description
403 FORBIDDEN The API key lacks the webspace:db scope, or you are not Administrator or Owner on the webspace
404 NOT_FOUND The webspace does not exist or is not among the resources the API key is restricted to
409 CONFLICT The webspace's storage is full, or it already has 100 databases
429 RATE_LIMITED More than 6 requests within a minute
502 PROVIDER The webspace's server cannot create databases right now

Example

curl -X POST "https://site.quest/api/v1/webspaces/69e80ac1ab57a244bb5273fd/databases" \
  -H "Authorization: Bearer YOUR_API_KEY"

MCP

This action is also available via the webspace_db_create MCP tool. The MCP tool answers with a one-time link to the dashboard instead of the password, unless "Hide secrets from the AI model" is off for the key or app (see Authorization). This REST endpoint always returns the value.

Drop Webspace Database

Drops one MariaDB database of a webspace for good, with every table in it and its account. This cannot be undone; a backup of the webspace or an earlier export brings it back. A website whose application runs on the database stops working.

Request

Required scope: webspace:db · Role: Administrator or Owner on the webspace

Path Parameters

Parameter Type Description
id string The webspace ID
n number The number of the database, from List Webspace Databases

Query Parameters

Parameter Type Required Description
name string Yes The database's full name, e.g. ws_0862c_db1: the confirmation that the right one is meant

Headers

Header Required Value
Authorization Yes Bearer YOUR_API_KEY

Response

{
  "data": {
    "database": 1,
    "dbName": "ws_0862c_db1",
    "remaining": 1
  }
}

Response Fields

Field Type Description
remaining number The databases the webspace has left

Errors

Status Code Description
400 VALIDATION n is not 0 to 99, or name is not the name of database n
400 MISSING_CONFIRM name is missing
403 FORBIDDEN The API key lacks the webspace:db scope, or you are not Administrator or Owner on the webspace
404 NOT_FOUND The webspace or database n does not exist, or the webspace is not among the resources the API key is restricted to
429 RATE_LIMITED More than 6 requests within a minute
502 PROVIDER The webspace's server could not drop the database

Example

curl -X DELETE "https://site.quest/api/v1/webspaces/69e80ac1ab57a244bb5273fd/databases/1?name=ws_0862c_db1" \
  -H "Authorization: Bearer YOUR_API_KEY"

MCP

This action is also available via the webspace_db_drop MCP tool. It always asks for your approval first.

Read Database Tables and Structure

Without table: the tables and views of a database with engine, estimated rows and size. With table: that table's columns, indexes and foreign keys, its number of rows and the key that names one row. Reads with an account that can only read.

Request

Required scope: webspace:db · Role: Collaborator or higher on the webspace

Path Parameters

Parameter Type Description
id string The webspace ID
n number The number of the database; 0 is the one an installed application uses

Query Parameters

Parameter Type Required Description
table string No A table or view from the list

Headers

Header Required Value
Authorization Yes Bearer YOUR_API_KEY

Response without table

{
  "data": {
    "database": 0,
    "databaseName": "ws_0862c_db0",
    "tables": [
      { "name": "wp_posts", "kind": "table", "engine": "InnoDB", "rowEstimate": 184, "bytes": 1622016, "collation": "utf8mb4_unicode_520_ci", "comment": "" }
    ]
  }
}

rowEstimate is the server's estimate; exact only for some engines. kind is table or view.

Response with table

{
  "data": {
    "database": 0,
    "table": "wp_posts",
    "rows": 184,
    "key": ["ID"],
    "columns": [
      { "name": "ID", "type": "bigint(20) unsigned", "nullable": false, "default": null, "key": "PRI", "extra": "auto_increment", "comment": "" }
    ],
    "indexes": [
      { "name": "post_author", "unique": false, "type": "BTREE", "columns": ["post_author"] }
    ],
    "foreignKeys": []
  }
}

Response Fields

Field Type Description
rows number | null The exact number of rows; null when it could not be counted in time
key string[] | null The columns that name one row (primary key, else a unique key without NULL); null when there is none
columns[].key string PRI, UNI, MUL or empty
foreignKeys[] object name, columns, refTable, refColumns

Errors

Status Code Description
400 VALIDATION n is not 0 to 99, or table is not a valid name
403 FORBIDDEN The API key lacks the webspace:db scope, or you are not at least Collaborator on the webspace
404 NOT_FOUND The webspace, database n or the table does not exist, or the webspace is not among the resources the API key is restricted to
429 RATE_LIMITED More than 120 requests within a minute
502 PROVIDER The database answered with an error, or the webspace's server does not offer this yet

Example

curl "https://site.quest/api/v1/webspaces/69e80ac1ab57a244bb5273fd/databases/0/schema?table=wp_posts" \
  -H "Authorization: Bearer YOUR_API_KEY"

MCP

This action is also available via the webspace_db_schema MCP tool.

Run SQL in a Webspace Database

Runs one or more SQL statements in a database of a webspace, with the rights of that database's own account: it reaches this one database only. With readOnly it runs with an account that can only read. Every request is a session of its own: USE, SET, temporary tables and open transactions end with it, so put START TRANSACTION … COMMIT into one request.

Request

Required scope: webspace:db · Role: Administrator or Owner on the webspace

Path Parameters

Parameter Type Description
id string The webspace ID
n number The number of the database; 0 is the one an installed application uses

Headers

Header Required Value
Authorization Yes Bearer YOUR_API_KEY
Content-Type Yes application/json

Body

Field Type Required Description
sql string Yes One or more statements separated by ;, up to 200,000 characters
readOnly boolean No Run with the account that can only read
rows number No Rows returned per statement, 1 to 10,000. Default 500
{ "sql": "SELECT ID, post_title FROM wp_posts WHERE post_status = 'publish' LIMIT 2", "readOnly": true }

The statements run in order; the first that fails ends the run. A statement ends after 30 seconds. A failed statement is part of the answer, not an HTTP error. The REST API asks no confirmation for DROP, TRUNCATE or a DELETE without WHERE: check your SQL before you send it.

Response

{
  "data": {
    "database": 0,
    "statements": [
      {
        "kind": "rows",
        "columns": [
          { "name": "ID", "table": "wp_posts", "type": "bigint", "key": "primary", "nullable": false, "binary": false },
          { "name": "post_title", "table": "wp_posts", "type": "text", "key": null, "nullable": false, "binary": false }
        ],
        "rows": [["1", "Hallo Welt"], ["2", "Über uns"]],
        "rowCount": 2,
        "cut": false
      }
    ],
    "truncated": false,
    "timedOut": false,
    "ms": 4
  }
}

Statement Results

kind Fields Meaning
rows columns, rows, rowCount, cut, error? A statement that returned rows. rowCount counts all of them, rows holds those within the limit; cut says some were left out. error is set when it ended early
change affected, insertId, info, warnings A statement that changed rows or the schema
error error.code, error.sqlstate, error.message The database's error, e.g. 1064 for a syntax error

Values are strings (numbers too, so nothing is rounded) or null. A long text comes as { "text": "…", "bytes": 123456 }, a binary value as { "hex": "…", "bytes": 2048 }. truncated is true when rows were left out anywhere; timedOut when a statement ran past its time.

Errors

Status Code Description
400 INVALID_BODY The body is not valid JSON
400 VALIDATION n is not 0 to 99, sql is empty or too long, or rows is out of range
403 FORBIDDEN The API key lacks the webspace:db scope, or you are not Administrator or Owner on the webspace
404 NOT_FOUND The webspace or database n does not exist, or the webspace is not among the resources the API key is restricted to
429 RATE_LIMITED More than 60 requests within a minute
502 PROVIDER The webspace's server does not offer SQL yet, or could not be reached

Example

curl -X POST "https://site.quest/api/v1/webspaces/69e80ac1ab57a244bb5273fd/databases/0/query" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"sql": "SELECT COUNT(*) FROM wp_posts", "readOnly": true}'

MCP

This action is also available via the webspace_db_query MCP tool. It answers with the rows as a text table and asks for your approval before DROP, TRUNCATE, ALTER and an UPDATE or DELETE without WHERE.

Reset Database Password

Generate a new MariaDB password. The plaintext is returned once — store it immediately.

Request

:n is the number of the database (from GET /api/v1/webspaces/:id/databases); 0 is the one an installed application uses.

Required scope: webspace:manage

Headers

Header Required Value
Authorization Yes Bearer YOUR_API_KEY

Response

{
  "data": {
    "id": "69e80ac1...",
    "database": 0,
    "subdomain": "ws-0862c.sitequest.eu",
    "dbName": "ws_0862c_db",
    "dbUser": "ws_0862c",
    "dbPassword": "Z9v…",
    "dbHost": "localhost",
    "warning": "Store this password now — it will not be shown again."
  }
}

Response Fields

Field Type Description
dbPassword string Returned only once. Cannot be retrieved later.
dbHost string MariaDB host. Always localhost (only reachable from inside the webspace).

Example

curl -X POST https://site.quest/api/v1/webspaces/69e80ac1.../databases/0/password \
  -H "Authorization: Bearer sq_live_..."

MCP

This action is also available via the webspace_reset_db_password MCP tool. The MCP tool answers with a one-time link to the dashboard instead of the value, unless "Hide secrets from the AI model" is off for the key or app (see Authorization). This REST endpoint always returns the value.