Workflows
Every task the API supports, as numbered steps. Paths are relative to https://api.golzak.com/domains/v1; every call
sends Authorization: Bearer <API key>. Each POST also sends a new Idempotency-Key that you store before the
call and reuse if you retry it.
Rule for every workflow: on
429,500,502or a network timeout, retry the same request with the sameIdempotency-Key(afterRetry-Afterwhen given). On any other4xx, do not retry: showdetailand fix the cause. See Errors.
1. Register a domain for a client
GET /check?name=atlas-tours.maavailable: false→ stop; offer another name.422 tld_manual_only/tld_not_supported→ stop; the extension is not available through the API.
GET /prices→ check that the number of years you want is a key of theregistertable; read the price.- Collect the holder's data from your client. Ask, do not guess, whether the holder is a person or a company and
whether they are Moroccan; this decides
legal_id(Holder rules). POST /domains?dry_run=truewith the full body.200→ showswould_chargeandcredit_after. Show the price to your client if you need their approval.- Any error → fix it and repeat this step. Nothing has been ordered.
POST /domainswith the same body and a newIdempotency-Key→202with an operation.- Store the operation
id. Show your client "registration in progress". - Wait for the result (webhook, or
GET /operations/{id}; see workflow 9):active→ done.GET /domains/{name}givesexpires_at.pendingwithpending_reason: registry_review→ go to workflow 2.refused→ workflow 3.failed→ readerror.code; the charge is inrefund. Fix the cause and start again from step 1.
2. A registration held for ANRT review
- You receive
operation.pendingwithdocuments_required: true(anddocuments_deadlinewhen known). - Golzak e-mails your account the official ANRT form and the list of documents for this holder.
- Tell your client at once. Collect the documents.
- Reply to Golzak's e-mail (or open a ticket) with the documents before the deadline in that e-mail.
- Wait. Plan for up to 3 weeks. The operation ends
activeorrefused.
Note: do not order the same name again while it is under review: the registry already holds it for your client. Wait for the operation's result.
3. A registration refused by ANRT
- The operation is
refused,error.code: registry_refused. refund.statusiscredited(the charge is back on your credit) ormanual_review(Golzak returns it by hand).- Tell your client. The name is free again at the registry. Before ordering it again, ask Golzak why ANRT refused it: an order that does not address the reason (for example, missing proof of the holder's right to the name) is likely to be refused again.
4. Renew a domain by hand
GET /domains/{name}→ noteexpires_atandstatus(activeorgrace_periodcan be renewed).GET /prices→ check thatyearsis in therenewtable and that the new expiry stays within 5 years of today.POST /domains/{name}/renew?dry_run=truewith{"years": 1}→ check the charge.POST /domains/{name}/renewwith a newIdempotency-Key→202operation.- Wait for
active;GET /domains/{name}shows the newexpires_at.
5. Turn automatic renewal on or off
- Make sure your account's auto-renew cap on developers.golzak.com covers your renew prices.
PUT /domains/{name}/auto-renewwith{"enabled": true}(orfalse) →200with the domain,auto_renewupdated.- Before each expiry Golzak creates a renew operation with
initiator: "auto_renew"; you getoperation.activeoroperation.failed. - On
operation.failedfor an automatic renewal: top up credit or raise the cap, then renew by hand (workflow 4) beforeexpires_at.
6. Change the nameservers
PUT /domains/{name}/nameserverswith{"nameservers": ["ns1.example-dns.com", "ns2.example-dns.com"]}.200→ the registry has the new list. DNS caches may take up to 48 hours to follow.409 domain_status_prohibits→ the name is under ANRT review or expired; retry once it isactive.
7. Move a domain from another registrar to Golzak (transfer in)
- Ask the holder to get the EPP code from the current registrar and to have the name unlocked there.
GET /prices→ read the transfer price.POST /transfers?dry_run=truewith{"name": "...", "epp_code": "..."}→ check the charge.POST /transferswith a newIdempotency-Key→202operation,pending_reason: transfer_pending.- Wait: usually about 2 business days.
active→ the name is in your account,auto_renew: false,transfer_locked: true.failedwithtransfer_not_completed(after 10 business days) or another code → the charge is refunded; check the lock and the code with the holder and the current registrar, then start again.
8. A client leaves: move a domain to another registrar (transfer out)
PUT /domains/{name}/transfer-lockwith{"locked": false}.GET /domains/{name}/epp-code→ giveepp_codeto the holder only. Each call makes a new code and cancels the previous one: call it once.- The holder gives the code to the new registrar, which requests the transfer.
- Once the name has left,
GET /domains/{name}showsstatus: "transferred_away". - If the holder changes their mind, lock it again:
PUT /domains/{name}/transfer-lockwith{"locked": true}.
9. Follow operations reliably (webhooks + reconciliation)
- Add a webhook endpoint on developers.golzak.com; store its signing secret on your server.
- For each delivery: verify the signature on the raw body, store the event (deduplicate on
Golzak-Webhook-Id), answer200, then process it. See Registration and webhooks. - Every 15 minutes, for each operation still
pendingin your database, callGET /operations/{id}and update it ifupdated_atis newer. This catches any webhook you missed.
10. Keep enough credit
GET /balancedaily (or before large batches).- If
creditis low, pay Golzak to top up; the new credit shows inGET /balance. - If
spent_todayis close todaily_spend_cap, wait forcap_resets_ator raise the cap on developers.golzak.com.
11. Rotate an API key without downtime
- On developers.golzak.com, create a new key with the same IP allowlist.
- Deploy it to your servers; check one
GET /balancewith it. - Revoke the old key. Webhooks and auto-renewals are not affected: they belong to your account.
12. Show your clients their domains
GET /domains?limit=100; thenGET /domains?limit=100&cursor=<next_cursor>untilnext_cursorisnull.- For details of one name (nameservers, lock, auto-renew):
GET /domains/{name}. - Flag every domain whose
expires_atis within 30 days andauto_renewisfalse.