Turn WordPress debug mode on or off
POST /api/v2/shared-hosting/{accountId}/wordpress/{siteId}/actions/debug-mode
Turns WordPress debug mode (WP_DEBUG in the site’s wp-config.php) on or off for one site. The change is made before the response returns. Nothing else on the site changes.
With debug mode on, warnings and notices from WordPress, plugins and themes can show on the site’s pages, also to visitors. Turn it on to find the cause of an error and turn it off again afterwards. With debug mode off, those lines are no longer shown.
The web hosting account must be active and on cPanel. A change that could not be made returns 502 upstream_failed.
Authentication: An API key with the scopes write:hosting and console:services. About keys and scopes
Request
Path parameters
accountIdstringrequiredacct_…).siteIdstringrequiredwp_…).Body
enabledbooleanrequiredtrue turns debug mode on. false turns it off.Example
curl -X POST "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/wordpress/wp_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/debug-mode" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "enabled": true }'Responses
200 Debug mode was changed.
{ "id": "wp_01hxa3b4c5d6e7f8g9h0j1k2m3", "debugMode": false}Response fields
idstringwp_…).debugModebooleantrue when debug mode is on.Errors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | siteId is invalid or enabled is not true or false (invalid_request). |
| 401 | Unauthorized. Authentication is required. |
| 403 | Forbidden. The caller lacks a required scope or does not own the resource. |
| 404 | Not found. The resource does not exist or is not owned by the caller; code is wp_installation_not_found. |
| 409 | account_not_eligible_cpanel: the account is not on 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 | Debug mode could not be changed right now (upstream_failed). |