Read a website's error logs
GET /api/v2/shared-hosting/{accountId}/logs/error-log
Read the newest lines of a website’s error logs on a web hosting account. The call searches the website’s folder for error_log and *.log files and reads the five most recently written. It also reads the account’s PHP error log in logs/, filtered to the lines about this website. webServer holds the web server’s own lines for the website, such as a refused file or a served 503 page. Passwords, keys and tokens in the log files are redacted. When no log is found and the web server has no lines for the website, the call returns 404 not_found. The account must be active and on cPanel.
Authentication: An API key with the scopes read:hosting and console:services. About keys and scopes
Request
Path parameters
accountIdstringrequiredacct_…).Query parameters
domainstringlinesinteger100. 1 to 500.Example
curl "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/logs/error-log" \ -H "Authorization: Bearer $HOSTUP_API_KEY"Responses
200 The newest lines of each log found, plus the web server’s lines for the website. When only the web server has lines, logs is empty and source is null.
{ "source": { "path": "public_html/error_log", "domain": "example.com" }, "truncated": false, "entries": [ "[10-Jul-2026 08:14:22 UTC] PHP Fatal error: Uncaught Error: Call to undefined function example_function() in /home/abcde/public_html/wp-content/plugins/example-plugin/example.php:12" ], "logs": [ { "path": "public_html/error_log", "modifiedAt": "2026-07-10T08:14:22.000Z", "entries": [ "[10-Jul-2026 08:14:22 UTC] PHP Fatal error: Uncaught Error: Call to undefined function example_function() in /home/abcde/public_html/wp-content/plugins/example-plugin/example.php:12" ], "truncated": false } ], "unreadablePaths": [], "complete": true, "logFilesFound": 1, "searchLimited": false, "webServer": { "vhost": "example.com", "entries": [ "2026-07-10 08:14:22.203662 [INFO] [example.com] File not found [~/public_html/503.shtml] " ], "truncated": false }}Response fields
sourceobject | nullwebServer has lines.pathstringdomainstringtruncatedbooleanentriesarray of stringlogs[0].entries.logsarray of objectpathstringmodifiedAtstringentriesarray of stringtruncatedbooleanaccountLogobjectlogs/, which is filtered to this website.siteEntriesintegertotalEntriesintegerforeignHomePathsarray of objecthomestringlinesintegerunreadablePathsarray of stringcompletebooleanlogFilesFoundintegersearchLimitedbooleanwebServerobject | null503.shtml. A refused file shows as <path>: access is denied. Visitor addresses are removed. Paths start with ~/ for the home folder.vhoststringentriesarray of stringtruncatedbooleanErrors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | Invalid request. The response body is an RFC 7807 Problem Details document. |
| 401 | Unauthorized. Authentication is required. |
| 403 | The key lacks a scope or the account is not active. domain_not_owned: the domain is not on this account. |
| 404 | No log file was found and the web server had no lines for the website (not_found). Errors may be logged elsewhere, for example in the application’s database. |
| 409 | The account is not on cPanel (account_not_eligible_cpanel). |
| 429 | Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers. |
| 500 | Internal error. Retry later or contact support if the issue persists. |
| 502 | The account’s domains or the website’s log files could not be read right now (upstream_failed). |