Links

The link object

jsonc
{
  "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

bash
curl "https://rzwn.link/api/links?q=example&enabled=true&limit=50&offset=0" \
  -H "Authorization: Bearer $API_TOKEN"
qstringquery

Search slug, url, and title (substring match).

enabledbooleanquery

Filter by true or false.

limitintegerquerydefault: 50

Max results. Capped at 200.

offsetintegerquerydefault: 0

Pagination offset.

json
{
  "links": [ /* Link[] */ ],
  "total": 12,
  "limit": 50,
  "offset": 0
}

Create a link

bash
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"
  }'
urlstringbodyrequired

Must be a valid URL.

slugstringbody

1-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.

titlestringbody

Used as the OpenGraph title when the link is shared. Falls back to the slug.

enabledbooleanbodydefault: true
expiresAtstringbody

ISO 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

bash
curl https://rzwn.link/api/links/example \
  -H "Authorization: Bearer $API_TOKEN"

404 if it doesn't exist.

Update a link

bash
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

bash
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.