Links
The link object
{
"id": 1,
"slug": "abc1234",
"url": "https://example.com/some/long/path",
"shortUrl": "https://rzwn.link/abc1234",
"title": "Optional label",
"enabled": true,
"clickCount": 42,
"lastClickedAt": "2026-07-24T12:34:56.000Z", // or null
"expiresAt": null, // or ISO date string
"createdAt": "2026-07-01T00:00:00.000Z",
"updatedAt": "2026-07-01T00:00:00.000Z"
}
List links
curl "https://rzwn.link/api/links?q=example&enabled=true&limit=50&offset=0" \
-H "Authorization: Bearer $API_TOKEN"
qstringquerySearch slug, url, and title (substring match).
enabledbooleanqueryFilter by true or false.
limitintegerquerydefault: 50Max results. Capped at 200.
offsetintegerquerydefault: 0Pagination offset.
{
"links": [ /* Link[] */ ],
"total": 12,
"limit": 50,
"offset": 0
}
Create a link
curl -X POST https://rzwn.link/api/links \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"slug": "custom-slug",
"title": "Optional label",
"enabled": true,
"expiresAt": "2026-12-31T00:00:00.000Z"
}'
urlstringbodyrequiredMust be a valid URL.
slugstringbody1-64 characters, letters/numbers/hyphens/underscores only. Auto-generated (7-character
nanoid) if omitted. api, _next, favicon.ico, robots.txt, and sitemap.xml are
reserved.
titlestringbodyUsed as the OpenGraph title when the link is shared. Falls back to the slug.
enabledbooleanbodydefault: trueexpiresAtstringbodyISO date string. The redirect 404s (redirects to /) after this time.
Returns 201 with the created link, 409 if the requested slug is taken, 400 on
validation errors.
Get a link
curl https://rzwn.link/api/links/example \
-H "Authorization: Bearer $API_TOKEN"
404 if it doesn't exist.
Update a link
curl -X PATCH https://rzwn.link/api/links/example \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "title": "New title", "enabled": false }'
Accepts any subset of url, slug (to rename), title, enabled, expiresAt (pass
null to clear). Returns the updated link, 409 if renaming to a slug that's taken.
Delete a link
curl -X DELETE https://rzwn.link/api/links/example \
-H "Authorization: Bearer $API_TOKEN"
Deletes the link and all of its click history. Returns 204 with no body.