REST API

Base URL https://linkrail.io/api/v1. Create an API key in the dashboard under API and send it as Authorization: Bearer <key>. Each key can make 120 requests per minute. The full OpenAPI 3.1 description is at /api/v1/openapi.json.

Endpoints

MethodPathWhat it does
GET/linksList links
POST/linksCreate a link
GET/links/{id}Get a link
PATCH/links/{id}Update a link. Only fields present are changed. Changing the destination keeps the short URL.
DELETE/links/{id}Delete a link
GET/links/{id}/statsClick statistics for a link
GET/links/{id}/tracking-templateGoogle Ads tracking template. Available once a tracking domain is certified by Google.
GET/domainsList domains available for links

Create a link

curl -X POST https://linkrail.io/api/v1/links \
  -H "Authorization: Bearer lk_..." \
  -H "Content-Type: application/json" \
  -d '{"destinationUrl": "https://shop.example.com/spring", "slug": "spring", "tags": ["sale"]}'

Optional fields: domain (hostname, default lkrl.ink), title, folderId, redirectCode (301 or 302), password, expiresAt (ISO 8601), expiredRedirectUrl, maxClicks.

Update a link

curl -X PATCH https://linkrail.io/api/v1/links/<id> \
  -H "Authorization: Bearer lk_..." -H "Content-Type: application/json" \
  -d '{"destinationUrl": "https://shop.example.com/summer"}'

Stats

curl "https://linkrail.io/api/v1/links/<id>/stats?from=2026-10-01T00:00:00Z&interval=day" \
  -H "Authorization: Bearer lk_..."

Errors

Errors return a JSON body like {"error": {"code": "invalid_input", "message": "...", "field": "slug"}}.

400Malformed request
401Missing or invalid API key
403Feature not available to this workspace
404Not found
422Validation failed (see field)
429Rate limited; retry after the Retry-After seconds