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 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.
API Token authentication
u123456789Domain name
mydomain.tldDirectory path to check
""Example: blogHow many directory levels deep to recurse.
5Example: 5Max number of entries to return in this page.
1000Example: 500Number of entries to skip. Page with offset + item count until reaching total_items.
0Example: 0Success response
Listed directory, relative to the document root.
wp-contentTotal number of entries matching the listing, across all pages.
42Number of entries in this page.
20Number of entries skipped before this page.
0Unauthenticated response
Validation error response
Error response
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?