LOCALHOST
All pages
API reference

Partners

Clients you manage, your book of names and sites, prices, commissions and webhooks.

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.

#

Clients

clients:read

GET /resellers/clients

Responses

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

Add Client

clients:write

POST /resellers/clients

Request body ClientIn

NameTypeNotes
name * string
kind string default business

Responses

  • 201 ClientOut
  • 401 no key, or a key that was revoked
  • 403 the key lacks the permission
Example request
curl -X POST "$API/resellers/clients" \
  -H "Authorization: Bearer $LH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "<name>"
  }'
#

Commissions

Any key

GET /resellers/commissions

Responses

Example request
curl -X GET "$API/resellers/commissions" \
  -H "Authorization: Bearer $LH_API_KEY"
#

Book Domains

domains:read

GET /resellers/domains

`client` is a client id from /clients; `expiring_within` a number of days.

Parameters

NameTypeNotes
client query integer | null
status query string default ""
expiring_within query integer | null
q query string default ""

Responses

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

Events

No key needed

GET /resellers/events

Every event a webhook can subscribe to. "domain.*" subscribes to a whole group.

Responses

  • 200 object of string
Example request
curl -X GET "$API/resellers/events"
#

Me

Any key

GET /resellers/me

Responses

  • 200 MeOut
  • 401 no key, or a key that was revoked
Example request
curl -X GET "$API/resellers/me" \
  -H "Authorization: Bearer $LH_API_KEY"
#

Prices

Any key

GET /resellers/prices

What you pay against the list price, for names and plans.

Responses

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

Get Pricing

Any key

GET /resellers/pricing

Your own prices to your clients: on or off, and the markup per group (percent over list price).

Responses

  • 200 PricingOut
  • 401 no key, or a key that was revoked
Example request
curl -X GET "$API/resellers/pricing" \
  -H "Authorization: Bearer $LH_API_KEY"
#

Put Pricing

billing:write

PUT /resellers/pricing

Turning own prices on needs agree=true once: you present them as your own, never as LOCALHOST's (partner terms).

Request body PricingIn

NameTypeNotes
own_prices * boolean
markups object of integer default {}
agree boolean default false

Responses

  • 200 PricingOut
  • 401 no key, or a key that was revoked
  • 403 the key lacks the permission
Example request
curl -X PUT "$API/resellers/pricing" \
  -H "Authorization: Bearer $LH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "own_prices": true
  }'
#

Book Sites

sites:read

GET /resellers/sites

Parameters

NameTypeNotes
client query integer | null
state query string default ""

Responses

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

List Webhooks

webhooks:read

GET /resellers/webhooks

Responses

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

Create Webhook

webhooks:write

POST /resellers/webhooks

The answer carries the signing secret, once.

Request body WebhookIn

NameTypeNotes
url * string
events list[string] default []
description string default ""

Responses

  • 201 WebhookCreated
  • 401 no key, or a key that was revoked
  • 403 the key lacks the permission
Example request
curl -X POST "$API/resellers/webhooks" \
  -H "Authorization: Bearer $LH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "<url>"
  }'
#

Bulk

domains:write Idempotency-Key

POST /resellers/domains/bulk

action: renew | auto_renew_on | auto_renew_off | lock | unlock | nameservers. Each name succeeds or fails on its
own. Renewals are paid from your wallet (pay_from "partner") or each client's ("client").

Request body BulkIn

NameTypeNotes
action * string
names * list[string]
nameservers list[string] default []
pay_from string default partner

Responses

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

Update Webhook

webhooks:write

PATCH /resellers/webhooks/{hook_id}

Parameters

NameTypeNotes
hook_id * in path integer

Request body WebhookPatch

NameTypeNotes
url string | null
events list[string] | null
active boolean | null
description string | null

Responses

  • 200 WebhookOut
  • 401 no key, or a key that was revoked
  • 403 the key lacks the permission
Example request
curl -X PATCH "$API/resellers/webhooks/<hook_id>" \
  -H "Authorization: Bearer $LH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "<url>",
    "events": [
      "<events>"
    ],
    "active": true,
    "description": "<description>"
  }'
#

Delete Webhook

webhooks:write

DELETE /resellers/webhooks/{hook_id}

Parameters

NameTypeNotes
hook_id * in path integer

Responses

  • 204 No Content
  • 401 no key, or a key that was revoked
  • 403 the key lacks the permission
Example request
curl -X DELETE "$API/resellers/webhooks/<hook_id>" \
  -H "Authorization: Bearer $LH_API_KEY"
#

Fund

clients:write Idempotency-Key

POST /resellers/clients/{link_id}/fund

Parameters

NameTypeNotes
link_id * in path integer

Request body FundIn

NameTypeNotes
amount * number | string
note string default ""

Responses

  • 200 object
  • 401 no key, or a key that was revoked
  • 403 the key lacks the permission
Example request
curl -X POST "$API/resellers/clients/<link_id>/fund" \
  -H "Authorization: Bearer $LH_API_KEY" \
  -H "Idempotency-Key: <a fresh unique string>" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 1
  }'
#

Handoff

clients:write

POST /resellers/clients/{link_id}/handoff

Parameters

NameTypeNotes
link_id * in path integer

Request body HandoffIn

NameTypeNotes
email * string

Responses

  • 200 ClientOut
  • 401 no key, or a key that was revoked
  • 403 the key lacks the permission
Example request
curl -X POST "$API/resellers/clients/<link_id>/handoff" \
  -H "Authorization: Bearer $LH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "<email>"
  }'
#

Site Action

sites:write

POST /resellers/sites/{site_id}/{action}

Parameters

NameTypeNotes
site_id * in path uuid
action * in path string

Responses

  • 200 PortfolioSiteOut
  • 401 no key, or a key that was revoked
  • 403 the key lacks the permission
Example request
curl -X POST "$API/resellers/sites/<site_id>/<action>" \
  -H "Authorization: Bearer $LH_API_KEY"
#

Deliveries

webhooks:read

GET /resellers/webhooks/{hook_id}/deliveries

Parameters

NameTypeNotes
hook_id * in path integer
status query string default ""

Responses

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

Rotate Secret

webhooks:write

POST /resellers/webhooks/{hook_id}/rotate-secret

Parameters

NameTypeNotes
hook_id * in path integer

Responses

  • 200 WebhookCreated
  • 401 no key, or a key that was revoked
  • 403 the key lacks the permission
Example request
curl -X POST "$API/resellers/webhooks/<hook_id>/rotate-secret" \
  -H "Authorization: Bearer $LH_API_KEY"
#

Test Webhook

webhooks:write

POST /resellers/webhooks/{hook_id}/test

Parameters

NameTypeNotes
hook_id * in path integer

Responses

  • 200 DeliveryOut
  • 401 no key, or a key that was revoked
  • 403 the key lacks the permission
Example request
curl -X POST "$API/resellers/webhooks/<hook_id>/test" \
  -H "Authorization: Bearer $LH_API_KEY"
#

Redeliver

webhooks:write

POST /resellers/webhooks/{hook_id}/deliveries/{delivery_id}/redeliver

Parameters

NameTypeNotes
hook_id * in path integer
delivery_id * in path integer

Responses

  • 200 DeliveryOut
  • 401 no key, or a key that was revoked
  • 403 the key lacks the permission
Example request
curl -X POST "$API/resellers/webhooks/<hook_id>/deliveries/<delivery_id>/redeliver" \
  -H "Authorization: Bearer $LH_API_KEY"

Shapes

The objects these endpoints send and receive.

BulkIn

NameTypeNotes
action * string
names * list[string]
nameservers list[string] default []
pay_from string default partner

BulkOut

NameTypeNotes
done * list[string]
failed * list[object]

ClientIn

NameTypeNotes
name * string
kind string default business

ClientOut

NameTypeNotes
id * integer
slug * string
name * string
state * string
source * string
managed * boolean
joined_at * datetime
domains * integer
sites * integer
wallet_balance * string | null

CommissionOut

NameTypeNotes
invoice * string
client * string
kind * string
pct * integer | null
amount * string
created_at * datetime

DeliveryOut

NameTypeNotes
id * integer
event_id * string
event * string
status * string
attempts * integer
response_code * integer | null
response_body * string
created_at * datetime
delivered_at * datetime | null
next_attempt_at * datetime | null

FundIn

NameTypeNotes
amount * number | string
note string default ""

HandoffIn

NameTypeNotes
email * string

MeOut

NameTypeNotes
account * string
name * string
tier * string
discount_pct * integer
commission_pct * integer
referral_code * string
referral_url * string
wallet_balance * string
currency * string
clients * integer
white_label_host * string | null

PortfolioDomainOut

NameTypeNotes
name * string
account * string
client_id * integer | null
status * string
expires_at * datetime | null
auto_renew * boolean
locked * boolean
nameservers * list[string]

PortfolioSiteOut

NameTypeNotes
id * string
slug * string
name * string
account * string
client_id * integer | null
state * string
desired * string
url * string

PriceOut

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

PricingIn

NameTypeNotes
own_prices * boolean
markups object of integer default {}
agree boolean default false

PricingOut

NameTypeNotes
own_prices * boolean
markups * object of integer
agreed_at * datetime | null
groups * object of string

WebhookCreated

NameTypeNotes
id * integer
url * string
events * list[string]
active * boolean
description * string
failures_in_a_row * integer
last_success_at * datetime | null
created_at * datetime
secret * string

WebhookIn

NameTypeNotes
url * string
events list[string] default []
description string default ""

WebhookOut

NameTypeNotes
id * integer
url * string
events * list[string]
active * boolean
description * string
failures_in_a_row * integer
last_success_at * datetime | null
created_at * datetime

WebhookPatch

NameTypeNotes
url string | null
events list[string] | null
active boolean | null
description string | null