ShortLink API
Build link management, QR generation, and click analytics into your application with a simple REST API.
Introduction
The ShortLink API lets you create and manage short links, generate QR codes, and retrieve click analytics from your own application. All endpoints follow REST conventions and return JSON responses.
Base URL
https://api.shortlink.app/api/v1Versioning
The current API version is v1. Breaking changes will be released under a new version path. The v1 path remains stable.
Request format
All POST and PATCH requests must include Content-Type: application/json and a JSON body. GET and DELETE requests do not require a body.
Authentication
Every request must include your API key in the Authorization header. Generate a key from your API Keys dashboard.
Header format
Authorization: Bearer YOUR_API_KEYExample request
curl https://api.shortlink.app/api/v1/links \
-H "Authorization: Bearer YOUR_API_KEY"Links API
Create, retrieve, update, and delete short links in your workspace.
/linksCreate a new short link/linksList all links (paginated)/links/:idGet a single link by ID/links/:idUpdate link title or URL/links/:idDelete a linkCreate a short link
Shorten a URL and optionally set a title, UTM parameters, expiry, or password.
curl -X POST https://api.shortlink.app/api/v1/links \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"original_url": "https://example.com/long-page",
"title": "My Landing Page",
"utm_source": "newsletter"
}'Request body fields
original_urlstringrequiredThe destination URL to shortenslugstringoptionalCustom slug (auto-generated if omitted)titlestringoptionalDisplay name for the linkutm_sourcestringoptionalUTM source parameterutm_mediumstringoptionalUTM medium parameterutm_campaignstringoptionalUTM campaign parameterexpires_atstringoptionalISO 8601 expiry datepasswordstringoptionalPassword-protect the linkList links
Returns a paginated list of links in your workspace.
curl "https://api.shortlink.app/api/v1/links?page=1&limit=20" \
-H "Authorization: Bearer YOUR_API_KEY"QR Codes API
Generate and manage QR codes linked to your short links.
/qrGenerate a new QR code/qrList all QR codes/qr/:idGet a single QR code/qr/:idDelete a QR codeGenerate a QR code
curl -X POST https://api.shortlink.app/api/v1/qr \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"link_id": "LINK_ID",
"name": "Product QR",
"fg_color": "#1a1a1a",
"bg_color": "#ffffff",
"dot_style": "dots"
}'Style options
link_idstringLink ID to encode in the QRnamestringLabel for the QR codefg_colorstringForeground color (hex, default #000000)bg_colorstringBackground color (hex, default #ffffff)dot_stylestringsquare | dots | rounded (default square)corner_stylestringsquare | rounded (default square)logo_urlstringURL of logo to embed in centerAnalytics API
Retrieve click statistics for any link in your workspace. Data is available for the past 30 days on Free, 6 months on Pro, and 12 months on Business.
/analyticsWorkspace-level overview (total clicks, top links)/analytics/links/:idPer-link breakdown (countries, devices, referrers)Link analytics
Pass a period query parameter: 7d, 30d, or 90d.
curl "https://api.shortlink.app/api/v1/analytics/links/LINK_ID?period=30d" \
-H "Authorization: Bearer YOUR_API_KEY"Rate Limits
API requests are rate-limited per API key on a rolling one-hour window. When you exceed the limit, the API returns a 429 Too Many Requests response.
100 requests / hour1,000 requests / hour10,000 requests / hourRate limit headers are included in every response:
X-RateLimit-LimitMaximum requests allowed in the windowX-RateLimit-RemainingRequests remaining in the current windowX-RateLimit-ResetUnix timestamp when the window resetsError Codes
All error responses follow a consistent format with an HTTP status code and a JSON body:
{
"message": "A human-readable description of the error",
"statusCode": 400
}200OKRequest succeeded201CreatedResource created successfully400Bad RequestInvalid request body or parameters401UnauthorizedMissing or invalid API key403ForbiddenAction not allowed on your current plan404Not FoundResource does not exist409ConflictDuplicate slug or domain already registered429Too Many RequestsRate limit exceeded500Internal Server ErrorUnexpected server errorReady to start building?
Generate your API key and start shortening links in minutes.