Ploi API
Ploi API

Create system user

Create a script

POST api/servers/{server}/system-users

Parameters

Parameter Type Status Description
name string required The name of the system users you want to create
sudo boolean optional Whether if the user should have sudo access or not
receive_password boolean optional Whether to receive the sudo password in the response or not, default false

Example request:

curl -X POST "https://ploi.io/api/servers/1/system-users" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
   --data '{"name":"customer", "sudo" : false}'

Example response:

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

{
    "data": {
        "id": 1,
        "name": "customer",
        "root": "/home/customer",
        "created_at": "2020-01-01 12:00:00"
    }
}

Example response when receive password is set to true:

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

{
    "data": {
        "id": 1,
        "name": "customer",
        "root": "/home/customer",
        "created_at": "2020-01-01 12:00:00"
    },
      "password": "LYn8r1B9BPt0RXbfZv8rezUM"
}