Skip to main content
POST
Create a database

Authorizations

Authorization
string
header
required

Send your API token as Authorization: Bearer <api-token>.

Query Parameters

teamID
string

Run the request in the context of a team you belong to, instead of your personal account. 24-character hexadecimal ID.

Pattern: ^[0-9a-fA-F]{24}$

Body

application/json
hostname
string
required

The database's name, also its hostname inside the network. Lowercase letters, digits and hyphens; not all digits, and not localhost.

Required string length: 3 - 50
Pattern: ^[a-z0-9][a-z0-9\-]+[a-z0-9]$
type
enum<string>
required
Available options:
mysql,
mariadb,
postgres,
mongodb,
redis,
mssql,
elasticsearch,
rabbitmq,
clickhouse
planID
enum<string>
required

The database's resource plan. small-g2 and medium-g2 don't support mssql or clickhouse, and small-g2 doesn't support elasticsearch. See Liara's pricing page for what each plan includes.

Available options:
small-g2,
medium-g2,
standard-base-g2,
standard-pro-g2,
pro-g2,
pro-plus-g2,
pro-max-g2
bundlePlanID
enum<string>
required

The bundle plan, which sets backups, metrics retention, editable settings and public network access.

Available options:
basic,
standard,
pro
network
string
required

ID of one of your networks.

Pattern: ^[0-9a-fA-F]{24}$
version
string

One of the version values for this type from GET /v1/databases/versions. Defaults to the newest.

publicNetwork
boolean
default:true

Make the database reachable from the internet. Ignored if the bundle plan doesn't allow it.

options
object

Type-specific options:

  • mysql, mariadb: rootPassword (otherwise one is generated), defaultDBName, eventScheduler (ON or OFF)
  • mongodb: standaloneReplicaSet (boolean, default false)
  • postgres: postgis, pgvector (booleans, default false)
  • mssql: FTS (full-text search, boolean, default false)
backupSourceId
string

ID of the database whose backup to start from. Send together with backupToRestoreName.

Pattern: ^[0-9a-fA-F]{24}$
backupToRestoreName
string

The backup's name from GET /v1/databases/{databaseID}/backups of the source database.

Maximum string length: 100

Response

The database is being created.

databaseID
string