Vhost Create

Creates a new virtual host configuration.

Request

Property Value
Method POST
URL /api/server/settings/vhosts
Content-Type application/json
Authentication Bearer Token

Request Body

Parameter Type Required Description
data.attributes.host string Yes Host binding ("*" for all interfaces or specific IP)
data.attributes.port integer Yes Port number
data.attributes.protocols string[] Yes Enabled protocols
data.attributes.isSSL boolean No SSL enabled
data.attributes.certificatePath string No Path to SSL certificate (required if isSSL is true)
data.attributes.certificatePassword string No SSL certificate password (required if isSSL is true)
data.attributes.isControlPanel boolean No Control panel endpoint

Example Request

{
  "data": {
    "attributes": {
      "host": "127.0.0.1",
      "port": 8093,
      "protocols": ["HTTP"],
      "isSSL": false,
      "isControlPanel": true
    }
  }
}

Example Request (with SSL)

{
  "data": {
    "attributes": {
      "host": "*",
      "port": 443,
      "protocols": ["WEBSOCKETS", "HTTP"],
      "isSSL": true,
      "certificatePath": "/path/to/certificate.p12",
      "certificatePassword": "password",
      "isControlPanel": false
    }
  }
}

Response

Status Codes

Code Description
201 Created - VHost successfully created
400 Bad Request - Invalid parameters
401 Unauthorized - Invalid or missing token
409 Conflict - Port already in use
429 Too Many Requests - Rate limit exceeded
500 Internal Server Error

Successful Response (201)

{
  "data": {
    "id": 3,
    "attributes": {
      "host": {
        "editable": true,
        "value": "127.0.0.1"
      },
      "port": {
        "editable": true,
        "value": 8093
      },
      "protocols": {
        "editable": true,
        "value": ["HTTP"]
      },
      "isSSL": {
        "editable": true,
        "value": true
      },
      "certificatePath": {
        "editable": true,
        "value": "/path/to/certificate.p12"
      },
      "certificatePassword": {
        "masked": true,
        "value": "p****d"
      },
      "isControlPanel": {
        "editable": true,
        "value": true
      }
    }
  },
  "meta": {
    "executionTime": 35,
    "generatedAt": 1764853683152
  },
  "message": "VHost added successfully"
}

Response Body

VHost

Parameter Type Description
data.id integer Unique identifier of the created VHost
data.attributes.host.value string Host binding
data.attributes.host.editable boolean Indicates if the field can be modified
data.attributes.host.lockedBy string Locked by environment variable (if present)
data.attributes.port.value integer Port number
data.attributes.port.editable boolean Indicates if the field can be modified
data.attributes.port.lockedBy string Locked by environment variable (if present)
data.attributes.protocols.value string[] Enabled protocols
data.attributes.protocols.editable boolean Indicates if the field can be modified
data.attributes.protocols.lockedBy string Locked by environment variable (if present)
data.attributes.isSSL.value boolean SSL enabled
data.attributes.isSSL.editable boolean Indicates if the field can be modified
data.attributes.isSSL.lockedBy string Locked by environment variable (if present)
data.attributes.certificatePath.value string Path to SSL certificate
data.attributes.certificatePath.editable boolean Indicates if the field can be modified
data.attributes.certificatePath.lockedBy string Locked by environment variable (if present)
data.attributes.certificatePassword.value string SSL certificate password (masked)
data.attributes.certificatePassword.masked boolean Indicates if the value is masked
data.attributes.isControlPanel.value boolean Control panel endpoint
data.attributes.isControlPanel.editable boolean Indicates if the field can be modified
data.attributes.isControlPanel.lockedBy string Locked by environment variable (if present)
message string Response status message

Metadata

Parameter Type Description
meta.executionTime integer Request processing time in milliseconds
meta.generatedAt integer Response generation timestamp (Unix timestamp in ms)

Error Response (4xx/5xx)

{
  "message": "Error message"
}

Error Response Body

Parameter Type Description
message string Human-readable error message