---
title: "Return the subdomain validation pattern"
method: GET
path: "/SubDomain/validregex"
tags: ["SubDomain"]
---

# Return the subdomain validation pattern

`GET /SubDomain/validregex`

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.

## Response `200`

HTTP Request was successful.

- object
  - `data` string[] — A single-element array holding the validation pattern.
  - `errors` string[], nullable
  - `messages` string[], nullable
  - `metadata` object
    - `transformed` integer
  - `status` 0 | 1 — * `1` — Success. * `0` — Failed. Check the `errors` field for more details.
  - `warnings` string[], nullable

---

[API](https://skmtc.net/cpanel/apis/cpanel-uapi.md) · [All operations](https://skmtc.net/cpanel/apis/cpanel-uapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cpanel/cpanel-uapi/revisions/632e2f8e6d04/schema)
