---
title: "List the subdomains"
method: GET
path: "/SubDomain/listsubdomains"
tags: ["SubDomain"]
---

# List the subdomains

`GET /SubDomain/listsubdomains`

This function lists the subdomains on the cPanel account, including the subdomains that the account's addon domains are parked on.

## Query parameters

- `regex` string
- `return_https_redirect_status` 0 | 1

## Response `200`

HTTP Request was successful.

- object
  - `data` object[] — One entry for each subdomain on the account, sorted by the `domainkey` value.
    - `basedir` string — The subdomain's document root, relative to the account's home directory.
    - `can_https_redirect` 0 | 1 — Whether the system can redirect the subdomain to `HTTPS`. The system only returns this field when you pass the `return_https_redirect_status` parameter. * `1` - The system can redirect the subdomain. * `0` - The system cannot redirect the subdomain.
    - `dir` string, path — The absolute path to the subdomain's document root.
    - `domain` string, domain — The subdomain's fully qualified domain name.
    - `domainkey` string — The subdomain in the underscore-separated `subdomain_rootdomain` form. Pass this value to the `SubDomain::delsubdomain` function to remove the subdomain.
    - `is_https_redirecting` 0 | 1 — Whether the system currently redirects the subdomain to `HTTPS`. The system only returns this field when you pass the `return_https_redirect_status` parameter. * `1` - The system redirects the subdomain. * `0` - The system does **not** redirect the subdomain.
    - `reldir` string — The subdomain's document root, relative to the account's home directory and prefixed with `home:`.
    - `rootdomain` string, domain — The domain that the subdomain belongs to.
    - `status` string — The subdomain's rewrite status, or the URL that it redirects to.
    - `subdomain` string — The subdomain's label, without the root domain.
    - `web_subdomain_aliases` string[] — The built-in service subdomain aliases, for example `www`, that the system serves for the subdomain.
  - `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)
