Create server
Create server
Create a server.
POST api/servers
Parameters
| Parameter | Type | Status | Description |
|---|---|---|---|
| name | string | required | Maximum length: 40 characters. Can only contain alpha-numeric characters, as well as dashes and underscores |
| provider_id | integer | required | Must be the id of an existing provider. |
| provider_region_id | integer | required | Must be the id of an existing provider region. |
| provider_plan_id | integer | required | Must be the id of an existing provider plan. |
| database_type | string | required | Possible values are: mysql, mariadb, postgresql, postgresql13. |
| user_id | integer | required | Must be the id of an existing user. |
Example request:
curl -X POST "https://panel.example.hosting.com/api/servers" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
--data '{"name": "awesome-server", "provider_id": 1, "provider_region_id": 1, "provider_plan_id": "1", "database_type": "mysql", "user_id": 120}'
Example response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": {
"id": 1,
"status": "busy",
"name": "awesome-server",
"provider_id": 1,
"provider_region_id": 1,
"provider_plan_id": 1,
"database_type": "mysql",
"user_id": "120",
"created_at": "2022-07-23T13:35:51.000000Z"
},
}