{"openapi":"3.0.3","info":{"title":"EagleQR API","version":"1.0","description":"REST API of the EagleQR documentation platform. All routes live under the base path below.\n\nAuthentication: send an `Authorization: Bearer <token>` header. Two token types are accepted:\n1. JWT access tokens — obtain one via POST /auth/login (or POST /auth/refresh); they are short-lived.\n2. API keys — organization-scoped credentials for remote apps, created by an organization admin via\n   POST /organizations/:id/api-keys. Keys look like `eqr_<48 hex chars>`, are shown exactly once at\n   creation, and act as the creating user (per-organization rights are still enforced server-side).\n\nPagination: query params `page` and `limit` where supported; responses carry\n`{ items, page, limit, total, totalPages }`.\n\nErrors: `{ \"error\": \"<message>\" }` with a meaningful HTTP status (400 validation, 401 auth, 403 rights,\n404 not found, 409 conflict, 429 rate limited)."},"servers":[{"url":"https://api.eagleqr.com/api/v1"}],"tags":[{"name":"auth","description":"Authentication and account management"},{"name":"billing","description":"Licenses, Mollie billing and invoices"},{"name":"organizations","description":"Organization and member management"},{"name":"content","description":"QR codes, menus, menu items and media"},{"name":"analytics","description":"Monitoring and insights"},{"name":"api-keys","description":"API keys for remote apps (admin only)"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"JWT access token (from /auth/login or /auth/refresh) or an organization API key (eqr_...)."}}},"security":[{"bearerAuth":[]}],"paths":{"/auth/login":{"post":{"summary":"Log in with email + password; returns JWT + refresh token (or triggers email 2FA).","description":"Log in with email + password; returns JWT + refresh token (or triggers email 2FA). No authentication required.","responses":{"200":{"description":"JWT access token + refresh token, or requires_2fa: true"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"requestBody":{"description":"{ email, password }","required":true}}},"/auth/verify-2fa":{"post":{"summary":"Complete a 2FA login with the emailed code.","description":"Complete a 2FA login with the emailed code. No authentication required.","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"requestBody":{"description":"{ email, code }","required":true}}},"/auth/register":{"post":{"summary":"Register a new account (sends an email verification link). Records acceptance of the current terms (acceptTerms: true).","description":"Register a new account (sends an email verification link). Records acceptance of the current terms (acceptTerms: true). No authentication required.","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"requestBody":{"description":"{ email, password, name, enableTwoFactor, locale?, acceptTerms }","required":true}}},"/auth/terms":{"get":{"summary":"Terms of service status: current version vs. the version the user accepted. acceptanceRequired is true when the terms changed and the user must re-accept.","description":"Terms of service status: current version vs. the version the user accepted. acceptanceRequired is true when the terms changed and the user must re-accept. Authenticated user (JWT or API key) with no specific organization rights.","responses":{"200":{"description":"{ version, acceptedVersion, acceptedAt, acceptanceRequired }"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}}}},"/auth/accept-terms":{"post":{"summary":"Record acceptance of the current terms of service (re-acceptance after a terms update).","description":"Record acceptance of the current terms of service (re-acceptance after a terms update). Authenticated user (JWT or API key) with no specific organization rights.","responses":{"200":{"description":"{ message, termsAcceptedAt, termsVersion }"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}}}},"/auth/verify-email":{"post":{"summary":"Verify the account email using the token from the verification link.","description":"Verify the account email using the token from the verification link. No authentication required.","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"requestBody":{"description":"{ token }","required":true}}},"/auth/forgot-password":{"post":{"summary":"Request a password reset email.","description":"Request a password reset email. No authentication required.","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"requestBody":{"description":"{ email }","required":true}}},"/auth/reset-password":{"post":{"summary":"Set a new password using the reset token.","description":"Set a new password using the reset token. No authentication required.","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"requestBody":{"description":"{ token, password }","required":true}}},"/auth/refresh":{"post":{"summary":"Exchange a refresh token for a new access token.","description":"Exchange a refresh token for a new access token. No authentication required.","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"requestBody":{"description":"{ refreshToken }","required":true}}},"/auth/logout":{"post":{"summary":"Revoke a refresh token.","description":"Revoke a refresh token. No authentication required.","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"requestBody":{"description":"{ refreshToken }","required":true}}},"/licenses":{"get":{"summary":"List active self-service licenses (plans) with prices and limits.","description":"List active self-service licenses (plans) with prices and limits. Authenticated user (JWT or API key) with no specific organization rights.","responses":{"200":{"description":"array of { code, name: { en, nl, de }, priceCents, billingInterval, limits }"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}}}},"/organizations/:id/billing/checkout":{"post":{"summary":"Start a Mollie checkout to (up)grade the organization plan.","description":"Start a Mollie checkout to (up)grade the organization plan. Authenticated user with hasAdminRights on the organization.","responses":{"200":{"description":"{ checkoutUrl }"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"requestBody":{"description":"{ license, method? } — method: card | directdebit-sepa | ideal | bancontact","required":true}}},"/organizations/:id/billing":{"get":{"summary":"Current billing state of the organization.","description":"Current billing state of the organization. Authenticated user who is a member of the organization (any right).","responses":{"200":{"description":"{ license, subscription }"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}}},"delete":{"summary":"Cancel the subscription (revokes the mandate, reverts to the free plan).","description":"Cancel the subscription (revokes the mandate, reverts to the free plan). Authenticated user with hasAdminRights on the organization.","responses":{"204":{"description":"fresh billing state"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}}}},"/billing/webhooks/mollie":{"post":{"summary":"Mollie webhook (verified via Mollie-Webhook-Signature; not for client use).","description":"Mollie webhook (verified via Mollie-Webhook-Signature; not for client use). No authentication required.","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}}}},"/organizations/:id/invoices":{"get":{"summary":"List the organization's invoices, newest first.","description":"List the organization's invoices, newest first. Authenticated user who is a member of the organization (any right).","responses":{"200":{"description":"paginated { id, number, periodStart, periodEnd, licenseCode, amountCents, vatCents, currency, status, createdAt }"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}}]}},"/organizations/:id/invoices/:invoiceId/pdf":{"get":{"summary":"Download the invoice PDF (inline).","description":"Download the invoice PDF (inline). Authenticated user who is a member of the organization (any right).","responses":{"200":{"description":"application/pdf"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}}}},"/organizations/:id":{"get":{"summary":"Organization details, resolved license and usage counters.","description":"Organization details, resolved license and usage counters. Authenticated user who is a member of the organization (any right).","responses":{"200":{"description":"{ ..., license, usage: { members, qrCodes, media, storageBytes, viewsThisMonth } }"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}}},"put":{"summary":"Update organization details (re-authentication for sensitive fields).","description":"Update organization details (re-authentication for sensitive fields). Authenticated user with hasAdminRights on the organization.","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"requestBody":{"description":"{ name?, address?, country?, attentionOf?, taxNumber?, license?, lightColor?, darkColor? }","required":true}}},"/organizations/search":{"post":{"summary":"Search the organizations of the authenticated user by name.","description":"Search the organizations of the authenticated user by name. Authenticated user (JWT or API key) with no specific organization rights.","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"requestBody":{"description":"{ name } — empty name returns all","required":true}}},"/organizations":{"post":{"summary":"Create an organization (VIES-checked tax number required; free plan only).","description":"Create an organization (VIES-checked tax number required; free plan only). Authenticated user (JWT or API key) with no specific organization rights.","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"requestBody":{"description":"{ name, address, country, attentionOf, taxNumber, license }","required":true}}},"/organizations/:id/icon":{"post":{"summary":"Upload the organization icon (PNG/JPEG/WebP, max 2 MB; async ClamAV scan).","description":"Upload the organization icon (PNG/JPEG/WebP, max 2 MB; async ClamAV scan). Authenticated user with hasAdminRights on the organization.","responses":{"200":{"description":"202 { status: pending_scan }"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"requestBody":{"description":"form-data: file","required":true}},"get":{"summary":"Get the organization icon file (inline).","description":"Get the organization icon file (inline). Authenticated user who is a member of the organization (any right).","responses":{"200":{"description":"image/png | image/jpeg | image/webp"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}}},"delete":{"summary":"Remove the organization icon.","description":"Remove the organization icon. Authenticated user with hasAdminRights on the organization.","responses":{"204":{"description":"No Content"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}}}},"/organizations/:id/members":{"get":{"summary":"List members with their effective role and last-update tracking.","description":"List members with their effective role and last-update tracking. Authenticated user with hasAdminRights on the organization.","responses":{"200":{"description":"array of { userId, email, name, role, updatedBy, updatedByName, updatedByEmail, updatedAt }"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}}},"post":{"summary":"Add a verified user to the organization (sends a welcome email).","description":"Add a verified user to the organization (sends a welcome email). Authenticated user with hasAdminRights on the organization.","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"requestBody":{"description":"{ email, role } — role: hasUserRights | hasEditRights | hasAdminRights","required":true}}},"/organizations/:id/members/:userId":{"put":{"summary":"Change a member role.","description":"Change a member role. Authenticated user with hasAdminRights on the organization.","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"requestBody":{"description":"{ role? }","required":true}},"delete":{"summary":"Remove a member from the organization.","description":"Remove a member from the organization. Authenticated user with hasAdminRights on the organization.","responses":{"204":{"description":"No Content"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}}}},"/organizations/:id/export":{"get":{"summary":"Download a ZIP with the organization's complete data (details, license, usage, members, QR codes with menus and menu items, media metadata) and all stored media files (plus the app icon).","description":"Download a ZIP with the organization's complete data (details, license, usage, members, QR codes with menus and menu items, media metadata) and all stored media files (plus the app icon). Authenticated user with hasAdminRights on the organization.","responses":{"200":{"description":"application/zip attachment: export.json + files/<mediaId> (+ files/icon)"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}}}},"/users/me":{"get":{"summary":"The authenticated user's profile.","description":"The authenticated user's profile. Authenticated user (JWT or API key) with no specific organization rights.","responses":{"200":{"description":"{ email, name, locale, twoFactorEnabled }"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}}},"put":{"summary":"Update own profile (email change re-triggers verification).","description":"Update own profile (email change re-triggers verification). Authenticated user (JWT or API key) with no specific organization rights.","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"requestBody":{"description":"{ name?, locale?, email? }","required":true}}},"/users/change-password":{"post":{"summary":"Change password (requires current password; revokes all sessions).","description":"Change password (requires current password; revokes all sessions). Authenticated user (JWT or API key) with no specific organization rights.","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"requestBody":{"description":"{ currentPassword, newPassword }","required":true}}},"/users/two-factor":{"post":{"summary":"Enable/disable email 2FA (requires current password).","description":"Enable/disable email 2FA (requires current password). Authenticated user (JWT or API key) with no specific organization rights.","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"requestBody":{"description":"{ enabled, currentPassword }","required":true}}},"/organizations/:organizationId/qrcodes":{"get":{"summary":"List QR codes of the organization.","description":"List QR codes of the organization. Authenticated user who is a member of the organization (any right).","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"parameters":[{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"tag","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string"}},{"name":"dir","in":"query","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}}]},"post":{"summary":"Create a QR code (uuidv4 tag; license QR limit enforced).","description":"Create a QR code (uuidv4 tag; license QR limit enforced). Authenticated user with hasEditRights (or hasAdminRights) on the organization.","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"requestBody":{"description":"{ name, isPublic? }","required":true}}},"/organizations/:organizationId/qrcodes/:id":{"get":{"summary":"Get a single QR code.","description":"Get a single QR code. Authenticated user who is a member of the organization (any right).","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}}},"put":{"summary":"Update QR code fields (name, isPublic, ...).","description":"Update QR code fields (name, isPublic, ...). Authenticated user with hasEditRights (or hasAdminRights) on the organization.","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"requestBody":{"description":"partial QR fields","required":true}},"delete":{"summary":"Delete a QR code (cascades menus/items; media is kept).","description":"Delete a QR code (cascades menus/items; media is kept). Authenticated user with hasEditRights (or hasAdminRights) on the organization.","responses":{"204":{"description":"No Content"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}}}},"/organizations/:organizationId/qrcodes/by-tag/:tag":{"get":{"summary":"Get a QR code by its public tag.","description":"Get a QR code by its public tag. Authenticated user who is a member of the organization (any right).","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}}}},"/organizations/:organizationId/qrcodes/:qrCodeId/menus":{"get":{"summary":"List menus of a QR code (default menu first).","description":"List menus of a QR code (default menu first). Authenticated user who is a member of the organization (any right).","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"parameters":[{"name":"i18nTag","in":"query","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}}]},"post":{"summary":"Create a menu (first menu becomes the default).","description":"Create a menu (first menu becomes the default). Authenticated user with hasEditRights (or hasAdminRights) on the organization.","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"requestBody":{"description":"{ title, i18nTag }","required":true}}},"/organizations/:organizationId/qrcodes/:qrCodeId/menus/:menuId":{"put":{"summary":"Update menu title / set isDefault.","description":"Update menu title / set isDefault. Authenticated user with hasEditRights (or hasAdminRights) on the organization.","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"requestBody":{"description":"{ title?, isDefault? }","required":true}},"delete":{"summary":"Delete a menu (cascades to items).","description":"Delete a menu (cascades to items). Authenticated user with hasEditRights (or hasAdminRights) on the organization.","responses":{"204":{"description":"No Content"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}}}},"/organizations/:organizationId/qrcodes/:qrCodeId/menus/:menuId/items":{"get":{"summary":"List menu items (nesting via parentId).","description":"List menu items (nesting via parentId). Authenticated user who is a member of the organization (any right).","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"parameters":[{"name":"parentId","in":"query","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}}]},"post":{"summary":"Create a menu item (menu, file or url target).","description":"Create a menu item (menu, file or url target). Authenticated user with hasEditRights (or hasAdminRights) on the organization.","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"requestBody":{"description":"{ title, shortDescription, mediaId?, order?, parentId?, targetType?, targetRef? }","required":true}}},"/organizations/:organizationId/qrcodes/:qrCodeId/menus/:menuId/items/:itemId":{"put":{"summary":"Update a menu item.","description":"Update a menu item. Authenticated user with hasEditRights (or hasAdminRights) on the organization.","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"requestBody":{"description":"{ title?, shortDescription?, mediaId?, order?, parentId?, targetType?, targetRef? }","required":true}},"delete":{"summary":"Delete a menu item.","description":"Delete a menu item. Authenticated user with hasEditRights (or hasAdminRights) on the organization.","responses":{"204":{"description":"No Content"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}}}},"/organizations/:organizationId/media/upload":{"post":{"summary":"Upload a file (size/MIME limits, license storage limit, async ClamAV scan).","description":"Upload a file (size/MIME limits, license storage limit, async ClamAV scan). Authenticated user with hasEditRights (or hasAdminRights) on the organization.","responses":{"200":{"description":"202 with the media record"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"requestBody":{"description":"form-data: file, name?","required":true}}},"/organizations/:organizationId/media/:id/replace":{"post":{"summary":"Replace the stored file in place (re-scan; menu-item links are kept).","description":"Replace the stored file in place (re-scan; menu-item links are kept). Authenticated user with hasEditRights (or hasAdminRights) on the organization.","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"requestBody":{"description":"form-data: file, name?","required":true}}},"/organizations/:organizationId/media":{"get":{"summary":"List media of the organization.","description":"List media of the organization. Authenticated user who is a member of the organization (any right).","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"parameters":[{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}}]}},"/organizations/:organizationId/media/:id":{"get":{"summary":"Media metadata plus connected menu items (with menu and QR code).","description":"Media metadata plus connected menu items (with menu and QR code). Authenticated user who is a member of the organization (any right).","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}}},"put":{"summary":"Change the display name.","description":"Change the display name. Authenticated user with hasEditRights (or hasAdminRights) on the organization.","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"requestBody":{"description":"{ name? }","required":true}},"delete":{"summary":"Delete media and file (409 while referenced by menu items).","description":"Delete media and file (409 while referenced by menu items). Authenticated user with hasEditRights (or hasAdminRights) on the organization.","responses":{"204":{"description":"No Content"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}}}},"/organizations/:organizationId/media/:id/file":{"get":{"summary":"Stream the file inline (only once the scan status is clean).","description":"Stream the file inline (only once the scan status is clean). Authenticated user who is a member of the organization (any right).","responses":{"200":{"description":"stored MIME type, inline"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}}}},"/analytics/organizations/:organizationId":{"get":{"summary":"Aggregated analytics for the organization.","description":"Aggregated analytics for the organization. Authenticated user who is a member of the organization (any right).","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}}}},"/analytics/qrcodes/:qrCodeId":{"get":{"summary":"Detailed stats for a QR code (geo, devices, languages).","description":"Detailed stats for a QR code (geo, devices, languages). Authenticated user who is a member of the organization (any right).","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}}}},"/analytics/menu-items/:menuItemId":{"get":{"summary":"Stats for a menu item (views, engagement per language).","description":"Stats for a menu item (views, engagement per language). Authenticated user who is a member of the organization (any right).","responses":{"200":{"description":"Successful response"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}}}},"/api-keys/current":{"get":{"summary":"Identify the calling API key: name, prefix, and the organization it belongs to (keys are the org boundary — the MCP server uses this to resolve the org). JWT callers get 400.","description":"Identify the calling API key: name, prefix, and the organization it belongs to (keys are the org boundary — the MCP server uses this to resolve the org). JWT callers get 400. Authenticated user (JWT or API key) with no specific organization rights.","responses":{"200":{"description":"{ id, name, prefix, organizationId, organizationName, createdAt, lastUsedAt }"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}}}},"/organizations/:id/api-keys":{"get":{"summary":"List the active API keys of the organization (secrets are never returned).","description":"List the active API keys of the organization (secrets are never returned). Authenticated user with hasAdminRights on the organization.","responses":{"200":{"description":"{ items: [{ id, name, prefix, createdAt, lastUsedAt, createdByName, createdByEmail }] }"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}}},"post":{"summary":"Create an API key for a remote app. The full key is returned once, in this response only.","description":"Create an API key for a remote app. The full key is returned once, in this response only. Authenticated user with hasAdminRights on the organization.","responses":{"200":{"description":"201 { apiKey: { id, name, prefix, createdAt, lastUsedAt, createdByName, createdByEmail }, key }"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}},"requestBody":{"description":"{ name }","required":true}}},"/organizations/:id/api-keys/:keyId":{"delete":{"summary":"Revoke an API key (immediately unusable).","description":"Revoke an API key (immediately unusable). Authenticated user with hasAdminRights on the organization.","responses":{"204":{"description":"No Content"},"400":{"description":"Validation error (Zod issues in the error body)"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"Missing rights for this action"},"404":{"description":"Not found"}}}}}}