Update site

Update a site on your server.


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

Update site

This endpoint allows you to update a site on your server if the parameter is present in the request.

Optional parameters

  • Name
    root_domain
    Type
    string
    Description

    The new domain name. Maximum: 100 characters. Must be unique on your server. Not instant - processed in background.

Request

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

Response

{
  "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"
}