Skip to content

API Reference

Hosting API

Copy page

Hosting service details, cPanel login and hosting management (site doctor, databases, cron jobs, subdomains, redirects, PHP, resources, logs, email, domains, SSL, FTP and files) via the API

All endpoints live on https://api.hostino.ai and use an OAuth (Bearer) token. The list of all services is in the Services API.

EndpointScopeWhat it does
GET /v1/services/:idservices:readOne service’s details: product, domain, status, Node.js deploy capability (node_capable), cPanel login availability and deployed apps
POST /v1/services/:id/cpanel-loginhosting:loginShort-lived, single-use direct cPanel login link (the panel’s “Log in to cPanel” button)
Terminal window
curl -s -X POST https://api.hostino.ai/v1/services/150/cpanel-login -H "Authorization: Bearer $TOKEN"
{ "service_id": "150", "domain": "example.com", "login_url": "https://…:2083/cpsess…/…", "expires_in_seconds": 900 }
  • hosting:login is a separate, opt-in permission shown with a warning on the consent screen, because the link grants full cPanel access.
  • The server IP and cPanel username are never returned.
  • For WordPress see the WordPress API; to publish apps see the Deployment API.

Hosting management

These endpoints work on the cPanel account of your own Linux, WordPress and Node.js hosting and match the hosting_* tools in Hosting with AI. The service must be active and belong to the token owner; for a service without cPanel the answer is 409 hosting_tools_not_available. hosting:read and hosting:write are also allowed in API tokens.

EndpointScopeWhat it does
GET /v1/services/:id/hostinghosting:readOverview: domains, disk, PHP per domain, database and cron counts
GET /v1/services/:id/doctor?domain=hosting:readSite doctor: findings by severity with fixes (default: main domain)
GET /v1/services/:id/usagehosting:readResource usage against the plan limits
GET /v1/services/:id/error-log?domain=&lines=hosting:readLatest web server / PHP errors of a domain (1–200 lines)
GET /v1/services/:id/databaseshosting:readMySQL databases and users
POST /v1/services/:id/databaseshosting:write{"name"}: create a database + same-named user; password returned once
DELETE /v1/services/:id/databases/:name?confirm_name=hosting:writeDelete a database and its same-named user
POST /v1/services/:id/database-users/:user/passwordhosting:writeNew random password for a database user (returned once)
GET /v1/services/:id/cronhosting:readCron jobs
POST /v1/services/:id/cronhosting:write{"minute","hour","day","month","weekday","command"}; max 20
DELETE /v1/services/:id/cron/:cron_id?confirm_id=hosting:writeDelete a cron job
GET /v1/services/:id/subdomainshosting:readSubdomains and possible root domains
POST /v1/services/:id/subdomainshosting:write{"label","root_domain","docroot"}
DELETE /v1/services/:id/subdomains/:subdomain?confirm_subdomain=hosting:writeDelete a subdomain (files kept)
GET /v1/services/:id/redirectshosting:readRedirects
POST /v1/services/:id/redirectshosting:write{"domain","path","url","type":"301|302","wildcard"}
DELETE /v1/services/:id/redirects?domain=&path=&confirm_path=hosting:writeDelete a redirect
GET /v1/services/:id/phphosting:readPHP version per domain and selectable versions
POST /v1/services/:id/phphosting:write{"domain","version"}, e.g. ea-php83
GET /v1/services/:id/php-settings?domain=hosting:readPHP settings of a domain and .htaccess overrides
POST /v1/services/:id/php-settingshosting:write{"domain","settings":{…}} (1–10 allowed settings)
GET /v1/services/:id/email?domain=hosting:readMailboxes, forwarders, autoresponders and catch-all
POST /v1/services/:id/emailhosting:writeaction: create, delete, reset_password, add_forwarder, delete_forwarder, set_autoresponder, delete_autoresponder, set_catch_all
POST /v1/services/:id/domainshosting:writeaction: add_addon, delete_addon, add_parked, delete_parked
GET /v1/services/:id/sslhosting:readInstalled certificates and AutoSSL problems
POST /v1/services/:id/ssl/autosslhosting:writeRun AutoSSL now
GET /v1/services/:id/ftphosting:readFTP accounts
POST /v1/services/:id/ftphosting:writeaction: create, reset_password, delete
GET /v1/services/:id/files?path=hosting:readList a directory (relative to home; default public_html)
GET /v1/services/:id/file?path=hosting:readRead a text file (up to 256 KB)
Terminal window
# site doctor
curl -s "https://api.hostino.ai/v1/services/150/doctor?domain=example.com" -H "Authorization: Bearer $TOKEN"
# 128 MB upload limit
curl -s -X POST https://api.hostino.ai/v1/services/150/php-settings -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"domain":"example.com","settings":{"upload_max_filesize":"128M","post_max_size":"128M"}}'
# delete a database: confirm_name must be exactly the full database name
curl -s -X DELETE "https://api.hostino.ai/v1/services/150/databases/prefix_shop?confirm_name=prefix_shop" -H "Authorization: Bearer $TOKEN"
  • Deletes need the confirm_* parameter (or confirm in the body) exactly equal to the item name; otherwise 400 confirmation_mismatch.
  • Passwords (database, email, FTP) are only returned in the answer to that request.
  • Plan limits are reported as plan_limit_reached; to upgrade, see GET /v1/services/:id/upgrades.
  • Allowed PHP setting ranges, folder rules and all error codes are in Hosting with AI.

Planned

Listing and restoring hosting backups via the API (for now through support).