Ploi Core
Ploi Core

Create site

Create site

Create a site.

POST api/sites

Parameters

Parameter Type Status Description
server_id integer required Must be the id of an existing server.
domain string required Must be a valid domain. Must match the following regular expression: "/^(?!\-)(?:[a-zA-Z\d\-]{0,62}[a-zA-Z\d]\.){1,126}(?!\d+)[a-zA-Z\d]{1,63}$/".
user_id integer required Must be the id of an existing user.

Example request:

curl -X POST "https://panel.example.hosting.com/api/sites" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
   --data '{"server_id": 146, "domain": "domain.com", "user_id": 120}'

Example response:

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

{
    "data": {
        "id": 1,
        "status": "busy",
        "server_id": 146,
        "domain": "domain.com",
        "user_id": "120",
        "created_at": "2022-07-23T13:35:51.000000Z"
    },
}