← Zurück zur Startseite

API-Dokumentation

REST-API für LinkFlink Business-Accounts. Baue deine Klick-Daten direkt in Zapier, Make, BI-Dashboards oder eigene Tools ein.

Schnellstart

  1. In Dashboard → Einstellungen → API-Zugang einen Key erstellen.
  2. Key sicher speichern — wird nur einmal angezeigt.
  3. In jedem Request den Header mitschicken:Authorization: Bearer lf_...

Basis-URL: https://linkflink.de/api/v1
Antworten sind immer JSON, mit Content-Type: application/json; charset=utf-8.

Mehrere Konten (Agenturen & Teams)

Bist du in weiteren Konten Teammitglied — etwa weil du als Agentur Kundenkonten betreust —, reicht ein einziger Key für alle. Du brauchst keinen Key pro Kunde.

  1. Mit GET /accounts die Konten und ihre account_id abrufen.
  2. Bei jedem weiteren Aufruf das Konto mitgeben, z. B. /links?account_id=….

Wichtig für Automatisierungen: Ohne account_id antwortet die API für das Konto, das du gerade im Dashboard ausgewählt hast. Schaltest du dort um, zieht dein Skript sonst plötzlich Daten eines anderen Kunden. Gib die account_id deshalb immer explizit an. Konten ohne Zugriff antworten mit 404.

Authentifizierung & Fehler

StatusBodyWann
401missing_authorizationHeader fehlt
401invalid_key_formatPräfix falsch (muss lf_ sein)
401invalid_keyKey unbekannt oder gelöscht
403plan_requiredKein Business-Plan
404not_foundRessource existiert nicht oder gehört anderem Account
429rate_limit_exceeded60 Requests/Min Limit pro Key erreicht
500query_failedDB-Fehler (selten)

Bei 429 mitgeschickt: Retry-After: 60, X-RateLimit-Limit: 60, X-RateLimit-Window: 60.

GET/accounts

Alle Konten, auf die dein Key zugreifen darf: dein eigenes zuerst, danach Konten, in denen du Teammitglied bist (z. B. betreute Kundenkonten). Die account_id brauchst du für alle anderen Endpunkte.

curl▶
curl -H "Authorization: Bearer lf_..." \
  "https://linkflink.de/api/v1/accounts"
JavaScript▶
const res = await fetch("https://linkflink.de/api/v1/accounts", {
  headers: { Authorization: `Bearer ${API_KEY}` },
});
const { accounts } = await res.json();
Python▶
r = requests.get(
    "https://linkflink.de/api/v1/accounts",
    headers={"Authorization": f"Bearer {API_KEY}"},
)
accounts = r.json()["accounts"]

Response

{
  "accounts": [
    { "account_id": "b30f...", "name": "Deine Agentur", "is_own": true, "can_write": true },
    { "account_id": "e3f1...", "name": "Kunde A", "is_own": false, "can_write": true },
    { "account_id": "112b...", "name": "Kunde B", "is_own": false, "can_write": true }
  ]
}
GET/links

Alle Links des Accounts. Standalone-Links haben magnet_id=null und target_url gesetzt.

Query-Parameter

  • archived boolean— true = nur archivierte, false = nur aktive, weggelassen = alle
  • account_id uuid— Welches Konto (aus /accounts). Für Automatisierungen immer mitgeben — ohne Angabe gilt das gerade im Dashboard ausgewählte Konto.
curl▶
curl -H "Authorization: Bearer lf_..." \
  "https://linkflink.de/api/v1/links?archived=false"
JavaScript▶
const res = await fetch("https://linkflink.de/api/v1/links?archived=false", {
  headers: { Authorization: `Bearer ${API_KEY}` },
});
const { links } = await res.json();
Python▶
import requests

r = requests.get(
    "https://linkflink.de/api/v1/links",
    params={"archived": "false"},
    headers={"Authorization": f"Bearer {API_KEY}"},
)
links = r.json()["links"]

Response

{
  "links": [
    {
      "id": "8f3a1c...",
      "title": "IG Reel Frühling 2026",
      "platform": "instagram",
      "short_code": "x7k2mp",
      "slug": "spring-freebie",
      "post_url": "https://instagram.com/p/...",
      "target_url": null,
      "created_at": "2026-03-14T10:22:00Z",
      "is_archived": false,
      "tags": ["campaign:spring-2026"],
      "magnet_id": "b4e2..."
    },
    {
      "id": "9c4b2d...",
      "title": "Notion-Affiliate",
      "platform": "instagram",
      "short_code": "notion",
      "slug": "notion-affiliate",
      "post_url": null,
      "target_url": "https://notion.so/?ref=sascha",
      "created_at": "2026-04-22T09:10:00Z",
      "is_archived": false,
      "tags": [],
      "magnet_id": null
    }
  ]
}
GET/links/{id}

Ein Link inkl. lifetime Klick-Zahl.

Query-Parameter

  • account_id uuid— Welches Konto (aus /accounts). Für Automatisierungen immer mitgeben — ohne Angabe gilt das gerade im Dashboard ausgewählte Konto.
curl▶
curl -H "Authorization: Bearer lf_..." \
  "https://linkflink.de/api/v1/links/8f3a1c..."
JavaScript▶
const res = await fetch(`https://linkflink.de/api/v1/links/${linkId}`, {
  headers: { Authorization: `Bearer ${API_KEY}` },
});
const { link } = await res.json();
console.log(link.total_clicks);
Python▶
r = requests.get(
    f"https://linkflink.de/api/v1/links/{link_id}",
    headers={"Authorization": f"Bearer {API_KEY}"},
)
link = r.json()["link"]
print(link["total_clicks"])

Response

{
  "link": {
    "id": "8f3a1c...",
    "title": "IG Reel Frühling 2026",
    "platform": "instagram",
    "short_code": "x7k2mp",
    "total_clicks": 412,
    ...
  }
}
GET/clicks

Einzelne Klick-Events zu einem Link (max 1000 pro Request). Feld 'via' kennzeichnet die Quelle: 'bio_page' wenn der Klick über deine LinkFlink-Bio-Page kam, null = direkt (Social Post, QR, Mail).

Query-Parameter

  • link_id uuid(required)
  • from ISO timestamp— inklusive untere Grenze
  • to ISO timestamp— exklusive obere Grenze
  • limit integer— 1-1000, Default 100. Neueste zuerst — für mehr Daten den Zeitraum mit from/to aufteilen.
  • account_id uuid— Welches Konto (aus /accounts). Für Automatisierungen immer mitgeben — ohne Angabe gilt das gerade im Dashboard ausgewählte Konto.
curl▶
curl -H "Authorization: Bearer lf_..." \
  "https://linkflink.de/api/v1/clicks?link_id=8f3a1c...&from=2026-04-01&limit=100"
JavaScript▶
const url = new URL("https://linkflink.de/api/v1/clicks");
url.searchParams.set("link_id", linkId);
url.searchParams.set("from", "2026-04-01");
url.searchParams.set("limit", "100");
const res = await fetch(url, {
  headers: { Authorization: `Bearer ${API_KEY}` },
});
const { clicks } = await res.json();
Python▶
r = requests.get(
    "https://linkflink.de/api/v1/clicks",
    params={
        "link_id": link_id,
        "from": "2026-04-01",
        "limit": 100,
    },
    headers={"Authorization": f"Bearer {API_KEY}"},
)
clicks = r.json()["clicks"]

Response

{
  "link_id": "8f3a1c...",
  "count": 47,
  "limit": 100,
  "clicks": [
    {
      "clicked_at": "2026-04-14T18:33:21Z",
      "device": "mobile",
      "country": "DE",
      "referrer": "https://instagram.com",
      "via": "bio_page"
    }
  ]
}
GET/conversions

Conversion-Events zu einem Link oder Magnet (max 1000 pro Request).

Query-Parameter

  • link_id uuid— entweder link_id oder magnet_id
  • magnet_id uuid— entweder link_id oder magnet_id
  • from ISO timestamp— inklusive untere Grenze
  • to ISO timestamp— exklusive obere Grenze
  • limit integer— 1-1000, Default 100
  • account_id uuid— Welches Konto (aus /accounts). Für Automatisierungen immer mitgeben — ohne Angabe gilt das gerade im Dashboard ausgewählte Konto.
curl▶
curl -H "Authorization: Bearer lf_..." \
  "https://linkflink.de/api/v1/conversions?magnet_id=9fbbe8fb...&from=2026-04-01"
JavaScript▶
const url = new URL("https://linkflink.de/api/v1/conversions");
url.searchParams.set("magnet_id", magnetId);
url.searchParams.set("from", "2026-04-01");
const res = await fetch(url, {
  headers: { Authorization: `Bearer ${API_KEY}` },
});
const { conversions } = await res.json();
Python▶
r = requests.get(
    "https://linkflink.de/api/v1/conversions",
    params={
        "magnet_id": magnet_id,
        "from": "2026-04-01",
    },
    headers={"Authorization": f"Bearer {API_KEY}"},
)
conversions = r.json()["conversions"]

Response

{
  "magnet_id": "9fbbe8fb...",
  "count": 12,
  "limit": 100,
  "conversions": [
    {
      "occurred_at": "2026-04-24T09:07:02Z",
      "magnet_id": "9fbbe8fb...",
      "link_id": "b31dfc64...",
      "utm_source": "instagram",
      "utm_medium": "social",
      "utm_campaign": "launch-scale",
      "utm_content": "reel-12",
      "source_tool": "kit"
    }
  ]
}
GET/stats

Summen über alle Links eines Kontos für einen Zeitraum: Klicks, Conversions, Umsatz und die stärksten Links. Ein Aufruf statt vieler — ideal für Reports und Kundenportale.

Query-Parameter

  • from ISO timestamp— inklusive untere Grenze, ohne Angabe: alle Zeiten
  • to ISO timestamp— exklusive obere Grenze
  • account_id uuid— Welches Konto (aus /accounts). Für Automatisierungen immer mitgeben — ohne Angabe gilt das gerade im Dashboard ausgewählte Konto.
curl▶
curl -H "Authorization: Bearer lf_..." \
  "https://linkflink.de/api/v1/stats?account_id=e3f1...&from=2026-09-01&to=2026-10-01"
JavaScript▶
const url = new URL("https://linkflink.de/api/v1/stats");
url.searchParams.set("account_id", accountId);
url.searchParams.set("from", "2026-09-01");
url.searchParams.set("to", "2026-10-01");
const res = await fetch(url, {
  headers: { Authorization: `Bearer ${API_KEY}` },
});
const stats = await res.json();
Python▶
r = requests.get(
    "https://linkflink.de/api/v1/stats",
    params={"account_id": account_id, "from": "2026-09-01", "to": "2026-10-01"},
    headers={"Authorization": f"Bearer {API_KEY}"},
)
stats = r.json()

Response

{
  "from": "2026-09-01",
  "to": "2026-10-01",
  "links_total": 14,
  "clicks": 1873,
  "clicks_via_bio": 212,
  "conversions": 96,
  "revenue_cents": 348000,
  "revenue": 3480,
  "currency": "EUR",
  "top_links": [ ... ]
}
Fragen oder feature-requests? Schreib an support@linkflink.de.