Get file content from your web hosting.

Retrieve the content of a specific file on your web hosting account. This is only available for web hosting accounts.

Web Hosting Services Hosting Accounts

Context

Where to get IDs / values

Path Parameters

accountId integer · min: 1 required Example: 20000

Unique account identifier

Headers

Accept Example
Content-Type Example

Body

required
application/json
dir string required · Example: public_html
file string required · Example: .htaccess

Responses

200
data object required
data.accountId string required · Example: 20000
data.content string required · Example: RewriteOptions inherit # BEGIN WordPress # Direktiven (raderna) mellan ”BEGIN WordPress...
data.cpanelUsername string required · Example: xkqjm
data.dir string required · Example: public_html
data.file string required · Example: .htaccess
data.success boolean required · Example: true

True for successful responses.

requestId string required · Example: 2121ae20-bd9d-41e9-aeeb-5dd1dd1a24ba

Unique request identifier (UUID).

success boolean required · Example: true

True for successful responses.

timestamp string required · Example: 2026-02-10T00:00:00.000Z

ISO 8601 timestamp (UTC).

POST https://cloud.hostup.se/api/hosting/{accountId}/files/read
For AI assistants
cURL
curl -X POST "https://cloud.hostup.se/api/hosting/20000/files/read" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "dir": "public_html",
    "file": ".htaccess"
  }'
Response
{
  "success": true,
  "timestamp": "2026-02-10T00:00:00.000Z",
  "requestId": "2121ae20-bd9d-41e9-aeeb-5dd1dd1a24ba",
  "data": {
    "success": true,
    "accountId": "20000",
    "cpanelUsername": "xkqjm",
    "dir": "public_html",
    "file": ".htaccess",
    "content": "RewriteOptions inherit # BEGIN WordPress\n# Direktiven (raderna) mellan ”BEGIN WordPress” och ”END WordPress” är\n# dynamiskt genererade och bör endast ändras via WordPress-filter.\n# Eventuella ändringar av direktiven mellan dessa markörer kommer att skrivas över.\n<IfModule mod_rewrite.c>\nRewriteEngine On\nRewriteRule.* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]\nRewriteBase /\nRewriteRule ^index\\.php$ - [L]\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule...."
  }
}
Request Body Example 1
{
  "dir": "public_html",
  "file": ".htaccess"
}