For the complete documentation index, see llms.txt. This page is also available as Markdown.

List website files and directories

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.

List website files and directories

get

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.

Authorizations
AuthorizationstringRequired

API Token authentication

Path parameters
usernamestringRequiredExample: u123456789
domainstringRequired

Domain name

Example: mydomain.tld
Query parameters
directorystringOptional

Directory path to check

Default: ""Example: blog
max_depthinteger · min: 1 · max: 10 · nullableOptional

How many directory levels deep to recurse.

Default: 5Example: 5
max_itemsinteger · min: 1 · max: 2000 · nullableOptional

Max number of entries to return in this page.

Default: 1000Example: 500
offsetinteger · nullableOptional

Number of entries to skip. Page with offset + item count until reaching total_items.

Default: 0Example: 0
Responses
200

Success response

application/json
pathstringRequired

Listed directory, relative to the document root.

Example: wp-content
total_itemsintegerRequired

Total number of entries matching the listing, across all pages.

Example: 42
total_items_current_pageintegerRequired

Number of entries in this page.

Example: 20
offsetintegerRequired

Number of entries skipped before this page.

Example: 0
get/api/hosting/v1/accounts/{username}/domains/{domain}/files
GET /api/hosting/v1/accounts/{username}/domains/{domain}/files HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "path": "wp-content",
  "items": [
    {
      "name": "index.php",
      "path": "wp-content/index.php",
      "type": "file",
      "size_bytes": 512
    }
  ],
  "total_items": 42,
  "total_items_current_page": 20,
  "offset": 0
}

Last updated

Was this helpful?