Merge remote-tracking branch 'origin/main' into coolify
This commit is contained in:
364
developer-portal/app/api/dsfa/page.tsx
Normal file
364
developer-portal/app/api/dsfa/page.tsx
Normal file
@@ -0,0 +1,364 @@
|
||||
import { DevPortalLayout, ApiEndpoint, CodeBlock, ParameterTable, InfoBox } from '@/components/DevPortalLayout'
|
||||
|
||||
export default function DsfaApiPage() {
|
||||
return (
|
||||
<DevPortalLayout
|
||||
title="DSFA API"
|
||||
description="Datenschutz-Folgenabschätzung (Art. 35 DSGVO) verwalten"
|
||||
>
|
||||
<h2>Übersicht</h2>
|
||||
<p>
|
||||
Die DSFA API ermöglicht die vollständige Verwaltung von Datenschutz-Folgenabschätzungen
|
||||
gemäß Art. 35 DSGVO. Alle DSFAs werden backend-persistent gespeichert und mit
|
||||
vollständigem Audit-Trail protokolliert.
|
||||
</p>
|
||||
|
||||
<InfoBox type="warning" title="Wann ist eine DSFA Pflicht?">
|
||||
Eine DSFA ist zwingend erforderlich bei voraussichtlich hohem Risiko für Betroffene:
|
||||
automatisierte Entscheidungen / Profiling, umfangreiche Verarbeitung sensibler Daten,
|
||||
systematische Überwachung öffentlicher Bereiche oder KI-Hochrisiko-Systeme (EU AI Act).
|
||||
</InfoBox>
|
||||
|
||||
<InfoBox type="info" title="Tenant-ID">
|
||||
Alle Endpoints akzeptieren <code>tenant_id</code> als Query-Parameter.
|
||||
Ohne Angabe wird <code>default</code> als Tenant-ID verwendet.
|
||||
</InfoBox>
|
||||
|
||||
{/* ===================================================================== */}
|
||||
{/* Liste */}
|
||||
{/* ===================================================================== */}
|
||||
|
||||
<h2>GET /dsfa</h2>
|
||||
<p>Gibt eine gefilterte Liste aller DSFAs für einen Tenant zurück.</p>
|
||||
|
||||
<h4>Query-Parameter</h4>
|
||||
<ParameterTable
|
||||
parameters={[
|
||||
{ name: 'tenant_id', type: 'string', required: false, description: 'Tenant-ID (Default: "default")' },
|
||||
{ name: 'status', type: 'string', required: false, description: 'Filter: draft | in-review | approved | needs-update' },
|
||||
{ name: 'risk_level', type: 'string', required: false, description: 'Filter: low | medium | high | critical' },
|
||||
{ name: 'skip', type: 'integer', required: false, description: 'Offset für Pagination (Default: 0)' },
|
||||
{ name: 'limit', type: 'integer', required: false, description: 'Max. Einträge (Default: 100, Max: 500)' },
|
||||
]}
|
||||
/>
|
||||
|
||||
<CodeBlock language="bash" filename="cURL">
|
||||
{`curl -X GET "https://api.breakpilot.io/sdk/v1/dsfa?tenant_id=mein-tenant&status=in-review" \\
|
||||
-H "Authorization: Bearer YOUR_API_KEY"`}
|
||||
</CodeBlock>
|
||||
|
||||
<CodeBlock language="json" filename="Response (200)">
|
||||
{`[
|
||||
{
|
||||
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
||||
"tenant_id": "mein-tenant",
|
||||
"title": "DSFA - Bewerber-Management-System",
|
||||
"description": "KI-gestütztes Bewerber-Screening",
|
||||
"status": "in-review",
|
||||
"risk_level": "high",
|
||||
"processing_activity": "Automatisierte Bewertung von Bewerbungen",
|
||||
"data_categories": ["Kontaktdaten", "Beruflicher Werdegang"],
|
||||
"recipients": ["HR-Abteilung"],
|
||||
"measures": ["Verschlüsselung", "Menschliche Prüfung"],
|
||||
"approved_by": null,
|
||||
"approved_at": null,
|
||||
"created_by": "admin",
|
||||
"created_at": "2026-03-04T10:00:00",
|
||||
"updated_at": "2026-03-04T10:00:00"
|
||||
}
|
||||
]`}
|
||||
</CodeBlock>
|
||||
|
||||
{/* ===================================================================== */}
|
||||
{/* Erstellen */}
|
||||
{/* ===================================================================== */}
|
||||
|
||||
<h2>POST /dsfa</h2>
|
||||
<p>Erstellt eine neue DSFA. Gibt HTTP 201 mit dem erstellten Datensatz zurück.</p>
|
||||
|
||||
<CodeBlock language="bash" filename="cURL">
|
||||
{`curl -X POST "https://api.breakpilot.io/sdk/v1/dsfa?tenant_id=mein-tenant" \\
|
||||
-H "Authorization: Bearer YOUR_API_KEY" \\
|
||||
-H "Content-Type: application/json" \\
|
||||
-d '{
|
||||
"title": "DSFA - Video-Überwachung Büro",
|
||||
"description": "Videoüberwachung zu Sicherheitszwecken",
|
||||
"status": "draft",
|
||||
"risk_level": "medium",
|
||||
"processing_activity": "Videoüberwachung im Eingangsbereich",
|
||||
"data_categories": ["Bilddaten", "Bewegungsdaten"],
|
||||
"recipients": ["Sicherheitsdienst"],
|
||||
"measures": ["Löschfristen 72h", "Hinweisschilder", "Zugangsbeschränkung"],
|
||||
"created_by": "dsb@beispiel.de"
|
||||
}'`}
|
||||
</CodeBlock>
|
||||
|
||||
<CodeBlock language="json" filename="Response (201)">
|
||||
{`{
|
||||
"id": "7b3a1c9d-4e2f-4a8b-9c1d-5f6a7b8c9d0e",
|
||||
"tenant_id": "mein-tenant",
|
||||
"title": "DSFA - Video-Überwachung Büro",
|
||||
"status": "draft",
|
||||
"risk_level": "medium",
|
||||
"data_categories": ["Bilddaten", "Bewegungsdaten"],
|
||||
"measures": ["Löschfristen 72h", "Hinweisschilder", "Zugangsbeschränkung"],
|
||||
"created_at": "2026-03-04T12:00:00",
|
||||
"updated_at": "2026-03-04T12:00:00"
|
||||
}`}
|
||||
</CodeBlock>
|
||||
|
||||
<InfoBox type="info" title="Validierung">
|
||||
<code>status</code> muss einer der Werte <code>draft</code>, <code>in-review</code>,{' '}
|
||||
<code>approved</code>, <code>needs-update</code> sein.
|
||||
<code>risk_level</code> muss <code>low</code>, <code>medium</code>, <code>high</code>{' '}
|
||||
oder <code>critical</code> sein. Ungültige Werte → HTTP 422.
|
||||
</InfoBox>
|
||||
|
||||
{/* ===================================================================== */}
|
||||
{/* Einzeln abrufen */}
|
||||
{/* ===================================================================== */}
|
||||
|
||||
<h2>GET /dsfa/{'{id}'}</h2>
|
||||
<p>Gibt eine einzelne DSFA anhand ihrer UUID zurück.</p>
|
||||
|
||||
<CodeBlock language="bash" filename="cURL">
|
||||
{`curl -X GET "https://api.breakpilot.io/sdk/v1/dsfa/7b3a1c9d-4e2f-4a8b-9c1d-5f6a7b8c9d0e?tenant_id=mein-tenant" \\
|
||||
-H "Authorization: Bearer YOUR_API_KEY"`}
|
||||
</CodeBlock>
|
||||
|
||||
{/* ===================================================================== */}
|
||||
{/* Aktualisieren */}
|
||||
{/* ===================================================================== */}
|
||||
|
||||
<h2>PUT /dsfa/{'{id}'}</h2>
|
||||
<p>
|
||||
Aktualisiert eine DSFA. Alle Felder sind optional (Partial Update mit{' '}
|
||||
<code>exclude_none</code>). Nur gesetzte Felder werden überschrieben.
|
||||
</p>
|
||||
|
||||
<CodeBlock language="bash" filename="cURL">
|
||||
{`curl -X PUT "https://api.breakpilot.io/sdk/v1/dsfa/7b3a1c9d?tenant_id=mein-tenant" \\
|
||||
-H "Authorization: Bearer YOUR_API_KEY" \\
|
||||
-H "Content-Type: application/json" \\
|
||||
-d '{
|
||||
"measures": ["Löschfristen 72h", "Hinweisschilder", "Biometrischer Zugang"],
|
||||
"risk_level": "high"
|
||||
}'`}
|
||||
</CodeBlock>
|
||||
|
||||
{/* ===================================================================== */}
|
||||
{/* Status-Wechsel */}
|
||||
{/* ===================================================================== */}
|
||||
|
||||
<h2>PATCH /dsfa/{'{id}'}/status</h2>
|
||||
<p>
|
||||
Schnell-Statuswechsel ohne vollständiges Update. Bei Status{' '}
|
||||
<code>approved</code> wird <code>approved_at</code> automatisch gesetzt.
|
||||
</p>
|
||||
|
||||
<h4>Request Body</h4>
|
||||
<ParameterTable
|
||||
parameters={[
|
||||
{ name: 'status', type: 'string', required: true, description: 'Neuer Status: draft | in-review | approved | needs-update' },
|
||||
{ name: 'approved_by', type: 'string', required: false, description: 'Name/E-Mail des Genehmigers (empfohlen bei status=approved)' },
|
||||
]}
|
||||
/>
|
||||
|
||||
<CodeBlock language="bash" filename="cURL">
|
||||
{`curl -X PATCH "https://api.breakpilot.io/sdk/v1/dsfa/7b3a1c9d/status?tenant_id=mein-tenant" \\
|
||||
-H "Authorization: Bearer YOUR_API_KEY" \\
|
||||
-H "Content-Type: application/json" \\
|
||||
-d '{
|
||||
"status": "approved",
|
||||
"approved_by": "Max Mustermann (DSB)"
|
||||
}'`}
|
||||
</CodeBlock>
|
||||
|
||||
{/* ===================================================================== */}
|
||||
{/* Löschen */}
|
||||
{/* ===================================================================== */}
|
||||
|
||||
<h2>DELETE /dsfa/{'{id}'}</h2>
|
||||
<p>
|
||||
Löscht eine DSFA gemäß Art. 17 DSGVO. Die Löschung wird im Audit-Log protokolliert.
|
||||
</p>
|
||||
|
||||
<CodeBlock language="bash" filename="cURL">
|
||||
{`curl -X DELETE "https://api.breakpilot.io/sdk/v1/dsfa/7b3a1c9d?tenant_id=mein-tenant" \\
|
||||
-H "Authorization: Bearer YOUR_API_KEY"`}
|
||||
</CodeBlock>
|
||||
|
||||
<CodeBlock language="json" filename="Response (200)">
|
||||
{`{
|
||||
"success": true,
|
||||
"message": "DSFA 7b3a1c9d gelöscht"
|
||||
}`}
|
||||
</CodeBlock>
|
||||
|
||||
{/* ===================================================================== */}
|
||||
{/* Statistiken */}
|
||||
{/* ===================================================================== */}
|
||||
|
||||
<h2>GET /dsfa/stats</h2>
|
||||
<p>Gibt Zähler nach Status und Risiko-Level zurück.</p>
|
||||
|
||||
<CodeBlock language="bash" filename="cURL">
|
||||
{`curl -X GET "https://api.breakpilot.io/sdk/v1/dsfa/stats?tenant_id=mein-tenant" \\
|
||||
-H "Authorization: Bearer YOUR_API_KEY"`}
|
||||
</CodeBlock>
|
||||
|
||||
<CodeBlock language="json" filename="Response (200)">
|
||||
{`{
|
||||
"total": 5,
|
||||
"by_status": {
|
||||
"draft": 2,
|
||||
"in-review": 1,
|
||||
"approved": 2
|
||||
},
|
||||
"by_risk_level": {
|
||||
"low": 1,
|
||||
"medium": 2,
|
||||
"high": 2
|
||||
},
|
||||
"draft_count": 2,
|
||||
"in_review_count": 1,
|
||||
"approved_count": 2,
|
||||
"needs_update_count": 0
|
||||
}`}
|
||||
</CodeBlock>
|
||||
|
||||
{/* ===================================================================== */}
|
||||
{/* Audit-Log */}
|
||||
{/* ===================================================================== */}
|
||||
|
||||
<h2>GET /dsfa/audit-log</h2>
|
||||
<p>Gibt den vollständigen Audit-Trail aller DSFA-Aktionen zurück.</p>
|
||||
|
||||
<h4>Query-Parameter</h4>
|
||||
<ParameterTable
|
||||
parameters={[
|
||||
{ name: 'tenant_id', type: 'string', required: false, description: 'Tenant-ID' },
|
||||
{ name: 'limit', type: 'integer', required: false, description: 'Max. Einträge (Default: 50, Max: 500)' },
|
||||
{ name: 'offset', type: 'integer', required: false, description: 'Startposition' },
|
||||
]}
|
||||
/>
|
||||
|
||||
<CodeBlock language="json" filename="Response (200)">
|
||||
{`[
|
||||
{
|
||||
"id": "uuid",
|
||||
"tenant_id": "mein-tenant",
|
||||
"dsfa_id": "7b3a1c9d-...",
|
||||
"action": "STATUS_CHANGE",
|
||||
"changed_by": "system",
|
||||
"old_values": { "status": "in-review" },
|
||||
"new_values": { "status": "approved" },
|
||||
"created_at": "2026-03-04T12:30:00"
|
||||
}
|
||||
]`}
|
||||
</CodeBlock>
|
||||
|
||||
<InfoBox type="info" title="Audit-Aktionen">
|
||||
Folgende Aktionen werden protokolliert:{' '}
|
||||
<code>CREATE</code>, <code>UPDATE</code>, <code>DELETE</code>, <code>STATUS_CHANGE</code>.
|
||||
</InfoBox>
|
||||
|
||||
{/* ===================================================================== */}
|
||||
{/* Alle Endpoints */}
|
||||
{/* ===================================================================== */}
|
||||
|
||||
<h2>Alle Endpoints im Überblick</h2>
|
||||
|
||||
<ApiEndpoint method="GET" path="/dsfa" description="Liste aller DSFAs (Filter: status, risk_level)" />
|
||||
<ApiEndpoint method="POST" path="/dsfa" description="Neue DSFA anlegen → 201" />
|
||||
<ApiEndpoint method="GET" path="/dsfa/stats" description="Statistiken nach Status und Risiko" />
|
||||
<ApiEndpoint method="GET" path="/dsfa/audit-log" description="Audit-Trail aller Aktionen" />
|
||||
<ApiEndpoint method="GET" path="/dsfa/{id}" description="Einzelne DSFA abrufen" />
|
||||
<ApiEndpoint method="PUT" path="/dsfa/{id}" description="DSFA aktualisieren (inkl. ai_use_case_modules)" />
|
||||
<ApiEndpoint method="DELETE" path="/dsfa/{id}" description="DSFA löschen (Art. 17 DSGVO)" />
|
||||
<ApiEndpoint method="PATCH" path="/dsfa/{id}/status" description="Schnell-Statuswechsel" />
|
||||
|
||||
{/* Section 8: AI Use Case Modules */}
|
||||
<h2>Section 8: KI-Anwendungsfälle</h2>
|
||||
<p>
|
||||
Section 8 ist ein optionaler modularer Anhang zur DSFA für KI-spezifische Verarbeitungen.
|
||||
Die Module werden im Feld <code>ai_use_case_modules</code> (JSONB-Array) gespeichert
|
||||
und über den normalen <code>PUT /dsfa/{'{id}'}</code> Endpoint aktualisiert.
|
||||
</p>
|
||||
|
||||
<InfoBox type="info" title="KI-Modul-Typen">
|
||||
Unterstützte Typen: <code>chatbot_nlp</code>, <code>recommendation</code>,{' '}
|
||||
<code>adm_scoring</code>, <code>video_image</code>, <code>biometrics</code>,{' '}
|
||||
<code>iot_sensors</code>, <code>generative_ai</code>, <code>custom</code>
|
||||
</InfoBox>
|
||||
|
||||
<h3>KI-Modul hinzufügen</h3>
|
||||
<CodeBlock language="bash">{`# KI-Modul zu bestehender DSFA hinzufügen
|
||||
curl -sk -X PUT 'https://macmini:8002/api/v1/dsfa/{id}' \\
|
||||
-H 'Content-Type: application/json' \\
|
||||
-H 'X-Tenant-ID: default' \\
|
||||
-d '{
|
||||
"ai_use_case_modules": [
|
||||
{
|
||||
"id": "uuid-generated",
|
||||
"use_case_type": "generative_ai",
|
||||
"name": "GPT-Assistent Kundenservice",
|
||||
"model_description": "LLM-basierter Chatbot mit RAG für FAQ-Beantwortung",
|
||||
"model_type": "GPT-4o",
|
||||
"provider": "OpenAI",
|
||||
"third_country_transfer": true,
|
||||
"provider_country": "USA",
|
||||
"input_data_categories": ["Anfragetexte", "Kundennummer"],
|
||||
"output_data_categories": ["Antworttext"],
|
||||
"involves_special_categories": false,
|
||||
"data_subjects": ["Kunden"],
|
||||
"processing_purpose": "Automatisierte Beantwortung von Kundenanfragen",
|
||||
"legal_basis": "Art. 6 Abs. 1 lit. b DSGVO (Vertragserfüllung)",
|
||||
"art22_assessment": { "applies": false, "safeguards": [] },
|
||||
"risk_criteria": [
|
||||
{ "id": "adm_profiling", "applies": false, "severity": "high" }
|
||||
],
|
||||
"ai_act_risk_class": "limited",
|
||||
"ai_act_justification": "Chatbot mit Transparenzpflicht nach Art. 52 AI Act",
|
||||
"risks": [],
|
||||
"mitigations": [],
|
||||
"privacy_by_design_measures": [
|
||||
{ "category": "data_minimisation", "description": "Nur notwendige Daten", "implemented": true }
|
||||
],
|
||||
"review_triggers": [
|
||||
{ "type": "model_update", "description": "Bei Modell-Wechsel", "monitoring_interval": "monatlich" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}'`}</CodeBlock>
|
||||
|
||||
<h3>TypeScript-Typen</h3>
|
||||
<CodeBlock language="typescript">{`import type { AIUseCaseModule, AIUseCaseType, AIActRiskClass } from '@breakpilot/compliance-sdk'
|
||||
|
||||
// Modul erstellen
|
||||
const module: AIUseCaseModule = {
|
||||
id: crypto.randomUUID(),
|
||||
use_case_type: 'generative_ai',
|
||||
name: 'Mein KI-System',
|
||||
model_description: 'Beschreibung...',
|
||||
third_country_transfer: false,
|
||||
input_data_categories: ['Nutzertexte'],
|
||||
output_data_categories: ['Antwort'],
|
||||
involves_special_categories: false,
|
||||
data_subjects: ['Endnutzer'],
|
||||
processing_purpose: 'Kundensupport',
|
||||
legal_basis: 'Art. 6 Abs. 1 lit. b DSGVO',
|
||||
art22_assessment: { applies: false, safeguards: [] },
|
||||
risk_criteria: [],
|
||||
ai_act_risk_class: 'limited',
|
||||
wp248_criteria_met: ['K4', 'K8'],
|
||||
risks: [],
|
||||
mitigations: [],
|
||||
privacy_by_design_measures: [],
|
||||
review_triggers: [],
|
||||
created_at: new Date().toISOString(),
|
||||
updated_at: new Date().toISOString(),
|
||||
}`}</CodeBlock>
|
||||
</DevPortalLayout>
|
||||
)
|
||||
}
|
||||
371
developer-portal/app/api/einwilligungen/page.tsx
Normal file
371
developer-portal/app/api/einwilligungen/page.tsx
Normal file
@@ -0,0 +1,371 @@
|
||||
import { DevPortalLayout, ApiEndpoint, CodeBlock, ParameterTable, InfoBox } from '@/components/DevPortalLayout'
|
||||
|
||||
export default function EinwilligungenApiPage() {
|
||||
return (
|
||||
<DevPortalLayout
|
||||
title="Consent Management API"
|
||||
description="Einwilligungen, rechtliche Dokumente und Cookie-Banner verwalten"
|
||||
>
|
||||
<h2>Übersicht</h2>
|
||||
<p>
|
||||
Die Consent Management API ermöglicht die vollständige Verwaltung von Nutzereinwilligungen
|
||||
(Art. 6 Abs. 1a, Art. 7 DSGVO), rechtlichen Dokumenten (Art. 13/14 DSGVO) und
|
||||
Cookie-Banner-Konfigurationen (TTDSG § 25).
|
||||
</p>
|
||||
|
||||
<InfoBox type="info" title="Tenant-ID erforderlich">
|
||||
Alle Endpoints erfordern den Header <code>X-Tenant-ID</code> mit Ihrer Tenant-ID.
|
||||
Ohne diesen Header erhalten Sie einen 400-Fehler.
|
||||
</InfoBox>
|
||||
|
||||
{/* ===================================================================== */}
|
||||
{/* Consent Management */}
|
||||
{/* ===================================================================== */}
|
||||
|
||||
<h2>Consent Management</h2>
|
||||
<p>
|
||||
Verwalten Sie Einwilligungsnachweise granular nach Nutzer und Datenpunkt.
|
||||
Jede Einwilligung wird mit vollständiger Änderungshistorie protokolliert.
|
||||
</p>
|
||||
|
||||
<h3>GET /einwilligungen/consents</h3>
|
||||
<p>Gibt eine paginierte Liste aller Einwilligungen zurück.</p>
|
||||
|
||||
<h4>Query-Parameter</h4>
|
||||
<ParameterTable
|
||||
parameters={[
|
||||
{ name: 'limit', type: 'integer', required: false, description: 'Einträge pro Seite (Default: 50, Max: 500)' },
|
||||
{ name: 'offset', type: 'integer', required: false, description: 'Startposition für Pagination (Default: 0)' },
|
||||
{ name: 'user_id', type: 'string', required: false, description: 'Filtert nach Nutzer-ID' },
|
||||
{ name: 'data_point_id', type: 'string', required: false, description: 'Filtert nach Datenpunkt-ID' },
|
||||
{ name: 'granted', type: 'boolean', required: false, description: 'Filtert nach Einwilligungsstatus (true/false)' },
|
||||
]}
|
||||
/>
|
||||
|
||||
<CodeBlock language="bash" filename="cURL">
|
||||
{`curl -X GET "https://api.breakpilot.io/sdk/v1/einwilligungen/consents?limit=50&offset=0" \\
|
||||
-H "Authorization: Bearer YOUR_API_KEY" \\
|
||||
-H "X-Tenant-ID: your-tenant-id"`}
|
||||
</CodeBlock>
|
||||
|
||||
<CodeBlock language="json" filename="Response (200)">
|
||||
{`{
|
||||
"total": 1234,
|
||||
"offset": 0,
|
||||
"limit": 50,
|
||||
"consents": [
|
||||
{
|
||||
"id": "uuid",
|
||||
"tenant_id": "your-tenant-id",
|
||||
"user_id": "nutzer@beispiel.de",
|
||||
"data_point_id": "dp_analytics",
|
||||
"granted": true,
|
||||
"granted_at": "2024-01-15T10:30:00Z",
|
||||
"revoked_at": null,
|
||||
"consent_version": "v1.2",
|
||||
"source": "web_banner",
|
||||
"ip_address": "192.168.1.1",
|
||||
"user_agent": "Mozilla/5.0...",
|
||||
"created_at": "2024-01-15T10:30:00Z",
|
||||
"history": [
|
||||
{
|
||||
"id": "uuid",
|
||||
"action": "granted",
|
||||
"consent_version": "v1.2",
|
||||
"ip_address": "192.168.1.1",
|
||||
"user_agent": "Mozilla/5.0...",
|
||||
"source": "web_banner",
|
||||
"created_at": "2024-01-15T10:30:00Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}`}
|
||||
</CodeBlock>
|
||||
|
||||
<ApiEndpoint method="GET" path="/einwilligungen/consents" description="Consent-Liste mit Pagination und Filtern" />
|
||||
|
||||
<h3>POST /einwilligungen/consents</h3>
|
||||
<p>Erfasst eine neue Einwilligung. Erstellt automatisch einen History-Eintrag mit action="granted".</p>
|
||||
|
||||
<ParameterTable
|
||||
parameters={[
|
||||
{ name: 'user_id', type: 'string', required: true, description: 'Nutzer-ID oder E-Mail' },
|
||||
{ name: 'data_point_id', type: 'string', required: true, description: 'ID des Datenpunkts (z.B. dp_analytics)' },
|
||||
{ name: 'granted', type: 'boolean', required: true, description: 'true = Einwilligung erteilt' },
|
||||
{ name: 'consent_version', type: 'string', required: false, description: 'Version der Datenschutzerklärung (Default: 1.0)' },
|
||||
{ name: 'source', type: 'string', required: false, description: 'Quelle der Einwilligung (z.B. web_banner, api)' },
|
||||
{ name: 'ip_address', type: 'string', required: false, description: 'IP-Adresse des Nutzers (IPv4/IPv6)' },
|
||||
{ name: 'user_agent', type: 'string', required: false, description: 'Browser/Client User-Agent' },
|
||||
]}
|
||||
/>
|
||||
|
||||
<CodeBlock language="bash" filename="cURL">
|
||||
{`curl -X POST "https://api.breakpilot.io/sdk/v1/einwilligungen/consents" \\
|
||||
-H "Authorization: Bearer YOUR_API_KEY" \\
|
||||
-H "X-Tenant-ID: your-tenant-id" \\
|
||||
-H "Content-Type: application/json" \\
|
||||
-d '{
|
||||
"user_id": "nutzer@beispiel.de",
|
||||
"data_point_id": "dp_analytics",
|
||||
"granted": true,
|
||||
"consent_version": "v1.2",
|
||||
"source": "web_banner",
|
||||
"ip_address": "192.168.1.1"
|
||||
}'`}
|
||||
</CodeBlock>
|
||||
|
||||
<CodeBlock language="json" filename="Response (201)">
|
||||
{`{
|
||||
"success": true,
|
||||
"id": "uuid",
|
||||
"user_id": "nutzer@beispiel.de",
|
||||
"data_point_id": "dp_analytics",
|
||||
"granted": true,
|
||||
"granted_at": "2024-01-15T10:30:00Z"
|
||||
}`}
|
||||
</CodeBlock>
|
||||
|
||||
<ApiEndpoint method="POST" path="/einwilligungen/consents" description="Neue Einwilligung erfassen (erstellt automatisch History-Eintrag)" />
|
||||
|
||||
<h3>PUT /einwilligungen/consents/{'{id}'}/revoke</h3>
|
||||
<p>
|
||||
Widerruft eine aktive Einwilligung. Setzt <code>revoked_at</code> auf den aktuellen Zeitstempel
|
||||
und erstellt einen History-Eintrag mit action="revoked".
|
||||
</p>
|
||||
|
||||
<InfoBox type="warning" title="Nicht rückgängig machbar">
|
||||
Ein Widerruf kann nicht rückgängig gemacht werden. Für eine neue Einwilligung muss
|
||||
ein neuer POST-Request gesendet werden.
|
||||
</InfoBox>
|
||||
|
||||
<CodeBlock language="bash" filename="cURL">
|
||||
{`curl -X PUT "https://api.breakpilot.io/sdk/v1/einwilligungen/consents/CONSENT_ID/revoke" \\
|
||||
-H "Authorization: Bearer YOUR_API_KEY" \\
|
||||
-H "X-Tenant-ID: your-tenant-id"`}
|
||||
</CodeBlock>
|
||||
|
||||
<CodeBlock language="json" filename="Response (200)">
|
||||
{`{
|
||||
"success": true,
|
||||
"id": "uuid",
|
||||
"revoked_at": "2024-02-01T14:00:00Z"
|
||||
}`}
|
||||
</CodeBlock>
|
||||
|
||||
<ApiEndpoint method="PUT" path="/einwilligungen/consents/{id}/revoke" description="Einwilligung widerrufen (setzt revoked_at, erstellt History-Eintrag)" />
|
||||
|
||||
<h3>GET /einwilligungen/consents/{'{id}'}/history</h3>
|
||||
<p>
|
||||
Gibt die vollständige Änderungshistorie einer Einwilligung zurück.
|
||||
Alle Aktionen (granted, revoked, version_update, renewed) werden chronologisch aufgelistet.
|
||||
</p>
|
||||
|
||||
<CodeBlock language="bash" filename="cURL">
|
||||
{`curl -X GET "https://api.breakpilot.io/sdk/v1/einwilligungen/consents/CONSENT_ID/history" \\
|
||||
-H "Authorization: Bearer YOUR_API_KEY" \\
|
||||
-H "X-Tenant-ID: your-tenant-id"`}
|
||||
</CodeBlock>
|
||||
|
||||
<CodeBlock language="json" filename="Response (200)">
|
||||
{`[
|
||||
{
|
||||
"id": "uuid",
|
||||
"consent_id": "uuid",
|
||||
"action": "granted",
|
||||
"consent_version": "v1.0",
|
||||
"ip_address": "192.168.1.1",
|
||||
"user_agent": "Mozilla/5.0...",
|
||||
"source": "web_banner",
|
||||
"created_at": "2024-01-15T10:30:00Z"
|
||||
},
|
||||
{
|
||||
"id": "uuid",
|
||||
"consent_id": "uuid",
|
||||
"action": "revoked",
|
||||
"consent_version": "v1.0",
|
||||
"ip_address": null,
|
||||
"user_agent": null,
|
||||
"source": null,
|
||||
"created_at": "2024-02-01T14:00:00Z"
|
||||
}
|
||||
]`}
|
||||
</CodeBlock>
|
||||
|
||||
<ApiEndpoint method="GET" path="/einwilligungen/consents/{id}/history" description="Änderungshistorie einer Einwilligung (chronologisch, älteste zuerst)" />
|
||||
|
||||
<h3>GET /einwilligungen/consents/stats</h3>
|
||||
<p>Gibt Statistiken über alle Einwilligungen des Tenants zurück.</p>
|
||||
|
||||
<CodeBlock language="json" filename="Response (200)">
|
||||
{`{
|
||||
"total_consents": 1234,
|
||||
"active_consents": 1100,
|
||||
"revoked_consents": 134,
|
||||
"unique_users": 800,
|
||||
"conversion_rate": 89.2,
|
||||
"by_data_point": {
|
||||
"dp_analytics": { "total": 600, "active": 550, "revoked": 50 },
|
||||
"dp_marketing": { "total": 634, "active": 550, "revoked": 84 }
|
||||
}
|
||||
}`}
|
||||
</CodeBlock>
|
||||
|
||||
<ApiEndpoint method="GET" path="/einwilligungen/consents/stats" description="Einwilligungs-Statistiken nach Datenpunkt und Nutzer" />
|
||||
|
||||
{/* ===================================================================== */}
|
||||
{/* Legal Documents */}
|
||||
{/* ===================================================================== */}
|
||||
|
||||
<h2>Legal Documents API</h2>
|
||||
<p>
|
||||
Verwalten Sie rechtliche Dokumente (Datenschutzerklärung, AGB, Cookie-Richtlinie,
|
||||
Impressum, AVV) mit vollständigem Versionierungs- und Freigabe-Workflow.
|
||||
</p>
|
||||
|
||||
<InfoBox type="info" title="Proxy-Route">
|
||||
Frontend-Proxy: <code>/api/admin/consent/*</code> → <code>backend:8002/api/compliance/legal-documents/*</code>
|
||||
</InfoBox>
|
||||
|
||||
<h3>GET /legal-documents/documents</h3>
|
||||
<p>Gibt alle rechtlichen Dokumente des Tenants zurück.</p>
|
||||
|
||||
<CodeBlock language="bash" filename="cURL">
|
||||
{`curl -X GET "https://api.breakpilot.io/sdk/v1/legal-documents/documents" \\
|
||||
-H "Authorization: Bearer YOUR_API_KEY" \\
|
||||
-H "X-Tenant-ID: your-tenant-id"`}
|
||||
</CodeBlock>
|
||||
|
||||
<ApiEndpoint method="GET" path="/legal-documents/documents" description="Alle rechtlichen Dokumente (Filter: tenant_id, document_type, status)" />
|
||||
|
||||
<h3>POST /legal-documents/documents</h3>
|
||||
<p>Legt ein neues rechtliches Dokument an (initial als Entwurf).</p>
|
||||
|
||||
<ParameterTable
|
||||
parameters={[
|
||||
{ name: 'title', type: 'string', required: true, description: 'Titel des Dokuments' },
|
||||
{ name: 'document_type', type: 'string', required: true, description: 'privacy_policy | terms | cookie_policy | imprint | dpa' },
|
||||
{ name: 'language', type: 'string', required: false, description: 'Sprache (Default: de)' },
|
||||
]}
|
||||
/>
|
||||
|
||||
<ApiEndpoint method="POST" path="/legal-documents/documents" description="Neues rechtliches Dokument anlegen (Status: draft)" />
|
||||
|
||||
<h3>GET /legal-documents/documents/{'{id}'}/versions</h3>
|
||||
<p>
|
||||
Gibt alle Versionen eines Dokuments zurück.
|
||||
</p>
|
||||
|
||||
<InfoBox type="warning" title="Array-Response">
|
||||
Dieser Endpoint gibt ein <strong>direktes JSON-Array</strong> zurück, nicht
|
||||
ein Objekt mit <code>versions</code>-Key. Frontend-Code muss
|
||||
<code>Array.isArray(data) ? data : (data.versions || [])</code> prüfen.
|
||||
</InfoBox>
|
||||
|
||||
<CodeBlock language="json" filename="Response (200) — direktes Array">
|
||||
{`[
|
||||
{
|
||||
"id": "uuid",
|
||||
"document_id": "uuid",
|
||||
"version_number": 3,
|
||||
"title": "Datenschutzerklärung v3",
|
||||
"status": "published",
|
||||
"created_at": "2024-01-20T14:00:00Z",
|
||||
"published_at": "2024-01-21T09:00:00Z"
|
||||
}
|
||||
]`}
|
||||
</CodeBlock>
|
||||
|
||||
<ApiEndpoint method="GET" path="/legal-documents/documents/{id}/versions" description="Alle Versionen eines Dokuments (gibt direktes Array zurück)" />
|
||||
|
||||
<h3>POST /legal-documents/versions/{'{id}'}/publish</h3>
|
||||
<p>Veröffentlicht eine freigegebene Version. Status muss "approved" sein.</p>
|
||||
|
||||
<ApiEndpoint method="POST" path="/legal-documents/versions/{id}/publish" description="Freigegebene Version veröffentlichen (approved → published)" />
|
||||
|
||||
{/* ===================================================================== */}
|
||||
{/* Cookie Banner */}
|
||||
{/* ===================================================================== */}
|
||||
|
||||
<h2>Cookie Banner API</h2>
|
||||
<p>
|
||||
Konfigurieren Sie den Cookie-Banner für Ihre Anwendung. Die Konfiguration wird
|
||||
in der Datenbank persistiert und überlebt Container-Neustarts.
|
||||
</p>
|
||||
|
||||
<h3>GET /einwilligungen/cookies</h3>
|
||||
<p>Lädt die Cookie-Banner-Konfiguration des Tenants.</p>
|
||||
|
||||
<CodeBlock language="bash" filename="cURL">
|
||||
{`curl -X GET "https://api.breakpilot.io/sdk/v1/einwilligungen/cookies" \\
|
||||
-H "Authorization: Bearer YOUR_API_KEY" \\
|
||||
-H "X-Tenant-ID: your-tenant-id"`}
|
||||
</CodeBlock>
|
||||
|
||||
<CodeBlock language="json" filename="Response (200)">
|
||||
{`{
|
||||
"tenant_id": "your-tenant-id",
|
||||
"categories": [
|
||||
{
|
||||
"id": "necessary",
|
||||
"name": "Notwendig",
|
||||
"isRequired": true,
|
||||
"defaultEnabled": true
|
||||
},
|
||||
{
|
||||
"id": "analytics",
|
||||
"name": "Analyse",
|
||||
"isRequired": false,
|
||||
"defaultEnabled": false
|
||||
}
|
||||
],
|
||||
"config": {
|
||||
"position": "bottom",
|
||||
"style": "bar",
|
||||
"primaryColor": "#6366f1",
|
||||
"showDeclineAll": true,
|
||||
"showSettings": true,
|
||||
"banner_texts": {
|
||||
"title": "Wir verwenden Cookies",
|
||||
"description": "Wir nutzen Cookies, um unsere Website zu verbessern.",
|
||||
"privacyLink": "/datenschutz"
|
||||
}
|
||||
},
|
||||
"updated_at": "2024-01-15T10:30:00Z"
|
||||
}`}
|
||||
</CodeBlock>
|
||||
|
||||
<ApiEndpoint method="GET" path="/einwilligungen/cookies" description="Cookie-Banner-Konfiguration laden (Kategorien + Config + Banner-Texte)" />
|
||||
|
||||
<h3>PUT /einwilligungen/cookies</h3>
|
||||
<p>
|
||||
Speichert die Cookie-Banner-Konfiguration (Upsert). Alle Felder werden vollständig
|
||||
überschrieben.
|
||||
</p>
|
||||
|
||||
<CodeBlock language="bash" filename="cURL">
|
||||
{`curl -X PUT "https://api.breakpilot.io/sdk/v1/einwilligungen/cookies" \\
|
||||
-H "Authorization: Bearer YOUR_API_KEY" \\
|
||||
-H "X-Tenant-ID: your-tenant-id" \\
|
||||
-H "Content-Type: application/json" \\
|
||||
-d '{
|
||||
"categories": [
|
||||
{ "id": "necessary", "name": "Notwendig", "isRequired": true, "defaultEnabled": true }
|
||||
],
|
||||
"config": {
|
||||
"position": "bottom",
|
||||
"style": "bar",
|
||||
"primaryColor": "#6366f1",
|
||||
"banner_texts": {
|
||||
"title": "Wir verwenden Cookies",
|
||||
"description": "...",
|
||||
"privacyLink": "/datenschutz"
|
||||
}
|
||||
}
|
||||
}'`}
|
||||
</CodeBlock>
|
||||
|
||||
<ApiEndpoint method="PUT" path="/einwilligungen/cookies" description="Cookie-Banner-Konfiguration speichern (Upsert, inkl. Banner-Texte)" />
|
||||
</DevPortalLayout>
|
||||
)
|
||||
}
|
||||
@@ -126,6 +126,43 @@ export default function ApiReferencePage() {
|
||||
</Link>
|
||||
</p>
|
||||
|
||||
<h3>Consent Management</h3>
|
||||
<p>
|
||||
Verwalten Sie Einwilligungen, rechtliche Dokumente und Cookie-Banner-Konfigurationen.
|
||||
</p>
|
||||
|
||||
<ApiEndpoint method="GET" path="/einwilligungen/consents" description="Consent-Liste mit Pagination und Filtern" />
|
||||
<ApiEndpoint method="POST" path="/einwilligungen/consents" description="Neue Einwilligung erfassen" />
|
||||
<ApiEndpoint method="PUT" path="/einwilligungen/consents/{id}/revoke" description="Einwilligung widerrufen" />
|
||||
<ApiEndpoint method="GET" path="/einwilligungen/consents/{id}/history" description="Änderungshistorie einer Einwilligung" />
|
||||
|
||||
<p>
|
||||
<Link href="/api/einwilligungen" className="text-blue-600 hover:underline">
|
||||
→ Vollständige Consent Management API Dokumentation
|
||||
</Link>
|
||||
</p>
|
||||
|
||||
<h3>DSFA — Datenschutz-Folgenabschätzung</h3>
|
||||
<p>
|
||||
Verwalten Sie Datenschutz-Folgenabschätzungen gemäß Art. 35 DSGVO mit vollständigem
|
||||
Audit-Trail, Status-Workflow und Risikobewertung.
|
||||
</p>
|
||||
|
||||
<ApiEndpoint method="GET" path="/dsfa" description="Liste aller DSFAs (Filter: status, risk_level)" />
|
||||
<ApiEndpoint method="POST" path="/dsfa" description="Neue DSFA anlegen → 201" />
|
||||
<ApiEndpoint method="GET" path="/dsfa/stats" description="Statistiken nach Status und Risiko" />
|
||||
<ApiEndpoint method="GET" path="/dsfa/audit-log" description="Audit-Trail aller Aktionen" />
|
||||
<ApiEndpoint method="GET" path="/dsfa/{id}" description="Einzelne DSFA abrufen" />
|
||||
<ApiEndpoint method="PUT" path="/dsfa/{id}" description="DSFA aktualisieren" />
|
||||
<ApiEndpoint method="DELETE" path="/dsfa/{id}" description="DSFA löschen (Art. 17 DSGVO)" />
|
||||
<ApiEndpoint method="PATCH" path="/dsfa/{id}/status" description="Schnell-Statuswechsel" />
|
||||
|
||||
<p>
|
||||
<Link href="/api/dsfa" className="text-blue-600 hover:underline">
|
||||
→ Vollständige DSFA API Dokumentation
|
||||
</Link>
|
||||
</p>
|
||||
|
||||
<h2>Response Format</h2>
|
||||
<p>
|
||||
Alle Responses folgen einem einheitlichen Format:
|
||||
|
||||
Reference in New Issue
Block a user