[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$f5rOUnl2qy4vjD3D4C-EZ9MLRdkszn5sfvmpMpiWwozw":3,"$fG91H0FDD3CAFuK-YOL8kl5neaXL1I49nQHChF_QgrjE":14},{"slug":4,"locale":5,"title":6,"section":7,"orderIndex":8,"blocks":9,"seoTitle":7,"seoDescription":7,"updatedAt":13},"130-public-api","de","130 — Public-API (für Tenant-Integratoren)",null,130,[10],{"type":11,"value":12},"markdown","# 130 — Public-API (für Tenant-Integratoren)\n\nPartnerDesk bietet eine REST-API, mit der Sie als Tenant Ihre Daten von externen Tools aus lesen und schreiben können — CRM, Reporting, Custom-Dashboards, Zapier\u002FMake.\n\n## Base-URL\n\n```\nhttps:\u002F\u002F\u003Ctenant-slug>.partnerdesk.io\u002Fapi\u002Fv1\n```\n\n## Authentifizierung\n\nJeder Request braucht einen **API-Key** im Header:\n\n```\nX-API-Key: pdk_abc12345_\u003Cyour-secret-here>\n```\n\n## API-Key erzeugen\n\nAdmin → **„Einstellungen\"** → **„Sicherheit & API\"** → **„API-Keys\"** → **„Neu erstellen\"**:\n\n1. **Name** eingeben (z. B. „CRM-Sync\").\n2. **Scopes** auswählen:\n   - `read` — Lesen aller Endpoints.\n   - `write` — Schreiben (POST\u002FPATCH) — siehe unten.\n3. Klick „Erstellen\".\n4. **Plain-Key wird einmalig angezeigt** — sofort kopieren! Nach Schließen des Dialogs nie wieder lesbar.\n\nSicherheits-Tipp: API-Key in Ihrer Anwendung als Env-Variable, **nicht im Code**.\n\n## Verfügbare Endpoints\n\n### Lesen (`read`-Scope)\n\n| Methode | Route | Funktion |\n|---------|-------|----------|\n| GET | `\u002Fme` | API-Key-Info (Name, Scopes, lastUsedAt) |\n| GET | `\u002Fpartners` | Liste mit Pagination + Filter |\n| GET | `\u002Fpartners\u002F{partnerId}` | Detail |\n| GET | `\u002Fcustomers` | Liste |\n| GET | `\u002Ftransactions` | Liste mit Date-\u002FStatus-Filter |\n\n### Schreiben (`write`-Scope erforderlich)\n\n| Methode | Route | Funktion |\n|---------|-------|----------|\n| POST | `\u002Fpartners` | Neuen Partner anlegen |\n| PATCH | `\u002Fpartners\u002F{partnerId}` | Stammdaten ändern |\n\nBei fehlendem Scope: HTTP 403.\n\n## Pagination\n\nZwei Modi:\n\n### Klassisch (`page` \u002F `limit`)\n\n```\nGET \u002Fapi\u002Fv1\u002Ftransactions?page=2&limit=50\n```\n\nResponse:\n```json\n{\n  \"data\": [...],\n  \"pagination\": { \"page\": 2, \"limit\": 50, \"total\": 312, \"pages\": 7 }\n}\n```\n\n### Cursor (besser für große Datenmengen)\n\n```\nGET \u002Fapi\u002Fv1\u002Ftransactions?cursor=\u003Cuuid-v7>&limit=100\n```\n\nResponse:\n```json\n{\n  \"data\": [...],\n  \"pagination\": { \"nextCursor\": \"\u003Cuuid-v7>\", \"limit\": 100 }\n}\n```\n\nCursor-Modus ist **stabil** bei parallelen Inserts — neue Datensätze verschieben die Pagination nicht.\n\n## Filter (Beispiele)\n\n```\nGET \u002Fapi\u002Fv1\u002Ftransactions?from=2026-05-01&to=2026-05-31&status=approved\nGET \u002Fapi\u002Fv1\u002Fpartners?status=active&groupKey=premium\nGET \u002Fapi\u002Fv1\u002Fcustomers?lifetime=true\n```\n\n## Rate-Limit\n\n**600 Requests\u002FMinute pro API-Key**. Bei Überschreitung: HTTP 429 mit `Retry-After`-Header.\n\n## Errors\n\nStrukturiertes JSON-Format:\n\n```json\n{\n  \"error\": {\n    \"code\": \"VALIDATION_ERROR\",\n    \"message\": \"Email is required\",\n    \"field\": \"email\"\n  }\n}\n```\n\nStatus-Codes:\n- `200`: OK.\n- `201`: Created.\n- `400`: Validation-Error (Body fehlerhaft).\n- `401`: Auth-Fehler (API-Key fehlt\u002Fungültig).\n- `403`: Forbidden (Scope reicht nicht).\n- `404`: Resource nicht gefunden.\n- `429`: Rate-Limit.\n- `500`: Server-Fehler.\n\n## Beispiel — Curl\n\n```bash\ncurl -H \"X-API-Key: pdk_abc12345_xyz789\" \\\n  \"https:\u002F\u002F4leads.partnerdesk.io\u002Fapi\u002Fv1\u002Fpartners?limit=10\"\n```\n\n## Beispiel — Python\n\n```python\nimport requests\n\nAPI_KEY = \"pdk_abc12345_xyz789\"\nBASE = \"https:\u002F\u002F4leads.partnerdesk.io\u002Fapi\u002Fv1\"\n\nresponse = requests.get(\n    f\"{BASE}\u002Fpartners\",\n    headers={\"X-API-Key\": API_KEY},\n    params={\"limit\": 50}\n)\ndata = response.json()\n```\n\n## Webhooks (umgekehrte Richtung)\n\nWenn Sie über Events benachrichtigt werden wollen, statt aktiv zu pollen: siehe **[131 — Outgoing-Webhooks](131-outgoing-webhooks.md)**.\n\n## Revoke\n\nFalls ein API-Key kompromittiert ist:\n\nAdmin → API-Keys → Eintrag → **„Widerrufen\"**. Alle Requests mit diesem Key liefern fortan HTTP 401.\n\n## OpenAPI-Spec\n\nEine vollständige OpenAPI-3.0-Beschreibung steht in der Entwicklungs-\u002FStaging-Umgebung unter `\u002Fapi\u002Fdoc.json` (Swagger-UI unter `\u002Fapi\u002Fdoc`). In Production aus Sicherheitsgründen abgeschaltet.\n\n## Verwandte Kapitel\n\n- **[131 — Outgoing-Webhooks](131-outgoing-webhooks.md)**\n- **[37 — Custom Webhook](37-custom-webhook.md)** (Inbound-Variante)\n- **[91 — Rate-Limiting](91-rate-limiting.md)**\n\n---\n\n**Technische Tiefen-Doku**: [`..\u002F136-public-api.md`](..\u002F136-public-api.md), [`..\u002F138-cursor-write-backoff.md`](..\u002F138-cursor-write-backoff.md), [`..\u002F031-openapi-swagger.md`](..\u002F031-openapi-swagger.md)\n","2026-06-01T21:39:08+02:00",{"data":15},[16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208,212,216,220,224,228,232,236,240,244,248,252,256,260,264,265,269],{"slug":17,"locale":5,"title":18,"section":7,"orderIndex":19},"01-ueberblick","01 — Kurzüberblick & Architektur",1,{"slug":21,"locale":5,"title":22,"section":7,"orderIndex":23},"02-schnellstart","02 — Schnellstart für neue Tenants",2,{"slug":25,"locale":5,"title":26,"section":7,"orderIndex":27},"03-rollen","03 — Rollen & Berechtigungen",3,{"slug":29,"locale":5,"title":30,"section":7,"orderIndex":31},"10-kampagnen","10 — Kampagnen verwalten",10,{"slug":33,"locale":5,"title":34,"section":7,"orderIndex":35},"11-provisionen","11 — Provisionsmodelle (Tiers & Gruppen)",11,{"slug":37,"locale":5,"title":38,"section":7,"orderIndex":39},"12-mlm","12 — MLM-Struktur & Downline",12,{"slug":41,"locale":5,"title":42,"section":7,"orderIndex":43},"13-bonus","13 — Bonusprogramme",13,{"slug":45,"locale":5,"title":46,"section":7,"orderIndex":47},"14-holdback-reserve","14 — Reifezeit & Reserve (Schutz vor Rückbuchungen)",14,{"slug":49,"locale":5,"title":50,"section":7,"orderIndex":51},"15-programm-bewertungen","15 — Programm-Bewertungen im Marktplatz",15,{"slug":53,"locale":5,"title":54,"section":7,"orderIndex":55},"16-externe-bewertungen","16 — Externe Bewertungen verbinden (Anbieter)",16,{"slug":57,"locale":5,"title":58,"section":7,"orderIndex":59},"17-joint-venture-partner","17 — Joint-Venture-Partner",17,{"slug":61,"locale":5,"title":62,"section":7,"orderIndex":63},"18-vertriebsmitarbeiter","18 — Vertriebsmitarbeiter (VM)",18,{"slug":65,"locale":5,"title":66,"section":7,"orderIndex":67},"19-profitabilitaet","19 — Profitabilität einer Kampagne",19,{"slug":69,"locale":5,"title":70,"section":7,"orderIndex":71},"20-partner-anlegen","20 — Partner anlegen",20,{"slug":73,"locale":5,"title":74,"section":7,"orderIndex":75},"21-partner-status","21 — Partner-Status & Lifecycle",21,{"slug":77,"locale":5,"title":78,"section":7,"orderIndex":79},"22-partner-profile","22 — Partner-Profile & Stammdaten",22,{"slug":81,"locale":5,"title":82,"section":7,"orderIndex":83},"23-customers","23 — Customers (Endkunden)",23,{"slug":85,"locale":5,"title":86,"section":7,"orderIndex":87},"24-partner-merge","24 — Doppelte Partner zusammenführen",24,{"slug":89,"locale":5,"title":90,"section":7,"orderIndex":91},"30-webhooks","30 — Webhook-Übersicht",30,{"slug":93,"locale":5,"title":94,"section":7,"orderIndex":95},"31-stripe","31 — Stripe-Integration",31,{"slug":97,"locale":5,"title":98,"section":7,"orderIndex":99},"32-digistore24","32 — Digistore24-Integration",32,{"slug":101,"locale":5,"title":102,"section":7,"orderIndex":103},"33-copecart","33 — CopeCart-Integration",33,{"slug":105,"locale":5,"title":106,"section":7,"orderIndex":107},"34-ablefy","34 — Ablefy-Integration (vormals elopage)",34,{"slug":109,"locale":5,"title":110,"section":7,"orderIndex":111},"35-easybill","35 — easybill-Integration",35,{"slug":113,"locale":5,"title":114,"section":7,"orderIndex":115},"36-lexoffice","36 — lexoffice-Integration",36,{"slug":117,"locale":5,"title":118,"section":7,"orderIndex":119},"37-custom-webhook","37 — Custom Webhook (Zapier, Make, n8n, eigene Systeme)",37,{"slug":121,"locale":5,"title":122,"section":7,"orderIndex":123},"40-auszahlungen","40 — Auszahlungs-Workflow",40,{"slug":125,"locale":5,"title":126,"section":7,"orderIndex":127},"41-gutschriften","41 — Gutschriften (§14 UStG)",41,{"slug":129,"locale":5,"title":130,"section":7,"orderIndex":131},"42-sepa","42 — SEPA-XML-Export",42,{"slug":133,"locale":5,"title":134,"section":7,"orderIndex":135},"43-stripe-connect","43 — Stripe Connect (Express-Auszahlungen)",43,{"slug":137,"locale":5,"title":138,"section":7,"orderIndex":139},"44-buchhaltung-sync","44 — Externe Buchhaltung-Sync (easybill \u002F lexoffice)",44,{"slug":141,"locale":5,"title":142,"section":7,"orderIndex":143},"50-tracking","50 — Tracking-Cookie & Klick-Erfassung",50,{"slug":145,"locale":5,"title":146,"section":7,"orderIndex":147},"51-attribution","51 — Attribution-Modelle",51,{"slug":149,"locale":5,"title":150,"section":7,"orderIndex":151},"52-utm-subid","52 — UTM, Sub-IDs & Fingerprint",52,{"slug":153,"locale":5,"title":154,"section":7,"orderIndex":155},"53-werbemittel","53 — Werbemittel: Banner & Coupons",53,{"slug":157,"locale":5,"title":158,"section":7,"orderIndex":159},"54-links-landingpages","54 — Short-Links & Landing-Pages",54,{"slug":161,"locale":5,"title":162,"section":7,"orderIndex":163},"60-marketing-site","60 — Marketing-Site (Apex-Domain)",60,{"slug":165,"locale":5,"title":166,"section":7,"orderIndex":167},"61-popup-widget","61 — Popup-Widget für Tenant-Sites",61,{"slug":169,"locale":5,"title":170,"section":7,"orderIndex":171},"62-cross-promotion","62 — PartnerDesk Cross-Promotion (PartnerDesk empfehlen)",62,{"slug":173,"locale":5,"title":174,"section":7,"orderIndex":175},"63-lead-aff","63 — Lead-Affiliate-Programm (Partner werben Partner)",63,{"slug":177,"locale":5,"title":178,"section":7,"orderIndex":179},"70-notifications","70 — Notification-System",70,{"slug":181,"locale":5,"title":182,"section":7,"orderIndex":183},"71-email-whitelabel","71 — Email-Whitelabel",71,{"slug":185,"locale":5,"title":186,"section":7,"orderIndex":187},"72-email-templates","72 — Email-Templates",72,{"slug":189,"locale":5,"title":190,"section":7,"orderIndex":191},"73-lifecycle-mails","73 — Lifecycle-Mails",73,{"slug":193,"locale":5,"title":194,"section":7,"orderIndex":195},"80-akademie","80 — Akademie: Kurse & Lektionen",80,{"slug":197,"locale":5,"title":198,"section":7,"orderIndex":199},"81-quiz","81 — Quiz-System",81,{"slug":201,"locale":5,"title":202,"section":7,"orderIndex":203},"82-zertifikate","82 — Zertifikate nach Kurs-Komplettierung",82,{"slug":205,"locale":5,"title":206,"section":7,"orderIndex":207},"90-2fa","90 — Two-Factor-Authentication (2FA)",90,{"slug":209,"locale":5,"title":210,"section":7,"orderIndex":211},"91-rate-limiting","91 — Rate-Limiting",91,{"slug":213,"locale":5,"title":214,"section":7,"orderIndex":215},"92-audit-log","92 — Audit-Log",92,{"slug":217,"locale":5,"title":218,"section":7,"orderIndex":219},"93-dsgvo","93 — DSGVO-Tools",93,{"slug":221,"locale":5,"title":222,"section":7,"orderIndex":223},"94-legal","94 — Legal-Pages",94,{"slug":225,"locale":5,"title":226,"section":7,"orderIndex":227},"95-cookie-consent","95 — Cookie-Consent",95,{"slug":229,"locale":5,"title":230,"section":7,"orderIndex":231},"100-billing-plaene","100 — Stripe-Billing-Pläne",100,{"slug":233,"locale":5,"title":234,"section":7,"orderIndex":235},"101-trial","101 — Trial & Subscription-Status",101,{"slug":237,"locale":5,"title":238,"section":7,"orderIndex":239},"102-customer-portal","102 — Stripe Customer-Portal",102,{"slug":241,"locale":5,"title":242,"section":7,"orderIndex":243},"110-superadmin","110 — Plattform-Admin (Superadmin)",110,{"slug":245,"locale":5,"title":246,"section":7,"orderIndex":247},"111-health","111 — Health-Endpoints",111,{"slug":249,"locale":5,"title":250,"section":7,"orderIndex":251},"112-webhook-event-log","112 — Webhook-Event-Log",112,{"slug":253,"locale":5,"title":254,"section":7,"orderIndex":255},"113-failed-messages","113 — Failed-Messages",113,{"slug":257,"locale":5,"title":258,"section":7,"orderIndex":259},"120-pwa-partner","120 — PWA Partner-Portal",120,{"slug":261,"locale":5,"title":262,"section":7,"orderIndex":263},"121-cross-tenant-hub","121 — Cross-Tenant-Hub",121,{"slug":4,"locale":5,"title":6,"section":7,"orderIndex":8},{"slug":266,"locale":5,"title":267,"section":7,"orderIndex":268},"131-outgoing-webhooks","131 — Outgoing-Webhooks",131,{"slug":270,"locale":5,"title":271,"section":7,"orderIndex":272},"132-exports","132 — Datenexporte (CSV, PDF-Report)",132]