latestOpenAPI 3.0.0raw.githubusercontent.com2026-08-213564581.3 MB

3bf93dafc002

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

pathstring required

File path, relative to the document root.

contentstring required

File content for the requested line range.

from_lineinteger required

Line offset the returned content starts from.

total_linesinteger required

Total number of lines in the file.

size_bytesinteger required

Total file size in bytes.

Example response

{
  "path": "index.php",
  "content": "<?php\necho 'Hello world';\n",
  "total_lines": 84,
  "size_bytes": 2048
}