agent-skills/skills/manage-domains/SKILL.md
2026-11-28 15:28:03 +02:00

6.9 KiB

name description
manage-domains Check, register, renew and transfer domains at Interweb Mozambique, and manage their nameservers, transfer lock, auto-renewal and transfer code through the Interweb Mozambique API. Use when the user wants to buy or renew a domain, move a domain to Interweb Mozambique, see their domains and expiry dates, or change nameservers or the lock.

Interweb Mozambique domains

Use this skill to work with the domains of the user's Interweb Mozambique 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.interweb.co.mz/v1. It is fixed for Interweb Mozambique: never ask the user for another address.
  • API key: always read it from the INTERWEB_API_KEY environment variable. Check it without printing it: test -n "$INTERWEB_API_KEY" && echo set || echo missing
  • If it is missing, ask the user to create a key in the API Center (https://www.meu.interweb.co.mz/api-center.php) with domains:read (and domains:write plus billing:purchase to buy or change), then to run export INTERWEB_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.interweb.co.mz/v1/PATH" -H "Authorization: Bearer $INTERWEB_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.

See the domains

curl -sS "https://api.interweb.co.mz/v1/domains?per_page=100" -H "Authorization: Bearer $INTERWEB_API_KEY"
curl -sS "https://api.interweb.co.mz/v1/domains/mybusiness.co.mz" -H "Authorization: Bearer $INTERWEB_API_KEY"

Check a name and its price

curl -sS "https://api.interweb.co.mz/v1/domains/availability?domain=mybusiness.co.mz" -H "Authorization: Bearer $INTERWEB_API_KEY"
  • status is available, registered or unknown. With unknown the API will not register: try again later.
  • prices has the register and renew price for each number of years, in currency.
  • If the answer says the name can only be bought in Meu Interweb (https://www.meu.interweb.co.mz), 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.interweb.co.mz/v1/domains/register" -H "Authorization: Bearer $INTERWEB_API_KEY" \
  -H "Content-Type: application/json" -H "Idempotency-Key: $IDEM" \
  -d '{"domain": "mybusiness.co.mz", "years": 1}'
  • years goes from 1 to 10 (1 by default). period_not_available means 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.
  • locked is true by default (transfer lock on). promo_code is optional; promo_not_applicable or promo_code_invalid means nothing was charged.
  • Renew: POST /v1/domains/{domain}/renew with {"years": 1}.
  • Transfer in: POST /v1/domains/transfer with {"domain": "...", "transfer_code": "..."}. A transfer is always for 1 year.
  • The answer is 202 with an action_id: follow it with GET /v1/actions/{action_id} until done or failed.
  • An answer 422 with a link to Meu Interweb means that case is handled there: give the user the link.

Nameservers, lock and auto-renewal

curl -sS "https://api.interweb.co.mz/v1/domains/mybusiness.co.mz/nameservers" -H "Authorization: Bearer $INTERWEB_API_KEY"
curl -sS -X PUT "https://api.interweb.co.mz/v1/domains/mybusiness.co.mz/nameservers" -H "Authorization: Bearer $INTERWEB_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.
  • 409 with account_email_domain means the account login email is on this domain: the change must be made in Meu Interweb.
  • Lock: GET or PUT /v1/domains/{domain}/lock with {"locked": true}. Auto-renewal: PUT /v1/domains/{domain}/auto-renew with {"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 INTERWEB_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