Developer API Reference
Integrate Minilnk's URL shortening, custom routing, dynamic QR codes, and click analytics directly into your own workflows and systems.
Overview
The Minilnk API is structured around REST. All API requests should be made to the base URL below. Our API returns JSON-encoded responses and accepts standard JSON payloads for POST and PUT requests.
https://minilink.at/api/v1
Authentication
To authenticate API requests, generate a key from your user dashboard at API Keys.
Your API key must be supplied in every request using one of the three supported methods below. We recommend using the bearer authorization header:
- Authorization Header:
Authorization: Bearer YOUR_API_KEY - Custom Header:
X-API-Key: YOUR_API_KEY - Query Parameter:
?api_key=YOUR_API_KEY
Rate Limiting
API rate limits are applied per API key on a per-minute rolling window basis. When you exceed the rate limits, the API returns a 429 Too Many Requests response. Rate limits are partitioned by your active subscription plan:
| Subscription Plan | Rate Limit | API Access |
|---|---|---|
| Free Plan | 60 requests / minute | Premium Required |
| Pro Plan | 120 requests / minute | Enabled |
| Enterprise Plan | 300 requests / minute | Enabled |
Error Codes
Minilnk uses standard HTTP response codes to indicate the success or failure of an API request. In general, 2xx codes indicate success, 4xx codes indicate an error in the request parameters or key access, and 5xx codes indicate server-side errors.
| Code | Status | Description |
|---|---|---|
200 |
OK | Request completed successfully. |
201 |
Created | Resource created successfully. |
400 |
Bad Request | Missing or invalid request payload. |
401 |
Unauthorized | Missing, inactive, or expired API key. |
403 |
Forbidden | Action blocked due to subscription tier limits (e.g. no api_access, custom alias lock, link limit reached). |
404 |
Not Found | The requested resource does not exist. |
422 |
Unprocessable | Validation failures (e.g. original_url format error or loopback warning). |
429 |
Too Many Requests | Rate limit exceeded. Try again in the next minute. |
Links API
GET /links
Retrieve a paginated list of all shortened URLs created by your user account.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
search |
string (optional) | Filter results matching title, original url, or short code. |
page |
integer (optional) | Page number for pagination. Defaults to 1. |
curl -X GET "https://minilink.at/api/v1/links?search=github" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"
{
"current_page": 1,
"data": [
{
"id": 42,
"user_id": 2,
"domain_id": null,
"original_url": "https://github.com/google",
"short_code": "goglhb",
"alias": null,
"title": "Google GitHub Profile",
"description": null,
"total_clicks": 12,
"unique_clicks": 10,
"is_active": true,
"created_at": "2026-05-24T22:00:00.000000Z",
"short_url": "https://minilink.at/goglhb"
}
],
"first_page_url": "https://minilink.at/api/v1/links?page=1",
"from": 1,
"last_page": 1,
"per_page": 15,
"to": 1,
"total": 1
}
POST /links
Create a new shortened link pointing to an original destination URL.
Request Body Fields
| Field | Type | Description |
|---|---|---|
original_url |
string Required | The destination URL. Must be valid, max 2048 chars. |
alias |
string (optional) | Custom path/alias. Requires Pro/Enterprise plans. (min: 3, max: 20, alpha_num). |
title |
string (optional) | Custom title label. If omitted, fetches title dynamically from page headers. |
password |
string (optional) | Password protection string. Requires Pro/Enterprise plans. |
expires_at |
datetime (optional) | Expiration date/time (after now). Requires Pro/Enterprise plans. |
curl -X POST "https://minilink.at/api/v1/links" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"original_url": "https://news.ycombinator.com",
"alias": "hnnews",
"title": "Hacker News"
}'
{
"id": 43,
"user_id": 2,
"domain_id": null,
"original_url": "https://news.ycombinator.com",
"short_code": "hnnews",
"alias": "hnnews",
"title": "Hacker News",
"description": null,
"total_clicks": 0,
"unique_clicks": 0,
"is_active": true,
"created_at": "2026-05-24T22:05:00.000000Z",
"short_url": "https://minilink.at/hnnews"
}
GET /links/{id}
Retrieve detailed metadata for a single shortened link.
Requires the integer id of the link resource in the URL path. Returns the link object structure if found and owned by the calling developer account.
curl -X GET "https://minilink.at/api/v1/links/43" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"
{
"id": 43,
"user_id": 2,
"domain_id": null,
"original_url": "https://news.ycombinator.com",
"short_code": "hnnews",
"alias": "hnnews",
"title": "Hacker News",
"description": null,
"total_clicks": 0,
"unique_clicks": 0,
"is_active": true,
"created_at": "2026-05-24T22:05:00.000000Z",
"short_url": "https://minilink.at/hnnews"
}
PUT /links/{id}
Update attributes of an existing shortened URL.
Request Body Fields
| Field | Type | Description |
|---|---|---|
original_url |
string Required | The updated destination URL. |
title |
string (optional) | Update the title label. |
password |
string (optional) | Update or add password protection. |
expires_at |
datetime (optional) | Update expiration limit. |
remove_password |
boolean (optional) | Pass true to clear password protection. |
remove_expiration |
boolean (optional) | Pass true to clear expiration deadline. |
curl -X PUT "https://minilink.at/api/v1/links/43" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"original_url": "https://news.ycombinator.com/news",
"title": "Hacker News Feed"
}'
{
"id": 43,
"user_id": 2,
"domain_id": null,
"original_url": "https://news.ycombinator.com/news",
"short_code": "hnnews",
"alias": "hnnews",
"title": "Hacker News Feed",
"description": null,
"total_clicks": 0,
"unique_clicks": 0,
"is_active": true,
"created_at": "2026-05-24T22:05:00.000000Z",
"short_url": "https://minilink.at/hnnews"
}
DELETE /links/{id}
Permanently delete a short link from the system.
Soft deletes the link record associated with the ID. Any traffic attempting to visit this code will now result in a 404 Not Found error page.
curl -X DELETE "https://minilink.at/api/v1/links/43" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"
{
"message": "Link deleted successfully."
}
QR Codes API
GET /qrcodes
Retrieve a paginated list of all customizable QR codes created by your account.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
search |
string (optional) | Filter QR codes by name. |
page |
integer (optional) | Page number. |
curl -X GET "https://minilink.at/api/v1/qrcodes" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"
{
"current_page": 1,
"data": [
{
"id": 10,
"user_id": 2,
"link_id": 43,
"name": "Hacker News QR",
"content": "https://minilink.at/hnnews",
"type": "url",
"foreground_color": "#000000",
"background_color": "#FFFFFF",
"margin": 4,
"size": 300,
"error_correction": "M",
"is_dynamic": true,
"created_at": "2026-05-24T22:10:00.000000Z",
"download_svg_url": "https://minilink.at/dashboard/qrcodes/10/download/svg",
"download_png_url": "https://minilink.at/dashboard/qrcodes/10/download/png",
"preview_svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" ...></svg>"
}
],
"total": 1
}
POST /qrcodes
Generate a new custom QR code image.
Request Body Fields
| Field | Type | Description |
|---|---|---|
name |
string Required | Label name of the QR code. |
type |
string Required | Type of contents: url, text, email, sms, phone. |
content |
string Required | Target payload (e.g. url, text body, or number). Max 1000 chars. |
foreground_color |
string (optional) | Hex format (`#000000`). Customizations require Pro/Enterprise plan. |
background_color |
string (optional) | Hex format (`#FFFFFF`). Customizations require Pro/Enterprise plan. |
margin |
integer (optional) | Quiet zone margin blocks (0 to 10). Defaults to 4. |
size |
integer (optional) | Image scale dimensions (100 to 1000). Defaults to 300. |
error_correction |
string Required | ECC Tolerance level: L (7%), M (15%), Q (25%), H (30%). |
link_id |
integer (optional) | Associate with a short link ID. Enables dynamic scan count updates. |
curl -X POST "https://minilink.at/api/v1/qrcodes" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"name": "HN Dynamic QR",
"type": "url",
"content": "https://minilink.at/hnnews",
"error_correction": "H",
"link_id": 43
}'
{
"id": 11,
"user_id": 2,
"link_id": 43,
"name": "HN Dynamic QR",
"content": "https://minilink.at/hnnews",
"type": "url",
"foreground_color": "#000000",
"background_color": "#FFFFFF",
"margin": 4,
"size": 300,
"error_correction": "H",
"is_dynamic": true,
"created_at": "2026-05-24T22:15:00.000000Z",
"download_svg_url": "https://minilink.at/dashboard/qrcodes/11/download/svg",
"download_png_url": "https://minilink.at/dashboard/qrcodes/11/download/png",
"preview_svg": "<svg ...></svg>"
}
GET /qrcodes/{id}
Retrieve config and image preview data for a specific QR code.
Access details of the QR code. You can directly draw the returned preview_svg string into your HTML view templates to show the image instantly without calling additional files.
curl -X GET "https://minilink.at/api/v1/qrcodes/11" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"
{
"id": 11,
"user_id": 2,
"link_id": 43,
"name": "HN Dynamic QR",
"content": "https://minilink.at/hnnews",
"type": "url",
"foreground_color": "#000000",
"background_color": "#FFFFFF",
"margin": 4,
"size": 300,
"error_correction": "H",
"is_dynamic": true,
"download_svg_url": "https://minilink.at/dashboard/qrcodes/11/download/svg",
"download_png_url": "https://minilink.at/dashboard/qrcodes/11/download/png",
"preview_svg": "<svg ...></svg>"
}
DELETE /qrcodes/{id}
Permanently delete a QR code configuration from the database.
Removes the QR code entry. Associated links are NOT affected, but scan tracking statistics will be stopped.
curl -X DELETE "https://minilink.at/api/v1/qrcodes/11" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"
{
"message": "QR Code deleted successfully."
}
Analytics API
GET /links/{id}/analytics
Retrieve detailed click log metrics, country breakdowns, os and browser percentages, and device counts for a single link.
This endpoint provides direct raw access to click rates. Returns complete aggregated statistics including recent logs to construct custom charts.
curl -X GET "https://minilink.at/api/v1/links/43/analytics" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"
{
"link": {
"id": 43,
"title": "Hacker News Feed",
"short_code": "hnnews",
"short_url": "https://minilink.at/hnnews",
"original_url": "https://news.ycombinator.com/news",
"total_clicks": 40,
"unique_clicks": 32
},
"summary": {
"total_clicks": 40,
"unique_clicks": 32
},
"breakdown": {
"clicks_over_time": [
{ "date": "2026-05-24", "count": 40 }
],
"devices": [
{ "device_type": "desktop", "count": 28 },
{ "device_type": "mobile", "count": 12 }
],
"countries": [
{ "country": "United States", "country_code": "US", "count": 25 },
{ "country": "Germany", "country_code": "DE", "count": 15 }
],
"browsers": [
{ "browser": "Chrome", "count": 30 },
{ "browser": "Firefox", "count": 10 }
]
}
}