LOCALHOST
All pages
Start

Keys and permissions

API keys, scopes, acting for a client, paid calls.

API keys

Keys are made in the panel under API keys, by anyone with the developer role or above. Each key belongs to one account, has a name, a set of permissions and an optional expiry, and is shown once. Send it as a bearer token on every call:

Authorization: Bearer lh_…

Revoke a key on the same page and it stops working at once. The panel shows when each key was last used.

Permissions

A key carries permissions (scopes) of the form area:read or area:write. Write includes read. * is full access. Every endpoint in the reference shows the permission it needs; a call without it is refused with 403 and a message naming the missing one.

AreaPermissionCovers
sitessites:read · sites:writeSites and apps
websiteswebsites:read · websites:writeWebsites made with the builder
businessbusiness:read · business:writeOrders, bookings, members and jobs
domainsdomains:read · domains:writeDomains
dnsdns:read · dns:writeDNS records
mailmail:read · mail:writeEmail
databasesdatabases:read · databases:writeDatabases
billingbilling:read · billing:writeBilling and wallet
smssms:read · sms:writeSMS: sending, campaigns and one-time codes
phone_authphone_auth:read · phone_auth:writePhone Auth: send and check sign-in codes, nothing else
clientsclients:read · clients:writePartner clients (act for clients you manage)
webhookswebhooks:read · webhooks:writePartner webhooks
**Full access: everything above, and the few endpoints that take nothing less (closing the account, downloading its data, Connect).

Who may make which key. Owners and admins can include billing permissions or full access. Developers can make keys for everything else: a key never does more than the person who made it may.

Reads with any key. A handful of endpoints (the wallet balance, invoices, the list of databases, a partner's own profile) answer any valid key of the account; the reference marks them Any key.

Acting for a client

An approved partner can work inside a client account it manages by adding one header to any call, with a key that has the clients permission:

X-Client-Account: mukoko-hardware

Everything then happens in that client's account, paid from that client's wallet unless the call offers pay_from. The partner's own endpoints under /resellers/ refuse the header: they always work on the partner's account. The lh command line does the same with --client.

Paid calls

Registering, renewing or moving a name, creating a site, sending messages: these charge the account's wallet at once. When the wallet is short the answer is 402 with what it has and what the call needs; top up in the panel and try again.

Every paid call accepts an Idempotency-Key header, any unique string up to 80 characters. Send the same key with the same body after a timeout and you get the first answer back instead of paying twice. The lh command line sends a fresh one on every paid call.

Idempotency-Key: order-2026-11-08-0042

Work that the registry finishes later answers 202. The name's status moves from pending to active, and partners can hear about it through a webhook instead of asking again.

Conventions

Base address
https://api.localhost.co.zw
Format
JSON in and out. Send Content-Type: application/json with a body.
Dates
ISO 8601, in UTC.
Money
Strings with two decimals, in USD, with a currency field where it matters.
Not yours
A thing on another account is a 404, never a 403: the API doesn't reveal what exists elsewhere.
Machine-readable
openapi.json, OpenAPI 3.1.