API documentation
Base URL: https://shortest.pages.dev · JSON in, JSON out.
Authentication
Create an API key in the dashboard (sign in with Google). Send it on every request:
Authorization: Bearer sl_xxxxxxxxxxxxxxxx
Keys are shown once and only a SHA-256 hash is stored. You can only see and change your own links. Errors look like {"error": "message"}.
Create a short link
POST /api/links
| Field | Description |
|---|---|
url | Required. Must be http or https, max 2048 characters. Links to this service itself are rejected. |
slug | Optional custom slug, 3-32 characters (A-Z a-z 0-9 - _). Reserved words (api, dashboard, docs, ...) are blocked. Default: random 6-7 characters. |
expires_in_days | Optional number. Default 0 = never expires. |
permanent | Optional boolean. true = 301 redirect, default 302. |
track | Optional boolean, default true. false = do not count clicks. |
curl -X POST https://shortest.pages.dev/api/links \
-H "Authorization: Bearer sl_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/a/very/long/path","slug":"my-link","expires_in_days":30}'
{
"slug": "my-link",
"shortUrl": "https://shortest.pages.dev/my-link",
"url": "https://example.com/a/very/long/path",
"permanent": false,
"track": true,
"createdAt": "2026-11-16T10:00:00.000Z",
"expiresAt": "2026-12-16T10:00:00.000Z",
"clicks": 0
}
Status codes: 201 created, 400 invalid input, 409 slug taken, 401 bad key.
List your links
GET /api/links?limit=20&cursor=... (limit max 20). If cursor in the response is not null, pass it to get the next page.
curl https://shortest.pages.dev/api/links -H "Authorization: Bearer sl_YOUR_KEY"
Get link info / click count
GET /api/links/:slug (includes clicks) · GET /api/links/:slug/clicks
curl https://shortest.pages.dev/api/links/my-link/clicks -H "Authorization: Bearer sl_YOUR_KEY"
# {"slug":"my-link","clicks":12,"tracking":true}
Counts are eventually consistent and approximate: clicks are counted in the background after the redirect, and two clicks at the same instant may count once.
Update a link
PATCH /api/links/:slug with any of url, expires_in_days (0 = remove expiry, counted from now), permanent, track.
curl -X PATCH https://shortest.pages.dev/api/links/my-link \
-H "Authorization: Bearer sl_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/new-target","expires_in_days":0}'
Delete a link
DELETE /api/links/:slug
curl -X DELETE https://shortest.pages.dev/api/links/my-link -H "Authorization: Bearer sl_YOUR_KEY"
Redirects
GET /:slug redirects with 302 (or 301 if permanent). Unknown slug: 404. Expired: 410.
Use it in n8n
Add an HTTP Request node and set:
| Method | POST |
| URL | https://shortest.pages.dev/api/links |
| Authentication | Generic Credential Type → Header Auth. Name: Authorization, Value: Bearer sl_YOUR_KEY |
| Send Body | on · Body Content Type: JSON · Specify Body: Using JSON |
| JSON | {"url": "{{ $json.url }}", "expires_in_days": 30} |
The node outputs the JSON above. Use {{ $json.shortUrl }} in later nodes (email, Telegram, Sheets, ...). To read click counts, use a second HTTP Request node with method GET and URL https://shortest.pages.dev/api/links/{{ $json.slug }}/clicks using the same credential.