Ploi API
Ploi API

Create database user

Creates a new user in your database

POST api/servers/{server}/databases/{database}/users

Parameters

Parameter Type Status Description
user string required Allowed: alpha-numeric characters, no dashes allowed.
password string required
remote boolean optional Tells if the user should be remote accessible
remote_ip string optional, required if remote is true The IP address this user connects from
readonly boolean optional If the created user should only have readonly rights

Example request:

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

Example response:

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

{
    "data": {
        "id": 1,
        "user": "my_user",
        "remote": false,
        "remote_ip": "%",
        "readonly": false,
        "created_at": "2022-02-16 10:45:34"
    }
}