Ploi API
Ploi API

List sites

List all the sites for a specific server

GET api/servers/{server}/sites

Example request:

curl -X GET "https://ploi.io/api/servers/{server}/sites" \
-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": 146,
            "domain": "domain1.com",
            "deploy_script": false,
            "web_directory": "/public",
            "project_type": "wordpress",
            "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": false,
            "created_at": "2019-07-29 10:27:30"
        },
        {
            "id": 2,
            "status": "active",
            "server_id": 146,
            "domain": "domain2.com",
            "deploy_script": "cd \/home\/ploi\/domain2.com\ngit pull origin master\ncomposer install --no-interaction --prefer-dist --optimize-autoloader\necho \"\" | sudo -S service php7.2-fpm reload\n\necho \"? Application deployed!\"",
            "web_directory": "/public",
            "project_type": "laravel",
            "project_root": "/",
            "last_deploy_at": "2019-07-30 09:33:55",
            "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"
        },
        {
            "id": 3,
            "status": "active",
            "server_id": 146,
            "domain": "domain3.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": false,
            "created_at": "2019-07-29 10:27:33"
        },
        {
            "id": 4,
            "status": "active",
            "server_id": 1,
            "domain": "domain4.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": false,
            "created_at": "2019-07-31 08:23:54"
        }
    ],
    "links": {
        "first": "http://ploi.io/api/servers/1/sites?page=1",
        "last": "http://ploi.io/api/servers/1/sites?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "http://ploi.test/api/servers/1/sites",
        "per_page": 15,
        "to": 4,
        "total": 4
    }
}