LOCALHOST
All pages
API reference

Domains

Check, register, move in, renew and manage names. Paid calls charge the wallet at once.

Every call needs Authorization: Bearer lh_… unless marked No key needed; the example uses $API for https://api.localhost.co.zw and $LH_API_KEY for your key. A * marks a required field.

#

List Domains

domains:read

GET /domains/

Responses

  • 200 list[DomainOut]
  • 401 no key, or a key that was revoked
  • 403 the key lacks the permission
Example request
curl -X GET "$API/domains/" \
  -H "Authorization: Bearer $LH_API_KEY"
#

Register

domains:write Idempotency-Key

POST /domains/

Register a name, paid now from the wallet. The registry finishes it later (status pending -> active).

Request body RegisterIn

NameTypeNotes
name * string
nameservers list[string] default []
registrant object of string default {}
auto_renew boolean default true
pay_from string default account

Responses

  • 202 OrderOut
  • 401 no key, or a key that was revoked
  • 403 the key lacks the permission
Example request
curl -X POST "$API/domains/" \
  -H "Authorization: Bearer $LH_API_KEY" \
  -H "Idempotency-Key: <a fresh unique string>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "<name>"
  }'
#

Check

domains:read

GET /domains/check

Up to 20 comma-separated names. `price` is what this account pays (partner prices applied).

Parameters

NameTypeNotes
names * query string

Responses

  • 200 list[CheckOut]
  • 401 no key, or a key that was revoked
  • 403 the key lacks the permission
Example request
curl -X GET "$API/domains/check?names=<names>" \
  -H "Authorization: Bearer $LH_API_KEY"
#

Prices

domains:read

GET /domains/prices

Every ending we sell, at this account's prices.

Responses

  • 200 list[PriceOut]
  • 401 no key, or a key that was revoked
  • 403 the key lacks the permission
Example request
curl -X GET "$API/domains/prices" \
  -H "Authorization: Bearer $LH_API_KEY"
#

Transfer In

domains:write Idempotency-Key

POST /domains/transfers

Move a name here from another provider, paid now (free for the .zw endings).

Request body TransferIn

NameTypeNotes
name * string
auth_code string default ""
owner_email string default ""

Responses

  • 202 OrderOut
  • 401 no key, or a key that was revoked
  • 403 the key lacks the permission
Example request
curl -X POST "$API/domains/transfers" \
  -H "Authorization: Bearer $LH_API_KEY" \
  -H "Idempotency-Key: <a fresh unique string>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "<name>"
  }'
#

Get Domain

domains:read

GET /domains/{name}

Parameters

NameTypeNotes
name * in path string

Responses

  • 200 DomainOut
  • 401 no key, or a key that was revoked
  • 403 the key lacks the permission
Example request
curl -X GET "$API/domains/<name>" \
  -H "Authorization: Bearer $LH_API_KEY"
#

Auth Code

domains:write

GET /domains/{name}/auth-code

The transfer code, for moving the name away. Needs domains:write.

Parameters

NameTypeNotes
name * in path string

Responses

  • 200 AuthCodeOut
  • 401 no key, or a key that was revoked
  • 403 the key lacks the permission
Example request
curl -X GET "$API/domains/<name>/auth-code" \
  -H "Authorization: Bearer $LH_API_KEY"
#

Set Auto Renew

domains:write

PUT /domains/{name}/auto-renew

Parameters

NameTypeNotes
name * in path string

Request body ToggleIn

NameTypeNotes
on * boolean

Responses

  • 200 DomainOut
  • 401 no key, or a key that was revoked
  • 403 the key lacks the permission
Example request
curl -X PUT "$API/domains/<name>/auto-renew" \
  -H "Authorization: Bearer $LH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "on": true
  }'
#

Get Contacts

domains:read

GET /domains/{name}/contacts

Parameters

NameTypeNotes
name * in path string

Responses

  • 200 object of string
  • 401 no key, or a key that was revoked
  • 403 the key lacks the permission
Example request
curl -X GET "$API/domains/<name>/contacts" \
  -H "Authorization: Bearer $LH_API_KEY"
#

Set Contacts

domains:write

PUT /domains/{name}/contacts

Owner details. While a new name waits for them they're saved and, once complete, submitted: they lock and the
registration goes (200). Pass ?submit=false to save them for checking first, then POST /{name}/contacts/submit,
the way the website asks the owner. On a registered name the change is sent to the registry (202) and
shows here once it confirms; GET /{name}/operations follows it.

Parameters

NameTypeNotes
name * in path string
submit query boolean default true

Responses

  • 200 object of string
  • 202 object of string
  • 401 no key, or a key that was revoked
  • 403 the key lacks the permission
Example request
curl -X PUT "$API/domains/<name>/contacts" \
  -H "Authorization: Bearer $LH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
#

Set Lock

domains:write

PUT /domains/{name}/lock

Parameters

NameTypeNotes
name * in path string

Request body ToggleIn

NameTypeNotes
on * boolean

Responses

  • 200 DomainOut
  • 401 no key, or a key that was revoked
  • 403 the key lacks the permission
Example request
curl -X PUT "$API/domains/<name>/lock" \
  -H "Authorization: Bearer $LH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "on": true
  }'
#

Set Nameservers

domains:write

PUT /domains/{name}/nameservers

Parameters

NameTypeNotes
name * in path string

Request body NameserversIn

NameTypeNotes
nameservers * list[string]

Responses

  • 202 DomainOut
  • 401 no key, or a key that was revoked
  • 403 the key lacks the permission
Example request
curl -X PUT "$API/domains/<name>/nameservers" \
  -H "Authorization: Bearer $LH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "nameservers": [
      "<nameservers>"
    ]
  }'
#

Operations

domains:read

GET /domains/{name}/operations

What has been asked of the registry for this name, newest first.

Parameters

NameTypeNotes
name * in path string

Responses

  • 200 list[OperationOut]
  • 401 no key, or a key that was revoked
  • 403 the key lacks the permission
Example request
curl -X GET "$API/domains/<name>/operations" \
  -H "Authorization: Bearer $LH_API_KEY"
#

Renew

domains:write Idempotency-Key

POST /domains/{name}/renew

Renew ahead for 1-5 years, paid now. The new expiry shows once the registry confirms.

Parameters

NameTypeNotes
name * in path string

Request body RenewIn

NameTypeNotes
years integer default 1
pay_from string default account

Responses

  • 202 OrderOut
  • 401 no key, or a key that was revoked
  • 403 the key lacks the permission
Example request
curl -X POST "$API/domains/<name>/renew" \
  -H "Authorization: Bearer $LH_API_KEY" \
  -H "Idempotency-Key: <a fresh unique string>" \
  -H "Content-Type: application/json" \
  -d '{
    "years": 1,
    "pay_from": "account"
  }'
#

Submit Contacts

domains:write

POST /domains/{name}/contacts/submit

Submit a new name's owner details as they are: they lock, and the registration goes.

Parameters

NameTypeNotes
name * in path string

Responses

  • 200 object of string
  • 401 no key, or a key that was revoked
  • 403 the key lacks the permission
Example request
curl -X POST "$API/domains/<name>/contacts/submit" \
  -H "Authorization: Bearer $LH_API_KEY"

Shapes

The objects these endpoints send and receive.

AuthCodeOut

NameTypeNotes
name * string
auth_code * string

CheckOut

NameTypeNotes
name * string
available * boolean | null
status * string
price * string | null
list_price * string | null
currency string default USD
needs_transfer_code * boolean

DomainOut

NameTypeNotes
name * string
tld * string
status * string
nameservers * list[string]
auto_renew * boolean
locked * boolean
registered_at * datetime | null
expires_at * datetime | null

NameserversIn

NameTypeNotes
nameservers * list[string]

OperationOut

NameTypeNotes
id * integer
op * string
state * string
note * string
created_at * datetime
completed_at * datetime | null

OrderOut

NameTypeNotes
domain * DomainOut
invoice * string
charged * string
currency * string
next_step * string

PriceOut

NameTypeNotes
kind * string
ref * string
list_price * string
your_price * string
client_price * string
period * string

RegisterIn

NameTypeNotes
name * string
nameservers list[string] default []
registrant object of string default {}
auto_renew boolean default true
pay_from string default account

RenewIn

NameTypeNotes
years integer default 1
pay_from string default account

ToggleIn

NameTypeNotes
on * boolean

TransferIn

NameTypeNotes
name * string
auth_code string default ""
owner_email string default ""