Hosting: Files
Get website file content
Get a single file's content, relative to a website's document root.
Read-only; refuses symlinks, oversized files, non-text file types, and files identified as containing secrets (e.g. credential files) — none of these are returned by this endpoint.
get/api/hosting/v1/accounts/{username}/domains/{domain}/files/content
Path parameters
usernamestring required
Example:u123456789
domainstring required
Example:mydomain.tld
Domain name
Query parameters
pathstring required
Example:index.php
File path, relative to the document root.
from_lineinteger nullable
Line offset to start reading from.
max_linesinteger nullable
Example:1000
Max number of lines to return.
Response
Success response
Example response
{
"path": "index.php",
"content": "<?php\necho 'Hello world';\n",
"total_lines": 84,
"size_bytes": 2048
}