Ploi API
Ploi API

Reset site permissions

Resets site permissions for your site if owner has changed

What will happen:

By running this endpoint, the system will automatically reset the file and directory permissions for your site to a default, secure state. This will include setting the ownership for all applicable files and directories to predetermined user and group settings.

Why you might need this:

  • You've accidentally changed permissions and can't access certain files.
  • Your site is experiencing issues due to incorrect file or directory permissions.
  • You want to ensure that your site's files are securely configured.


  • Overwriting Customizations: If you have customized permissions for specific reasons, this reset will overwrite those settings.
  • Immediate Impact: This action will take effect immediately and could potentially disrupt your site if it is currently operating with custom permissions.
  • No Undo: While this action is intended to be safe, there is no straightforward way to "undo" it once initiated.
  • Security: This feature is designed to set permissions to a known, secure configuration. However, use it judiciously to minimize unexpected behaviors.

POST api/servers/{server}/sites/{id}/test-domain

Example request:

curl -X POST "{server}/sites/{id}/permission-reset" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

    "data": {
        "id": 1,
        "status": "active",
        "server_id": 1,
        "domain": "",
        "test_domain": null,
        "deploy_script": "cd /home/ploi/\ngit pull origin main\ncomposer install --no-interaction --prefer-dist --optimize-autoloader\necho \"\" | sudo -S service php8.2-fpm reload\n\necho \"🚀 Application deployed!\"\n",
        "deploy_webhook_url": "",
        "web_directory": "/public",
        "project_type": "laravel",
        "project_root": "/",
        "last_deploy_at": "2023-09-05 07:39:57",
        "system_user": "ploi",
        "php_version": 8.2,
        "health_url": null,
        "disable_robots": false,
        "has_repository": false,
        "zero_downtime_deployment": false,
        "has_staging": false,
        "fastcgi_cache": false,
        "notes": null,
        "created_at": "2023-08-29 12:08:10"
    "message": "Site permissions are being reset in the background"