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.

  • Name
    tags
    Type
    array
    Description

    Replace the tags of the site, for example ["proxy", "client-a"]. Send the full list: tags you leave out are removed, and [] removes all tags. Maximum: 50 tags of 100 characters each, no duplicates.

  • Name
    notes
    Type
    string
    Description

    Replace the notes of the site, the same notes you see in the panel. Maximum: 500 characters. Send null to remove them.

  • Name
    deployment_type
    Type
    string
    Description

    Switch how the site gets deployed. Options: default, custom. custom enables custom deployments with a default deploy script, which is only possible while no git repository is attached. default turns custom deployments off again and removes their deployment history; a site with a git repository keeps it.

  • Name
    zero_downtime_deployment
    Type
    boolean
    Description

    Enable or disable zero downtime deployment for this site. Requires a repository to be attached to the site, and a subscription plan that includes zero downtime deployments. When enabling, your deploy script is automatically rewritten to run inside the {RELEASE} directory and the PHP-FPM reload is moved to the post deploy script.

  • Name
    disable_robots
    Type
    boolean
    Description

    Block or allow search engine robots for this site by injecting an X-Robots-Tag header in the NGINX configuration.

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",
    "tags": ["proxy"],
    "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,
    "deployment_type": "default",
    "notes": "Proxy for the client portal",
    "created_at": "2019-07-29 10:27:32"
  },
  "message": "Site domain is being updated from example.com to domain.com"
}