Iniciar sesión Registrarse
Developer Portal

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.

BASE URL 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:

  1. Authorization Header: Authorization: Bearer YOUR_API_KEY
  2. Custom Header: X-API-Key: YOUR_API_KEY
  3. Query Parameter: ?api_key=YOUR_API_KEY
Warning: Keep your keys private. Do not commit keys to GitHub, share them, or use them in client-side code where they could be easily extracted.

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


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"
Response
{
  "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
  }'
Response
{
  "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"
Response
{
  "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"
Response
{
  "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"
Response
{
  "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 }
    ]
  }
}

Subscribe to our newsletter

Get the latest updates, tips, and articles about URL optimization, QR marketing, and growth hacking.