claude-plugin/skills/manage-hosting/SKILL.md
2026-11-28 15:28:07 +02:00

7.2 KiB


MozOut hosting

Use this skill for shared hosting plans (cPanel). For VPS servers use manage-vps; for transactional email sent by an application use email-center.

Setup

  • API address: https://api.mozout.com/v1. It is fixed for MozOut: never ask the user for another address.
  • API key: always read it from the MOZOUT_API_KEY environment variable. Check it without printing it: test -n "$MOZOUT_API_KEY" && echo set || echo missing
  • If it is missing, ask the user to create a key in the API Center (https://www.my.mozout.com/api-center.php) with hosting:read (and hosting:write to change; hosting:login and hosting:code are separate permissions, off by default), then to run export MOZOUT_API_KEY="sandbox_..." and restart Claude Code (or the editor).
  • sandbox_ keys read the real account but only simulate writes and never charge. prod_ keys change the account and can charge. GET /v1/token gives the mode in data.mode and the permissions in data.permissions. Suggest a sandbox_ key for a first try.
  • Never print, log or commit the key, and never put it in code that runs in a browser or a mobile app. In code, read it from the environment.

Every request looks like this:

curl -sS "https://api.mozout.com/v1/PATH" -H "Authorization: Bearer $MOZOUT_API_KEY" -H "Accept: application/json"

Rules

  • Before anything that charges, deletes data or cannot be undone, tell the user exactly what will happen (with the price, when the API gives one) and wait for a clear yes.
  • Send an Idempotency-Key header on purchases, sends and other POST requests that accept it, and reuse the same value if you retry the same request: IDEM=$(uuidgen 2>/dev/null || cat /proc/sys/kernel/random/uuid).
  • Lists come in pages: ?page=1&per_page=100, and meta.total_pages says how many there are.
  • Long operations answer 202 with an action_id. Follow them with GET /v1/actions/{action_id} every 10 to 20 seconds until status is done or failed.
  • Answer the user in the language they write in, and show amounts with the currency the API returns.

Find the service

curl -sS "https://api.mozout.com/v1/services?status=active&per_page=100" -H "Authorization: Bearer $MOZOUT_API_KEY"
curl -sS "https://api.mozout.com/v1/services/SERVICE_ID/usage" -H "Authorization: Bearer $MOZOUT_API_KEY"
  • Hosting services have product.type hostingaccount. Use their id in the calls below.
  • 409 with details.reason not_hosting, service_not_active, server_not_supported or service_not_ready means the action cannot run on that service now.
  • In Sandbox the API checks the request but does not reach the server, so "already exists" errors only show in Production.

Panel login

POST /v1/services/{id}/cpanel-login (hosting:login) returns a link that works once and gives full access. Give it to the user straight away and never write it to files or logs.

Domains and redirects

  • Subdomain: POST /v1/services/{id}/subdomains with {"root_domain": "mybusiness.com", "name": "blog", "directory": "public_html/blog"}.
  • Addon domain: POST /v1/services/{id}/addon-domains with {"domain": "other.com"}.
  • Redirects: GET or POST /v1/services/{id}/redirects with {"domain": "mybusiness.com", "source": "/old", "destination": "https://www.mybusiness.com/new"}; delete with DELETE /v1/services/{id}/redirects/{redirect_id}.
  • Send an Idempotency-Key on these POST requests.

Databases

curl -sS -X POST "https://api.mozout.com/v1/services/SERVICE_ID/databases" -H "Authorization: Bearer $MOZOUT_API_KEY" \
  -H "Content-Type: application/json" -H "Idempotency-Key: $IDEM" -d '{"name": "site"}'
  • Names: lowercase letters, digits and _; the account prefix is added if missing. Use the full name from the answer.
  • User: POST /v1/services/{id}/database-users with {"name": "site", "password": "..."}. Generate a strong password (12 to 128 characters, at least 3 kinds of characters) and put it only in the project's untracked .env, never in the chat log or in git.
  • Access: PUT /v1/services/{id}/databases/{name}/users/{user}; remove with DELETE on the same path.
  • Deleting a database deletes its data: ask first.

Cron jobs, SSL, PHP, backups and FTP

  • Cron: POST /v1/services/{id}/cron with {"schedule": "*/15 * * * *", "php_script": "public_html/cron.php"} or a public url (hosting:code).
  • Free SSL: POST /v1/services/{id}/ssl/autossl; see the certificates with GET /v1/services/{id}/ssl. The domain must already point to the hosting.
  • PHP: GET /v1/services/{id}/php and GET or PUT /v1/services/{id}/php/options.
  • Backups: GET or POST /v1/services/{id}/backups (full backup).
  • FTP: GET or POST /v1/services/{id}/ftp-accounts (hosting:code), password with PUT .../ftp-accounts/{login}/password.

Mailboxes of the hosting account

These need email:read or email:write (not the E-mail Center permissions).

  • GET or POST /v1/services/{id}/email/mailboxes with {"address": "info@mybusiness.com", "password": "...", "quota_mb": 1024}.
  • Forwarders, autoresponders and the default address: /v1/services/{id}/email/forwarders, /autoresponders/{address}, /default-address.
  • GET /v1/services/{id}/email/authentication shows SPF, DKIM and DMARC.
  • 409 account_email_domain: the account login email is on that domain, so that change is made in My MozOut.

New plans

GET /v1/catalog/products lists plans and prices. POST /v1/services/purchase with {"product_id": ..., "billing_cycle": "annually", "domain": "mybusiness.com"} buys with account credit (billing:purchase): show the plan, the cycle and the price and ask first.

Errors

Errors look like {"error": {"code", "message", "correlation_id", "details"}}. Act on code, never on the text of message.

HTTP code What to do
401 unauthorized The key is missing, wrong or revoked. Ask the user to check MOZOUT_API_KEY.
402 insufficient_credit Not enough account credit, and nothing was charged. Give the user details.add_funds_url.
403 insufficient_scope The key lacks a permission. Name it and ask for a key that has it.
403 spending_limit_exceeded The purchase goes over the key spending limit. Nothing was charged.
404 not_found Wrong id, or it is not in this account.
409 conflict and others Read details.reason and explain it in plain words.
422 validation_failed Fix the field named in details and try again.
429 rate_limited Wait for the Retry-After seconds, then try once more.
5xx internal_error, upstream_error Try again later. If the user contacts support, give them the correlation_id.

More