Links

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

A link is a mapping: a slug on a domain, a fallback url, and an ordered list of routing rules that decide per visitor.

POST/v1/links

Create a link

The one required field is url. Everything else — slug, domain, routing — has a working default, so the minimum viable create is one field.

PARAMETERS
urlstringREQUIRED

Fallback destination — where visitors go when no rule matches.

slugstring

Path on the domain. Omitted → generated, readable, collision-checked.

domainstring

Defaults to rii.link. Any verified host on the workspace.

routingarray

Ordered if/then rules — see PATCH below for the shape.

expires_attimestamp

After this moment the link answers 410 instead of routing.

REQUEST
curl -X POST https://api.rii.link/v1/links \
-H "Authorization: Bearer $RII_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/summer",
"slug": "summer",
"routing": [
{ "if": { "country": "DE" }, "to": "https://example.de/sommer" }
]
}'
RESPONSE · 201
{
"id": "lnk_8h2f0q",
"slug": "summer",
"domain": "rii.link",
"short_url": "https://rii.link/summer",
"url": "https://example.com/summer",
"routing": [
{ "if": { "country": "DE" }, "to": "https://example.de/sommer" }
],
"created_at": "2026-08-12T09:14:03Z"
}
GET/v1/links

List links

Cursor-paginated, newest first. Filter to one domain to audit a host before disconnecting it.

PARAMETERS
limitinteger

Default 25, max 100.

cursorstring

next_cursor from the previous page.

domainstring

Only links on this host.

REQUEST
curl "https://api.rii.link/v1/links?limit=25" \
-H "Authorization: Bearer $RII_KEY"
RESPONSE · 200
{
"data": [
{ "id": "lnk_8h2f0q", "slug": "summer", "short_url": "https://rii.link/summer" },
{ "id": "lnk_2xw11p", "slug": "press", "short_url": "https://rii.link/press" }
],
"next_cursor": "c_9f2k1"
}
GET/v1/links/{id}

Retrieve a link

The full object, including the routing array in evaluation order.

REQUEST
curl https://api.rii.link/v1/links/lnk_8h2f0q \
-H "Authorization: Bearer $RII_KEY"
RESPONSE · 200
{
"id": "lnk_8h2f0q",
"slug": "summer",
"short_url": "https://rii.link/summer",
"routing": [
{ "if": { "country": "DE" }, "to": "https://example.de/sommer" }
]
}
PATCH/v1/links/{id}

Update a link

PATCH semantics per field — but routing replaces the whole array on write. Send it in the order you want it evaluated; first match wins.

PARAMETERS
routingarray

The full rule list. Conditions: country, device, language, time. First match wins.

urlstring

New fallback destination.

slugstring

Renames the path — the old slug 301s for 30 days.

REQUEST
curl -X PATCH https://api.rii.link/v1/links/lnk_8h2f0q \
-H "Authorization: Bearer $RII_KEY" \
-H "Content-Type: application/json" \
-d '{
"routing": [
{ "if": { "device": "ios" }, "to": "https://apps.apple.com/app/id0000000" },
{ "if": { "country": "DE" }, "to": "https://example.de/sommer" }
]
}'
RESPONSE · 200
{
"id": "lnk_8h2f0q",
"routing": [
{ "if": { "device": "ios" }, "to": "https://apps.apple.com/app/id0000000" },
{ "if": { "country": "DE" }, "to": "https://example.de/sommer" }
],
"updated_at": "2026-08-12T09:15:21Z"
}
DELETE/v1/links/{id}

Delete a link

Deletes the mapping and quarantines the slug for 30 days before it can be re-claimed — a reprinted poster should never route somewhere new silently.

REQUEST
curl -X DELETE https://api.rii.link/v1/links/lnk_8h2f0q \
-H "Authorization: Bearer $RII_KEY"
RESPONSE
HTTP/2 204