Ploi API
Ploi API

Update site

Updates a site in your server if the parameter is present in the request.

Parameters that you can pass in here below, do not always update on runtime. For example, changing a root domain takes a little bit of work so this happens in the background. This is why we've added the "On-demand" table header to clarify if an update is instant, or not.

PATCH api/servers/{server}/sites/{site}

Parameters

Parameter Type Status Description On-demand
root_domain string optional Maximum: 100, cannot be used already in your server, must be unique No

Example request:

curl -X PATCH "https://ploi.io/api/servers/{server}/sites/{site}" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
   --data '{"root_domain":"domain.com"}'

Example response:

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

{
    "data": {
        "id": 1,
        "server_id": 1,
        "domain": "example.com",
        "deploy_script": false,
        "web_directory": "/public",
        "project_type": null,
        "project_root": "/",
        "last_deploy_at": null,
        "system_user": "ploi",
        "php_version": 7.2,
        "health_url": null,
        "notification_urls": {
            "slack": null,
            "discord": null,
            "webhook": null
        },
        "has_repository": true,
        "created_at": "2019-07-29 10:27:32"
    },
    "message": "Site domain is being updated from example.com to domain.com"
}