---
title: "Return a domain's document root"
method: GET
path: "/DomainLookup/getdocroot"
tags: ["DomainLookup"]
---

# Return a domain's document root

`GET /DomainLookup/getdocroot`

This function retrieves the document root for a single domain on the
cPanel account.

**Note:**

If the domain does not exist on the account, the system returns the
account's `public_html` directory rather than an error.

## Query parameters

- `domain` string, domain

## Response `200`

HTTP Request was successful.

- object
  - `data` object[] — A single entry for the requested domain.
    - `docroot` string, path — The absolute path to the domain's document root.
    - `reldocroot` string — The domain's document root, relative to the account's home directory.
  - `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/versions/632e2f8e6d04/schema)
