# Create database for a web hosting package

> A new database for one web hosting package - MariaDB unless asked otherwise.

- Effect: Write - Changes the account. Agents ask first.
- Idempotent: no
- Stability: beta
- MCP tool: `manitu_webhosting_web_database_create` on https://mcp.manitu.de/mcp
- REST: `POST https://api.manitu.de/v1/webhosting/web/database/create`
- Needs: `service_webhosting`
- Page: /reference/webhosting/web/database/create/

**Changes the account. Agents say what will happen and wait for an explicit yes before calling it.**

## MCP tool

`manitu_webhosting_web_database_create`

### Description for the model

Creates a database for a web hosting package of the manitu customer account this connection works in, by its site_id from manitu_webhosting_list: on a MariaDB server unless server_type says mysql or postgres, with a description. manitu makes the name, the user and the password; the answer gives host, name and user - the password itself is NOT given here (secrets_withheld), the customer finds it in the customer panel. Check count_max in manitu_webhosting_web_database_list first. Refused with a conflict when the package allows no more databases (limit_reached), has no server of that kind (server_type_not_available) or cannot be changed now (not_configurable).

### Arguments

- `site_id` (integer | string, required) - The site_id from manitu_webhosting_list - never guess one. (pattern `"^[1-9][0-9]*$"`; minimum `1`)
- `server_type` (string) - The kind of database server. Default: mariadb. (one of `"mariadb"`, `"mysql"`, `"postgres"`)
- `description` (string | null) - The customer's description, for his own overview - e.g. which website uses it. Left out: unchanged (set) or none (create); null or empty: none. (maxLength `1024`)

### Example

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "manitu_webhosting_web_database_create",
    "arguments": {
      "site_id": 12345
    }
  }
}
```

## REST

`POST https://api.manitu.de/v1/webhosting/web/database/create`

### Authentication

One of `X-API-Key`, `Authorization: Bearer …` - never more than one in a request.

### Request body

JSON; unknown fields are refused.

- `site_id` (integer | string, required) - The site_id from manitu_webhosting_list - never guess one. (pattern `"^[1-9][0-9]*$"`; minimum `1`)
- `server_type` (string) - The kind of database server. Default: mariadb. (one of `"mariadb"`, `"mysql"`, `"postgres"`)
- `description` (string | null) - The customer's description, for his own overview - e.g. which website uses it. Left out: unchanged (set) or none (create); null or empty: none. (maxLength `1024`)

### Response

In `data`; the rest of the body as on every call.

- `database_id` (integer, required) - The database - what the other database tools take.
- `server_type` (string | null, required) - The kind of database server: mariadb, mysql or postgres; null if it cannot be told right now. (one of `"mariadb"`, `"mysql"`, `"postgres"`, `null`)
- `hostname` (string, required) - The database server to connect to - from the web hosting package's own scripts.
- `name` (string, required) - The name of the database (db<number>).
- `username` (string, required) - The user to connect with (u<number>).
- `description` (string | null, required) - What the customer wrote about it (his description), null if nothing - not its name or user name.
- `password_stored` (boolean, required) - manitu still knows the password. false: the customer had it forgotten - the database keeps it, dumps and copies need a new one (set with password_action regenerate).
- `table_count` (integer | null, required) - How many tables it has, as last counted; null if never counted.
- `data_size_mb` (integer | null, required) - How much data and indexes it holds in MB (rounded down), as reported by the database server when last counted; the files on disk can be larger. null if never counted.
- `counted_at` (string | null, required) - When table_count and data_size_mb were counted. (format `date-time`)
- `created_at` (string | null, required) - When it was created. (format `date-time`)
- `password` (string | null, required) - The password - a secret; null where it is withheld (secrets_withheld) or not stored (password_stored).
- `secrets_withheld` (boolean, required) - The password is left out here (an answer to an agent) - the customer finds it in the customer panel.

### Statuses

- `200` Success.
- `400` The request does not match the declared input schema.
- `401` No credential was presented, or it was not recognised.
- `403` The credential is not permitted to use this operation.
- `500` The server failed. Nothing about the request was wrong. Whether a change took effect is not known - check before trying it again.
- `503` The channel this operation forwards through is unavailable.

### Example

```sh
curl -X POST 'https://api.manitu.de/v1/webhosting/web/database/create' \
  -H 'X-API-Key: $API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"site_id":12345}'
```

## Example result

```json
{
  "database_id": 12345,
  "server_type": "mariadb",
  "hostname": "server.example.com",
  "name": "example.com",
  "username": "string",
  "description": "Example",
  "password_stored": true,
  "table_count": 1,
  "data_size_mb": 1,
  "counted_at": "2026-10-23T12:00:00+02:00",
  "created_at": "2026-10-23T12:00:00+02:00",
  "password": "correct-horse-battery",
  "secrets_withheld": true
}
```
