6.7 KiB
6.7 KiB
| name | description |
|---|---|
| manage-domains | Check, register, renew and transfer domains at MozOut, and manage their nameservers, transfer lock, auto-renewal and transfer code through the MozOut API. Use when the user wants to buy or renew a domain, move a domain to MozOut, see their domains and expiry dates, or change nameservers or the lock. |
MozOut domains
Use this skill to work with the domains of the user's MozOut account. For records inside the zone (A, CNAME, MX, TXT) use the manage-dns skill; to look up any name without an account, use whois-lookup.
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_KEYenvironment 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
domains:read(anddomains:writeplusbilling:purchaseto buy or change), then to runexport 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/tokengives the mode indata.modeand the permissions indata.permissions. Suggest asandbox_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-Keyheader 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, andmeta.total_pagessays how many there are. - Long operations answer
202with anaction_id. Follow them withGET /v1/actions/{action_id}every 10 to 20 seconds untilstatusisdoneorfailed. - Answer the user in the language they write in, and show amounts with the currency the API returns.
See the domains
curl -sS "https://api.mozout.com/v1/domains?per_page=100" -H "Authorization: Bearer $MOZOUT_API_KEY"
curl -sS "https://api.mozout.com/v1/domains/mybusiness.com" -H "Authorization: Bearer $MOZOUT_API_KEY"
Check a name and its price
curl -sS "https://api.mozout.com/v1/domains/availability?domain=mybusiness.com" -H "Authorization: Bearer $MOZOUT_API_KEY"
statusisavailable,registeredorunknown. Withunknownthe API will not register: try again later.priceshas the register and renew price for each number of years, incurrency.- If the answer says the name can only be bought in My MozOut (https://www.my.mozout.com), not through the API, tell the user and give the reason it returns.
Register, renew and transfer
These charge the account credit. Show the name, the years and the price, and ask before sending. They need billing:purchase and domains:write, and the Idempotency-Key header.
IDEM=$(uuidgen 2>/dev/null || cat /proc/sys/kernel/random/uuid)
curl -sS -X POST "https://api.mozout.com/v1/domains/register" -H "Authorization: Bearer $MOZOUT_API_KEY" \
-H "Content-Type: application/json" -H "Idempotency-Key: $IDEM" \
-d '{"domain": "mybusiness.com", "years": 1}'
yearsgoes from 1 to 10 (1 by default).period_not_availablemeans that extension has no price for that many years.nameservers(2 to 5) is optional; without it the domain gets our nameservers, which lets you manage DNS through the API.lockedistrueby default (transfer lock on).promo_codeis optional;promo_not_applicableorpromo_code_invalidmeans nothing was charged.- Renew:
POST /v1/domains/{domain}/renewwith{"years": 1}. - Transfer in:
POST /v1/domains/transferwith{"domain": "...", "transfer_code": "..."}. A transfer is always for 1 year. - The answer is
202with anaction_id: follow it withGET /v1/actions/{action_id}untildoneorfailed. - An answer
422with a link to My MozOut means that case is handled there: give the user the link.
Nameservers, lock and auto-renewal
curl -sS "https://api.mozout.com/v1/domains/mybusiness.com/nameservers" -H "Authorization: Bearer $MOZOUT_API_KEY"
curl -sS -X PUT "https://api.mozout.com/v1/domains/mybusiness.com/nameservers" -H "Authorization: Bearer $MOZOUT_API_KEY" \
-H "Content-Type: application/json" -d '{"nameservers": ["ns1.example.net", "ns2.example.net"]}'
- Changing nameservers moves the whole DNS of the domain elsewhere: the website and email can stop working. Confirm first.
409withaccount_email_domainmeans the account login email is on this domain: the change must be made in My MozOut.- Lock:
GETorPUT /v1/domains/{domain}/lockwith{"locked": true}. Auto-renewal:PUT /v1/domains/{domain}/auto-renewwith{"auto_renew": true}. - Registry contacts:
GET /v1/domains/{domain}/contacts.
Transfer code
POST /v1/domains/{domain}/transfer-code with {"confirm": "<domain>"} needs domains:transfer_code. The code is never in the answer: it goes by email to the account or to the domain owner. Tell the user where to look.
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
- Domains: https://docs.mozout.com/domains/
- Rules, limits and Sandbox: https://docs.mozout.com/api-rules/
- Full reference: https://api.mozout.com/v1/openapi.json