Create server

Creates a new server in your account. To be able to do this properly you will need 3 key values: plan, region and credential.

These values are available here: Get server providers

You will also need to have server providers added to your account to be able to retrieve these. Setup new server providers in your account here: Server providers

Required scopes

Create servers


POST/api/servers

Create a server

Creates a new server with the specified configuration.

Required attributes

  • Name
    plan
    Type
    string
    Description

    The plan ID to install the server with.

  • Name
    region
    Type
    string
    Description

    The region where to install the server with.

  • Name
    credential
    Type
    integer
    Description

    The server provider from your account - Get server providers

  • Name
    type
    Type
    string
    Description

    Type of the server to install, must be either: server, load-balancer, database-server or redis-server

  • Name
    database_type
    Type
    string
    Description

    The type of database to install, must be either: none, mysql, mariadb, postgresql or postgresql13

  • Name
    webserver_type
    Type
    string
    Description

    The type of webserver to install, must be either: nginx or nginx-docker

  • Name
    php_version
    Type
    string
    Description

    The PHP version installed, only applicable on the server type. Must be any of these values: 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4

Optional attributes

  • Name
    name
    Type
    string
    Description

    The server name, cannot contain any special characters and is alpha-numeric, if left empty a random name will be used.

  • Name
    os_type
    Type
    string
    Description

    The OS version, defaults to the latest version available, available options: ubuntu-22-04-lts, ubuntu-24-04-lts

  • Name
    description
    Type
    string
    Description

    Allows you to send in an additional description for your server as note.

  • Name
    install_monitoring
    Type
    boolean
    Description

    Allows you to install Ploi monitoring as well, requires Pro plan or higher.

  • Name
    webhook_url
    Type
    url
    Description

    This URL gets triggered by Ploi when installation has completed, you can use this for your own system, this will only send 1 signal, there is no retry schedule.

Request

POST
/api/servers
curl -X POST "https://ploi.io/api/servers" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "name": "awesome-server",
    "plan": "1xCPU-1GB",
    "region": "nl-ams1",
    "credential": 1,
    "type": "server",
    "database_type": "mysql",
    "webserver_type": "nginx"
  }'

Response

{
  "data": {
    "id": 2,
    "status": "created",
    "type": "server",
    "name": "awesome-server",
    "ip_address": "12.34.56.78",
    "php_version": "8.4",
    "mysql_version": "8.0",
    "sites_count": 0,
    "monitoring": false,
    "status_id": 0,
    "created_at": "2019-01-01 09:00:00"
  }
}

Webhook URL data

When you provide a webhook_url, Ploi will send a POST request to that URL when the server installation has completed.

Webhook payload

{
  "message": "Server installation has completed",
  "server": {
    "id": 1,
    "name": "calm-breeze"
  }
}