Create site
Create a site in your server
POST api/servers/{server}/sites
Parameters
Parameter | Type | Status | Description |
---|---|---|---|
root_domain | string | required | Maximum: 100 |
web_directory | string | required | Maximum: 50 Must match this regular expression: /[a-zA-Z0-9\/]/ |
project_root | string | optional | Maximum: 50 Must match this regular expression: /[a-zA-Z0-9\/]/ |
system_user | string | optional | Must be a string matching the name of a system user in your server |
webserver_template | integer | optional | The ID of your webserver template saved in your account to create site with this template |
Example request:
curl -X POST "https://ploi.io/api/servers/{server}/sites" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
--data '{"root_domain":"domain.com", "web_directory":"/public", "system_user": "ploi"}'
Example response:
HTTP/1.1 201 CREATED
Content-Type: application/json
{
"data": {
"id": 1,
"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": true,
"created_at": "2019-07-29 10:27:32"
}
}