Ploi API
Ploi API

Create database

Creates a new database in your server

POST api/servers/{server}/databases

Parameters

Parameter Type Status Description
name string required Allowed: alpha-numeric characters, as well as dashes and underscores. Minimum: 2 Maximum: 64 Not in: database
user string optional Allowed: alpha-numeric characters, as well as dashes and underscores. Minimum: 2 Maximum: 64
password string optional Password to connect to your database
description string optional Ability to give your database a description for clarity (also shows in panel)
site_id integer optional Ability to attach a site to your database

Example request:

curl -X POST "https://ploi.io/api/servers/{server}/databases" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
    --data '{"name":"voluptas", "user":"voluptas", "password":"voluptas"}'

Example response:

HTTP/1.1 201 CREATED
Content-Type: application/json

{
    "data": {
        "id": 1,
        "type": "mysql",
        "name": "my_database",
        "server_id": 1,
        "status": "created",
        "created_at": "2019-07-16 13:05:58"
    }
}