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.
| Endpoint | Scope | What it does |
|---|---|---|
GET /v1/services/:id | services:read | One service’s details: product, domain, status, Node.js deploy capability (node_capable), cPanel login availability and deployed apps |
POST /v1/services/:id/cpanel-login | hosting:login | Short-lived, single-use direct cPanel login link (the panel’s “Log in to cPanel” button) |
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:loginis 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.
| Endpoint | Scope | What it does |
|---|---|---|
GET /v1/services/:id/hosting | hosting:read | Overview: domains, disk, PHP per domain, database and cron counts |
GET /v1/services/:id/doctor?domain= | hosting:read | Site doctor: findings by severity with fixes (default: main domain) |
GET /v1/services/:id/usage | hosting:read | Resource usage against the plan limits |
GET /v1/services/:id/error-log?domain=&lines= | hosting:read | Latest web server / PHP errors of a domain (1–200 lines) |
GET /v1/services/:id/databases | hosting:read | MySQL databases and users |
POST /v1/services/:id/databases | hosting:write | {"name"}: create a database + same-named user; password returned once |
DELETE /v1/services/:id/databases/:name?confirm_name= | hosting:write | Delete a database and its same-named user |
POST /v1/services/:id/database-users/:user/password | hosting:write | New random password for a database user (returned once) |
GET /v1/services/:id/cron | hosting:read | Cron jobs |
POST /v1/services/:id/cron | hosting:write | {"minute","hour","day","month","weekday","command"}; max 20 |
DELETE /v1/services/:id/cron/:cron_id?confirm_id= | hosting:write | Delete a cron job |
GET /v1/services/:id/subdomains | hosting:read | Subdomains and possible root domains |
POST /v1/services/:id/subdomains | hosting:write | {"label","root_domain","docroot"} |
DELETE /v1/services/:id/subdomains/:subdomain?confirm_subdomain= | hosting:write | Delete a subdomain (files kept) |
GET /v1/services/:id/redirects | hosting:read | Redirects |
POST /v1/services/:id/redirects | hosting:write | {"domain","path","url","type":"301|302","wildcard"} |
DELETE /v1/services/:id/redirects?domain=&path=&confirm_path= | hosting:write | Delete a redirect |
GET /v1/services/:id/php | hosting:read | PHP version per domain and selectable versions |
POST /v1/services/:id/php | hosting:write | {"domain","version"}, e.g. ea-php83 |
GET /v1/services/:id/php-settings?domain= | hosting:read | PHP settings of a domain and .htaccess overrides |
POST /v1/services/:id/php-settings | hosting:write | {"domain","settings":{…}} (1–10 allowed settings) |
GET /v1/services/:id/email?domain= | hosting:read | Mailboxes, forwarders, autoresponders and catch-all |
POST /v1/services/:id/email | hosting:write | action: create, delete, reset_password, add_forwarder, delete_forwarder, set_autoresponder, delete_autoresponder, set_catch_all |
POST /v1/services/:id/domains | hosting:write | action: add_addon, delete_addon, add_parked, delete_parked |
GET /v1/services/:id/ssl | hosting:read | Installed certificates and AutoSSL problems |
POST /v1/services/:id/ssl/autossl | hosting:write | Run AutoSSL now |
GET /v1/services/:id/ftp | hosting:read | FTP accounts |
POST /v1/services/:id/ftp | hosting:write | action: create, reset_password, delete |
GET /v1/services/:id/files?path= | hosting:read | List a directory (relative to home; default public_html) |
GET /v1/services/:id/file?path= | hosting:read | Read a text file (up to 256 KB) |
# site doctorcurl -s "https://api.hostino.ai/v1/services/150/doctor?domain=example.com" -H "Authorization: Bearer $TOKEN"
# 128 MB upload limitcurl -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 namecurl -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 (orconfirmin the body) exactly equal to the item name; otherwise400 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, seeGET /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).