---
title: "List website files and directories"
method: GET
path: "/api/hosting/v1/accounts/{username}/domains/{domain}/files"
tags: ["Hosting: Files"]
---

# List website files and directories

`GET /api/hosting/v1/accounts/{username}/domains/{domain}/files`

List files and directories under a website's document root.

Use `directory` to browse a subdirectory relative to the document root. Symlinked entries
are listed but never traversed into or resolved.

## Path parameters

- `username` string, required
- `domain` string, required

## Query parameters

- `directory` string
- `max_depth` integer, nullable
- `max_items` integer, nullable
- `offset` integer, nullable
- `file_types` string[]

## Response `200`

Success response

- HostingV1FilesFilesResource
  - `path` string, required — Listed directory, relative to the document root.
  - `items` object[], required — Entries found in the listed directory.
    - `name` string, required — Entry name.
    - `path` string, required — Entry path, relative to the document root.
    - `type` 'file' | 'directory' | 'symlink' | 'other', required — Entry type.
    - `size_bytes` integer, nullable, required — Entry size in bytes. Null for directories, symlinks, and other non-file entries.
  - `total_items` integer, required — Total number of entries matching the listing, across all pages.
  - `total_items_current_page` integer, required — Number of entries in this page.
  - `offset` integer, required — Number of entries skipped before this page.

## Other responses

- `401` — Unauthenticated response
- `422` — Validation error response
- `500` — Error response

---

[API](https://skmtc.net/hostinger/apis/hostinger-api.md) · [All operations](https://skmtc.net/hostinger/apis/hostinger-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hostinger/hostinger-api/revisions/3bf93dafc002/schema)
