Notifications

Setup notifications for your site

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

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 '{"slack_webhook_url":"https://hooks.slack.com.....", "discord_webhook_url":"https://discordapp.com/api/webhooks.....", "deploy_webhook_url": "https://my-url.com/webhooks....."}'

Example response:

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

{
    "data": {
        "id": 1,
        "server_id": 1,
        "domain": "domain1.com",
        "deploy_script": false,
        "web_directory": "/public",
        "project_type": null,
        "project_root": "/",
        "last_deploy_at": null,
        "system_user": null,
        "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"
    }
}