v1

latestOpenAPI 3.0.2cPanel License2026-08-06657427.1 MB
SubDomain

Return the subdomain validation pattern

This function retrieves the regular expression that the system uses to validate a subdomain label.

Note:

Use this value to validate a subdomain label in an interface before you call the SubDomain::addsubdomain function. It does not replace the server-side validation that SubDomain::addsubdomain performs.

get/SubDomain/validregex

Response

HTTP Request was successful.

datastring[]

A single-element array holding the validation pattern.

errorsstring[] nullable
messagesstring[] nullable
status0 | 1
  • 1 — Success.
  • 0 — Failed. Check the errors field for more details.
warningsstring[] nullable

Example response

{
  "data": [
    "^[A-Za-z0-9][A-Za-z0-9-]*$"
  ],
  "status": 1
}