Update server

Update details of an existing server.


PATCH/api/servers/{server}

Update a server

This endpoint allows you to update the details of a server.

Required attributes

  • Name
    name
    Type
    string
    Description

    A string that represents your server name.

Optional attributes

  • Name
    ip
    Type
    string
    Description

    A valid IPv4 address.

  • Name
    ssh_port
    Type
    integer
    Description

    An integer representing your SSH port, default is 22. Required if ip is filled.

Request

PATCH
/api/servers/{server}
curl -X PATCH "https://ploi.io/api/servers/{server}" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "name": "awesome-server",
    "ip": "1.1.1.1",
    "ssh_port": 22
  }'

Response

{
  "data": {
    "id": 1,
    "status": "active",
    "type": "server",
    "database_type": "mysql",
    "name": "awesome-server",
    "ip_address": "1.1.1.1",
    "internal_ip": null,
    "ssh_port": 22,
    "reboot_required": false,
    "php_version": 8.2,
    "php_cli_version": "8.2",
    "mysql_version": 5.7,
    "sites_count": 0,
    "monitoring": false,
    "opcache": false,
    "installed_php_versions": ["8.2"],
    "updates": {
      "packages": 0,
      "security": 0
    },
    "description": null,
    "status_id": 2,
    "provider": {
      "id": 1,
      "name": "Katapult"
    },
    "created_at": "2023-08-13 19:23:58",
    "created_human": "1 week ago",
    "uptime_human": null
  }
}