{
    "openapi": "3.1.0",
    "info": {
        "title": "Universal JSON Storage",
        "version": "2.1",
        "description": "Universeller JSON-Speicher mit echter REST-API (v1), pro Modul eigene Tabelle + History.\n\n**Auth:** `Authorization: Bearer <token>` oder HMAC (Header `X-UJS-Token`/`X-UJS-Timestamp`/`X-UJS-Signature`).\n\n**Optimistic Locking:** `If-Match: \"v<n>\"` mit der aktuellen Version im GET.\n\n**Dry-Run:** Header `X-UJS-Dry-Run: 1` simuliert schreibende Aktionen.\n\nSlug in der URL muss zum Modul des Tokens passen (sonst 403)."
    },
    "servers": [
        {
            "url": "https://www.pre.jsonstorage.de/api/v1"
        }
    ],
    "components": {
        "securitySchemes": {
            "Bearer": {
                "type": "http",
                "scheme": "bearer"
            },
            "HMAC": {
                "type": "apiKey",
                "in": "header",
                "name": "X-UJS-Token",
                "description": "Zus\u00e4tzlich X-UJS-Timestamp und X-UJS-Signature senden."
            }
        },
        "schemas": {
            "Response": {
                "type": "object",
                "properties": {
                    "success": {
                        "type": "boolean"
                    },
                    "request_id": {
                        "type": "string"
                    },
                    "entry": {
                        "type": "object",
                        "additionalProperties": true
                    },
                    "items": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        }
                    },
                    "total": {
                        "type": "integer"
                    },
                    "next_cursor": {
                        "type": "string",
                        "nullable": true
                    }
                }
            },
            "Error": {
                "type": "object",
                "required": [
                    "success",
                    "error",
                    "code"
                ],
                "properties": {
                    "success": {
                        "type": "boolean",
                        "enum": [
                            false
                        ]
                    },
                    "error": {
                        "type": "string"
                    },
                    "code": {
                        "type": "string",
                        "example": "auth.ip_blocked"
                    },
                    "request_id": {
                        "type": "string"
                    },
                    "details": {
                        "type": "array"
                    }
                }
            },
            "StoreBody": {
                "type": "object",
                "required": [
                    "type",
                    "customer_no",
                    "data"
                ],
                "properties": {
                    "type": {
                        "type": "string"
                    },
                    "customer_no": {
                        "type": "string"
                    },
                    "data": {
                        "type": "object",
                        "additionalProperties": true
                    },
                    "tags": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "UpdateBody": {
                "type": "object",
                "properties": {
                    "type": {
                        "type": "string"
                    },
                    "customer_no": {
                        "type": "string"
                    },
                    "data": {
                        "type": "object",
                        "additionalProperties": true
                    },
                    "tags": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "version": {
                        "type": "integer",
                        "description": "Alternative zu If-Match-Header"
                    }
                }
            },
            "Link": {
                "type": "object",
                "required": [
                    "rel",
                    "target_slug",
                    "target_id"
                ],
                "properties": {
                    "rel": {
                        "type": "string"
                    },
                    "target_slug": {
                        "type": "string"
                    },
                    "target_id": {
                        "type": "integer"
                    }
                }
            }
        }
    },
    "security": [
        {
            "Bearer": []
        },
        {
            "HMAC": []
        }
    ],
    "tags": [
        {
            "name": "Meta",
            "description": "Health, whoami, Aggregation"
        },
        {
            "name": "Entries",
            "description": "CRUD + History + Restore"
        },
        {
            "name": "Tags",
            "description": "Tag-Verwaltung"
        },
        {
            "name": "Links",
            "description": "Modul-\u00fcbergreifende Verkn\u00fcpfungen"
        },
        {
            "name": "Attachments",
            "description": "Dateianh\u00e4nge"
        },
        {
            "name": "Shares",
            "description": "\u00d6ffentliche Share-Links"
        },
        {
            "name": "Export",
            "description": "JSONL / CSV Dumps"
        },
        {
            "name": "DSGVO",
            "description": "Auskunft/L\u00f6schung pro customer_no"
        }
    ],
    "paths": {
        "/ping": {
            "get": {
                "tags": [
                    "Meta"
                ],
                "summary": "Health-Check (ohne Token)",
                "security": [],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/whoami": {
            "get": {
                "tags": [
                    "Meta"
                ],
                "summary": "Modul + Token-Info",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/modules/{slug}/entries": {
            "get": {
                "tags": [
                    "Entries"
                ],
                "summary": "Liste aller Eintr\u00e4ge",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Modul-Slug (muss zum Token passen)"
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "customer_no",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "external_id",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "tag",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "deleted",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "false",
                                "only",
                                "all"
                            ]
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "maximum": 1000,
                            "default": 50
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 0
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "X-Next-Cursor aus vorheriger Response"
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "asc",
                                "desc"
                            ],
                            "default": "desc"
                        }
                    },
                    {
                        "name": "X-Request-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ujs_debug",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "1 = Fehler-Details im Response"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK, Header X-Next-Cursor f\u00fcr Pagination",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "Entries"
                ],
                "summary": "Neuen Eintrag anlegen",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Modul-Slug (muss zum Token passen)"
                    },
                    {
                        "name": "X-UJS-Dry-Run",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        },
                        "description": "\"1\" = simuliert, schreibt nicht"
                    },
                    {
                        "name": "X-Request-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ujs_debug",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "1 = Fehler-Details im Response"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/StoreBody"
                            },
                            "example": {
                                "type": "note",
                                "customer_no": "K-1001",
                                "tags": [
                                    "wichtig"
                                ],
                                "data": {
                                    "titel": "Testnotiz",
                                    "prio": 1
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Fehler",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/modules/{slug}/entries/bulk": {
            "post": {
                "tags": [
                    "Entries"
                ],
                "summary": "Mehrere Eintr\u00e4ge auf einmal",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Modul-Slug (muss zum Token passen)"
                    },
                    {
                        "name": "X-Request-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ujs_debug",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "1 = Fehler-Details im Response"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "transactional": {
                                        "type": "boolean"
                                    },
                                    "items": {
                                        "type": "array",
                                        "items": {
                                            "$ref": "#/components/schemas/StoreBody"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "207": {
                        "description": "Multi-Status mit Ergebnis-Array",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/modules/{slug}/entries/query": {
            "post": {
                "tags": [
                    "Entries"
                ],
                "summary": "Komplexe Abfrage im Body",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Modul-Slug (muss zum Token passen)"
                    },
                    {
                        "name": "X-Request-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ujs_debug",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "1 = Fehler-Details im Response"
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object"
                            },
                            "example": {
                                "type": "note",
                                "limit": 20,
                                "q": {
                                    "data.prio": {
                                        "gte": 1
                                    },
                                    "data.titel": {
                                        "like": "%test%"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/modules/{slug}/entries/{id}": {
            "get": {
                "tags": [
                    "Entries"
                ],
                "summary": "Einen Eintrag lesen",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Modul-Slug (muss zum Token passen)"
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Eintrag-ID"
                    },
                    {
                        "name": "If-None-Match",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        },
                        "description": "ETag f\u00fcr 304 Not Modified"
                    },
                    {
                        "name": "X-Request-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ujs_debug",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "1 = Fehler-Details im Response"
                    },
                    {
                        "name": "include_deleted",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "enum": [
                                0,
                                1
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK mit ETag",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "304": {
                        "description": "Not Modified"
                    },
                    "404": {
                        "description": "Fehler",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "tags": [
                    "Entries"
                ],
                "summary": "Eintrag \u00e4ndern (ggf. If-Match)",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Modul-Slug (muss zum Token passen)"
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Eintrag-ID"
                    },
                    {
                        "name": "If-Match",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        },
                        "description": "z.B. \"v3\" f\u00fcr Optimistic Locking"
                    },
                    {
                        "name": "X-UJS-Dry-Run",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        },
                        "description": "\"1\" = simuliert, schreibt nicht"
                    },
                    {
                        "name": "X-Request-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ujs_debug",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "1 = Fehler-Details im Response"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateBody"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "Fehler",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Fehler",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "Entries"
                ],
                "summary": "Eintrag partiell \u00e4ndern (alias f\u00fcr PUT)",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Modul-Slug (muss zum Token passen)"
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Eintrag-ID"
                    },
                    {
                        "name": "If-Match",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        },
                        "description": "z.B. \"v3\" f\u00fcr Optimistic Locking"
                    },
                    {
                        "name": "X-Request-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ujs_debug",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "1 = Fehler-Details im Response"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateBody"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Entries"
                ],
                "summary": "Eintrag l\u00f6schen (hart oder soft)",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Modul-Slug (muss zum Token passen)"
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Eintrag-ID"
                    },
                    {
                        "name": "X-Request-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ujs_debug",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "1 = Fehler-Details im Response"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/modules/{slug}/entries/{id}/restore": {
            "post": {
                "tags": [
                    "Entries"
                ],
                "summary": "Soft-gel\u00f6schten wiederherstellen",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Modul-Slug (muss zum Token passen)"
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Eintrag-ID"
                    },
                    {
                        "name": "X-Request-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ujs_debug",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "1 = Fehler-Details im Response"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Fehler",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/modules/{slug}/entries/{id}/restore/{histId}": {
            "post": {
                "tags": [
                    "Entries"
                ],
                "summary": "Bestimmte History-Version wiederherstellen",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Modul-Slug (muss zum Token passen)"
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Eintrag-ID"
                    },
                    {
                        "name": "histId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "X-Request-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ujs_debug",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "1 = Fehler-Details im Response"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/modules/{slug}/entries/{id}/history": {
            "get": {
                "tags": [
                    "Entries"
                ],
                "summary": "Historie eines Eintrags",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Modul-Slug (muss zum Token passen)"
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Eintrag-ID"
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 100
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 0
                        }
                    },
                    {
                        "name": "X-Request-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ujs_debug",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "1 = Fehler-Details im Response"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/modules/{slug}/entries/by-external/{extId}": {
            "get": {
                "tags": [
                    "Entries"
                ],
                "summary": "Eintrag per external_id lesen",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Modul-Slug (muss zum Token passen)"
                    },
                    {
                        "name": "extId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "External ID"
                    },
                    {
                        "name": "X-Request-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ujs_debug",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "1 = Fehler-Details im Response"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Fehler",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "tags": [
                    "Entries"
                ],
                "summary": "Upsert per external_id",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Modul-Slug (muss zum Token passen)"
                    },
                    {
                        "name": "extId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "External ID"
                    },
                    {
                        "name": "X-Request-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ujs_debug",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "1 = Fehler-Details im Response"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/StoreBody"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/modules/{slug}/entries/{id}/tags": {
            "put": {
                "tags": [
                    "Tags"
                ],
                "summary": "Tags \u00fcberschreiben",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Modul-Slug (muss zum Token passen)"
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Eintrag-ID"
                    },
                    {
                        "name": "X-Request-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ujs_debug",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "1 = Fehler-Details im Response"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "tags": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/modules/{slug}/entries/{id}/links": {
            "get": {
                "tags": [
                    "Links"
                ],
                "summary": "Verkn\u00fcpfungen eines Eintrags",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Modul-Slug (muss zum Token passen)"
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Eintrag-ID"
                    },
                    {
                        "name": "X-Request-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ujs_debug",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "1 = Fehler-Details im Response"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "Links"
                ],
                "summary": "Verkn\u00fcpfung anlegen",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Modul-Slug (muss zum Token passen)"
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Eintrag-ID"
                    },
                    {
                        "name": "X-Request-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ujs_debug",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "1 = Fehler-Details im Response"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Link"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Links"
                ],
                "summary": "Verkn\u00fcpfung entfernen",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Modul-Slug (muss zum Token passen)"
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Eintrag-ID"
                    },
                    {
                        "name": "X-Request-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ujs_debug",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "1 = Fehler-Details im Response"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Link"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/modules/{slug}/entries/{id}/attachments": {
            "get": {
                "tags": [
                    "Attachments"
                ],
                "summary": "Attachments zum Eintrag",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Modul-Slug (muss zum Token passen)"
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Eintrag-ID"
                    },
                    {
                        "name": "X-Request-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ujs_debug",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "1 = Fehler-Details im Response"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "Attachments"
                ],
                "summary": "Datei hochladen (multipart)",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Modul-Slug (muss zum Token passen)"
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Eintrag-ID"
                    },
                    {
                        "name": "X-Request-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ujs_debug",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "1 = Fehler-Details im Response"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "file": {
                                        "type": "string",
                                        "format": "binary"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/modules/{slug}/attachments/{aid}": {
            "get": {
                "tags": [
                    "Attachments"
                ],
                "summary": "Attachment herunterladen",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Modul-Slug (muss zum Token passen)"
                    },
                    {
                        "name": "aid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Attachment-ID"
                    },
                    {
                        "name": "X-Request-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ujs_debug",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "1 = Fehler-Details im Response"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Bin\u00e4rdatei",
                        "content": {
                            "application/octet-stream": []
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Attachments"
                ],
                "summary": "Attachment l\u00f6schen",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Modul-Slug (muss zum Token passen)"
                    },
                    {
                        "name": "aid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Attachment-ID"
                    },
                    {
                        "name": "X-Request-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ujs_debug",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "1 = Fehler-Details im Response"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/modules/{slug}/entries/{id}/shares": {
            "get": {
                "tags": [
                    "Shares"
                ],
                "summary": "Shares zum Eintrag",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Modul-Slug (muss zum Token passen)"
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Eintrag-ID"
                    },
                    {
                        "name": "X-Request-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ujs_debug",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "1 = Fehler-Details im Response"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "Shares"
                ],
                "summary": "Share-Link erstellen",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Modul-Slug (muss zum Token passen)"
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Eintrag-ID"
                    },
                    {
                        "name": "X-Request-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ujs_debug",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "1 = Fehler-Details im Response"
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "expires_at": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "max_views": {
                                        "type": "integer",
                                        "nullable": true
                                    },
                                    "show_history": {
                                        "type": "boolean"
                                    },
                                    "allowed_ips": {
                                        "type": "string",
                                        "nullable": true
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/modules/{slug}/shares/{sid}": {
            "delete": {
                "tags": [
                    "Shares"
                ],
                "summary": "Share widerrufen",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Modul-Slug (muss zum Token passen)"
                    },
                    {
                        "name": "sid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        },
                        "description": "Share-ID"
                    },
                    {
                        "name": "X-Request-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ujs_debug",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "1 = Fehler-Details im Response"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/modules/{slug}/aggregate": {
            "get": {
                "tags": [
                    "Meta"
                ],
                "summary": "Aggregation",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Modul-Slug (muss zum Token passen)"
                    },
                    {
                        "name": "agg",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "count",
                                "sum",
                                "avg",
                                "min",
                                "max"
                            ]
                        }
                    },
                    {
                        "name": "field",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "group_by",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "X-Request-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ujs_debug",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "1 = Fehler-Details im Response"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/modules/{slug}/export.jsonl": {
            "get": {
                "tags": [
                    "Export"
                ],
                "summary": "JSONL-Dump (streaming)",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Modul-Slug (muss zum Token passen)"
                    },
                    {
                        "name": "X-Request-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ujs_debug",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "1 = Fehler-Details im Response"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "ndjson",
                        "content": {
                            "application/x-ndjson": []
                        }
                    }
                }
            }
        },
        "/modules/{slug}/export.csv": {
            "get": {
                "tags": [
                    "Export"
                ],
                "summary": "CSV-Dump (streaming)",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Modul-Slug (muss zum Token passen)"
                    },
                    {
                        "name": "X-Request-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ujs_debug",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "1 = Fehler-Details im Response"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "CSV",
                        "content": {
                            "text/csv": []
                        }
                    }
                }
            }
        },
        "/dsgvo/{customer_no}": {
            "get": {
                "tags": [
                    "DSGVO"
                ],
                "summary": "Export pro customer_no \u00fcber alle Module",
                "parameters": [
                    {
                        "name": "customer_no",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "X-Request-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ujs_debug",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "1 = Fehler-Details im Response"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "DSGVO"
                ],
                "summary": "L\u00f6schung pro customer_no",
                "parameters": [
                    {
                        "name": "customer_no",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "also_history",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "enum": [
                                0,
                                1
                            ]
                        }
                    },
                    {
                        "name": "X-Request-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ujs_debug",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "description": "1 = Fehler-Details im Response"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "x-ujs-modules": []
}