Domains

BASE  https://api.rii.link/v1AUTH: BEARER → AUTHENTICATION

A domain is a host you route links through. Connect it, set two DNS records, and verification flips on its own.

POST/v1/domains

Connect a domain

Returns the two DNS records to set. Status starts at pending_dns and flips automatically — see below.

PARAMETERS
hoststringREQUIRED

The fully-qualified host, e.g. go.example.com.

REQUEST
curl -X POST https://api.rii.link/v1/domains \
-H "Authorization: Bearer $RII_KEY" \
-H "Content-Type: application/json" \
-d '{ "host": "go.example.com" }'
RESPONSE · 201
{
"id": "dom_4kq2m",
"host": "go.example.com",
"status": "pending_dns",
"records": [
{ "type": "CNAME", "name": "go", "value": "edge.rii.link" },
{ "type": "TXT", "name": "_rii.go", "value": "rii-verify=7f3a…" }
]
}
GET/v1/domains

List domains

Every host with status and live link count. links tells you what a disconnect would break.

REQUEST
curl https://api.rii.link/v1/domains \
-H "Authorization: Bearer $RII_KEY"
RESPONSE · 200
{
"data": [
{ "id": "dom_4kq2m", "host": "go.example.com", "status": "active", "links": 214 },
{ "id": "dom_9zz01", "host": "l.example.io", "status": "pending_dns", "links": 0 }
]
}

How verification flips

We poll DNS until both records resolve, then status becomes active — typically under a minute after propagation. This inbound DNS check is the only callback in the system today; outbound webhooks are roadmap, dated on their own page.

NO ACTION NEEDED AFTER THE RECORDS ARE SET — THE FLIP IS AUTOMATIC

DELETE/v1/domains/{id}

Disconnect a domain

Refused with 409 domain_in_use while links still resolve on the host. Move or delete them first, or pass ?force=true and accept the breakage consciously.

REQUEST
curl -X DELETE https://api.rii.link/v1/domains/dom_4kq2m \
-H "Authorization: Bearer $RII_KEY"
RESPONSE · 409 (LINKS STILL LIVE)
{
"error": {
"code": "domain_in_use",
"message": "214 links still resolve on go.example.com.",
"doc_url": "https://rii.link/docs/api/errors#domain_in_use"
}
}