{
  "openapi": "3.1.0",
  "info": {
    "title": "CodeB Sovereign Communications — Public API",
    "version": "2026-11-03",
    "summary": "REST + WebSocket + OpenID Connect + OpenID4VP + OpenID4VCI + LOTL + Federation + SIP-over-WebSocket surface, all multi-tenant by Host header. Aloaha-owned, built from scratch, hosted in Malta.",
    "description": "This spec covers every publicly reachable endpoint exposed by the CodeB Sovereign Communications platform: the OIDC provider + EU Wallet verifier (oidc.ashx), the OpenID4VCI issuer (vci.ashx), the LOTL trust-anchor cache (lotl.ashx), the RP-certificate CA (rp-cert.ashx), the chat + file-transfer platform (chat.ashx + chat-ws.ashx + chat-invite/widget/email .ashx), the property-management inbox (pms.ashx), the per-tenant admin surface (signal.ashx), the v1 REST outbound-AI + numbers + transcripts (api.ashx/v1), the bridge health passthroughs (/sip-tls/health, /sip-ws/health, /sfu/health), and remote signing for EU Digital Identity Wallets (CSC v2 profile /rqes/csc/v2, also answered at /csc/rqes/v2, on csc.ashx + its OAuth 2.0 server csc-oauth.ashx). Every endpoint is tenant-scoped by the Host header; there is no cross-tenant data access. Import this file into Postman, Insomnia, Swagger UI or any OpenAPI-3-compatible tool to explore the surface. Machine-generated clients welcome. Authentication: `oidc-bearer` = an OIDC access-token minted by /oauth2/v1/token; `hmac-admin` = X-CodeB-Admin-Signature header = hex(HMAC-SHA256(WebPhone:AdminSharedSecret, bucketName + '|' + Host)). Many admin endpoints accept EITHER bearer OR HMAC.\n\nAlso covered: passport/ID card reading through CodeB Wallet (`emrtd-relay.ashx`, including self-service guest accounts), signing requests by QR code with several signers and signature reports (`sign-request.ashx`), the wallet backend and provider endpoints, trust lists, the business wallet, account and tenant administration. Designed to follow the EUDI Wallet ARF and the CSC API v2; not certified.",
    "contact": {
      "name": "Aloaha Limited",
      "url": "https://www.aloaha.com/contact.html"
    },
    "license": {
      "name": "Proprietary — Aloaha Limited",
      "url": "https://www.aloaha.com/legal.html"
    },
    "termsOfService": "https://www.aloaha.com/legal.html"
  },
  "servers": [
    {
      "url": "https://phone.aloaha.com",
      "description": "Primary production tenant"
    },
    {
      "url": "https://phone.codeb.io",
      "description": "Development / conformance tenant"
    },
    {
      "url": "https://{tenant}",
      "description": "Any tenant domain — replace {tenant} with your provisioned host",
      "variables": {
        "tenant": {
          "default": "phone.aloaha.com"
        }
      }
    }
  ],
  "tags": [
    {
      "name": "csc-rqes",
      "description": "Remote signing for EU Digital Identity Wallets (Cloud Signature Consortium API v2.0.0.2 profile + its OAuth 2.0 authorization server). Advanced electronic signatures (AdES) with a per-user signing certificate. Base URI for wallets: https://<tenant>/rqes/csc/v2 (the same API is also answered at /csc/rqes/v2)."
    },
    {
      "name": "oidc-op",
      "description": "OpenID Connect Provider — authorize/token/userinfo/discovery/JWKS"
    },
    {
      "name": "oidc-federation",
      "description": "OpenID Federation 1.0 — entity statement, trust chain"
    },
    {
      "name": "eu-wallet-verifier",
      "description": "OpenID4VP 1.0 + HAIP 1.0 verifier — vp-start / vp-request / vp-response"
    },
    {
      "name": "eu-wallet-issuer",
      "description": "OpenID4VCI issuer — offer / token / credential / jwks / metadata"
    },
    {
      "name": "network-access",
      "description": "EUDI §5f Network-Access-via-PID — scope=network_access, signed WiFi/APN configs"
    },
    {
      "name": "lotl",
      "description": "EU List of Trusted Lists cache + anchor resolution"
    },
    {
      "name": "rp-cert",
      "description": "RP verifier certificate CA (WRPAC-lite)"
    },
    {
      "name": "sip-admin",
      "description": "Tenant admin — trunks, users, routes, ACL, whitelist"
    },
    {
      "name": "chat",
      "description": "Chat platform — DM, groups, file transfers, invitations"
    },
    {
      "name": "chat-widget",
      "description": "Anonymous 'Chat with us' visitor widget"
    },
    {
      "name": "chat-email",
      "description": "Email-to-chat channel (SMTP-in / IMAP)"
    },
    {
      "name": "pms",
      "description": "Property-Management inbox integration"
    },
    {
      "name": "v1-rest",
      "description": "v1 REST — outbound AI, numbers, transcripts, routes, webhooks"
    },
    {
      "name": "bridge-health",
      "description": "Read-only bridge health passthroughs"
    },
    {
      "name": "well-known",
      "description": "Standardised /.well-known/* aliases"
    },
    {
      "name": "signaling",
      "description": "Calls, presence and devices for the WebPhone (signal.ashx)."
    },
    {
      "name": "emrtd",
      "description": "Passport and ID card reading through CodeB Wallet. The server is the reading terminal (PACE/BAC, chip and active authentication, passive authentication against the CSCA master list and CRLs); the phone only forwards the chip commands. Designed to follow ICAO Doc 9303 and, for the evidence, ETSI TS 119 461 (extended level); not certified. CAN, MRZ and raw chip files are never stored."
    },
    {
      "name": "emrtd-self-service",
      "description": "A fresh CodeB Wallet opens its own document-checked guest account: genuine passport or ID card read on an attested phone, e-mail address confirmed with a mailed code, one account per document and per phone. No face comparison: a document-checked guest account, not a verified identity. PID and Photo ID are test credentials."
    },
    {
      "name": "sign-request",
      "description": "Signing requests by QR code for CodeB Wallet (sign-request.html): a signed-in user uploads PDFs, signs with the wallet and/or invites people by e-mail to sign one after another. The wallet side follows the OpenID4VP-based signing request of ETSI TS 119 432 and ARF 3.0 topic 16 (designed to follow; not certified)."
    },
    {
      "name": "csc-signing",
      "description": "Classic Cloud Signature Consortium API v2.0.0.2 surface at https://<tenant>/csc/v2 for web pages and integrators: per-user signing credential, SAD authorization (SCAL 1 or SCAL 2 with passkey), hash and whole-PDF signing (PAdES B-B to B-LTA), time-stamp proxy, the tenant's own RFC 3161 time-stamp authority and OCSP responder. Advanced electronic signatures with a software-backed key; designed to follow CSC v2 and ETSI PAdES baseline profiles; not certified and not a qualified signature service. Bearer = OIDC access token of the tenant."
    },
    {
      "name": "csc-rqes-admin",
      "description": "Superuser API behind the wallet remote-signing section of the secrets console: settings, creation and secret reveal / rotation of the tenant's wallet OAuth client."
    },
    {
      "name": "site-forms",
      "description": "Public website forms: spam-check challenge, self-service signup with e-mail activation, and the contact form. Passwords never leave the browser in clear; only a digest is sent."
    },
    {
      "name": "indexnow",
      "description": "IndexNow key hosting and URL submission so search engines learn about new or changed public pages of each tenant."
    },
    {
      "name": "tenant-admin",
      "description": "Tenant operations for administrators: GDPR documentation fields, the superuser secrets vault, and backup/restore of the tenant's file-based data to a WebDAV target."
    },
    {
      "name": "diagnostics",
      "description": "Client-side WebRTC diagnostic log collection; reading it back is admin-only."
    },
    {
      "name": "sip-provisioning",
      "description": "Single-use, short-lived softphone provisioning links, so SIP passwords do not have to be printed into QR codes."
    },
    {
      "name": "wallet-registration",
      "description": "Registration of the tenant as an EU Digital Identity Wallet relying party: public metadata and certificate views, and the admin flow that obtains registry-issued certificates. Designed to follow ARF 3.0; not certified."
    },
    {
      "name": "chat-whatsapp",
      "description": "WhatsApp Business channel bridge: provider webhook into the tenant's shared chat inbox, API-key send for back-office systems, and channel administration. Each tenant connects its own business account."
    },
    {
      "name": "wallet-backend",
      "description": "Web Wallet backend: wallet attestation, short-lived session tokens and the end-to-end encrypted vault backup (the server stores ciphertext only)."
    },
    {
      "name": "wallet-provider",
      "description": "Wallet Provider role of a tenant for the CodeB Web Wallet: signed provider metadata, Wallet Unit Attestations (WUA) and Wallet Instance Attestations (WIA). Designed to follow the wallet-attestation parts of OpenID4VC HAIP; not certified."
    },
    {
      "name": "did",
      "description": "DID resolver (did:key, did:jwk, did:web, did:webvh) and this tenant's did:web documents."
    },
    {
      "name": "vc-tools",
      "description": "W3C VCDM 2.0 issue and verify, short share links for SD-JWT VCs, and portrait images referenced by credentials."
    },
    {
      "name": "status-list",
      "description": "Credential status lists (W3C Bitstring Status List v1.0 and IETF Token Status List) for credentials issued by the tenant."
    },
    {
      "name": "trust",
      "description": "Trust material: the tenant's self-published Trusted List, tenant-to-tenant issuer trust, and the CSCA master list and CRLs the wallet uses for passport and ID card chip checks."
    },
    {
      "name": "business-wallet",
      "description": "Business wallet: company-held documents and credentials, employees and roles, relying parties and grants, share links, countersignatures and agent identities. Every call is scoped to one wallet with ?bw=<companyId> unless noted."
    },
    {
      "name": "sign-in",
      "description": "Browser sign-in and account recovery flows of the OIDC provider (password, passkey, TOTP second factor, magic link, onboarding claim, password reset)."
    },
    {
      "name": "data-protection",
      "description": "Data-subject and accountability endpoints: deletion requests, processing-record export, ISO/IEC TS 27560-shaped data agreements, consent receipts and per-subject access log."
    },
    {
      "name": "credential-catalog",
      "description": "Public catalogue of the credential types a tenant issues: attestation schema records, generated rulebooks, trust list JWT, SD-JWT VC issuer metadata."
    },
    {
      "name": "eu-wallet-issuer-admin",
      "description": "Tenant admin console of the OpenID4VCI issuer: offers, card templates, display settings, images, issuer settings."
    },
    {
      "name": "account",
      "description": "Self-service account of the signed-in user: profile, password, passkeys, TOTP."
    },
    {
      "name": "tenant-users",
      "description": "Tenant admin: user directory (create, delete, roles, profile, password, disable)."
    },
    {
      "name": "telephony-admin",
      "description": "Tenant admin: virtual numbers, outbound AI calls, trunk usage and fraud guard, aliases, tenant settings."
    },
    {
      "name": "recordings-transcripts",
      "description": "Call recordings and transcripts, labels and public share links."
    },
    {
      "name": "monitoring",
      "description": "Read-only health, statistics and log views for tenant admins."
    },
    {
      "name": "integrations-admin",
      "description": "Tenant admin: outgoing webhooks, personal API keys, OIDC client wallet-claim policies, chat channel configuration."
    },
    {
      "name": "media-admin",
      "description": "Tenant admin: conference media routing (SFU / mesh) and ICE policy."
    },
    {
      "name": "platform-operator",
      "description": "Operator (superuser) endpoints: tenant onboarding, tenant list, certificates, web server logs."
    },
    {
      "name": "smartcard-rollout",
      "description": "Smart cards on phones: hand-over of a Windows certificate and its key (wrapped for the phone's attested hardware key) from the CodeB Key Storage Provider to CodeB Wallet, which then answers as a GIDS smart card. Test use; not certified."
    },
    {
      "name": "pki-cards",
      "description": "PKI cards on phones (read/write and read-only PKI card): the administrator issues an empty card to a member's CodeB Wallet; at a Windows PC with an NFC reader the phone then works as a smart card for certificates and Windows sign-in. The sign-in certificate comes from the organisation's own Windows CA. Guide: /pki-card-windows-ca.html. Tested in closed groups."
    },
    {
      "name": "wrpac-ca",
      "description": "Access-certificate CA for wallet-relying parties (modelled on ETSI TS 119 411-8; not assessed). Test and private use: software CA key (not in an HSM yet), this site's own relying-party register (not a national register), own policy OID instead of the ETSI one."
    },
    {
      "name": "ai-agents",
      "description": "AI apps and agents act for a person after the person allows them, and prepare signing requests over MCP. Apps connect with the MCP sign-in (paste https://<host>/mcp, sign in, allow; OAuth 2.1 + PKCE, Client ID Metadata Documents, RFC 7591); agents without a screen use OpenID CIBA Core 1.0 (poll mode). Nobody but the person signs: signatures are made in CodeB Wallet. Guide: /ai-agents.html."
    },
    {
      "name": "camara-identity",
      "description": "CAMARA-compatible Number Verification and KYC Match answered from an EUDI wallet sign-in (PID) instead of the mobile network: identifies the person, not only the SIM. Guide: https://www.aloaha.com/camara-wallet-api.html"
    },
    {
      "name": "verify-caller",
      "description": "'Who am I speaking to?' - a 6-digit code read out on any call, confirmed by the caller with an EUDI wallet. Page: https://www.aloaha.com/verify-caller.html"
    },
    {
      "name": "call-screening",
      "description": "Verified name on the incoming-call screen (CodeB Wallet for Android): signed, key-bound caller statement, encrypted announcement in a 16-bit bucket; the server never sees a phone number."
    }
  ],
  "components": {
    "securitySchemes": {
      "cscServiceToken": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "opaque",
        "description": "CSC v2 service access token (scope=service) from POST /csc/rqes/oauth2/token. Valid 1 hour. Lists and describes the signed-in user's signing credential."
      },
      "cscCredentialToken": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "opaque",
        "description": "CSC v2 credential access token (scope=credential) from POST /csc/rqes/oauth2/token. Bound to one credentialID and to exactly the document hashes the user confirmed; valid 5 minutes and for numSignatures signatures in total. Replaces the SAD on signatures/signHash."
      },
      "cscClientBasic": {
        "type": "http",
        "scheme": "basic",
        "description": "OAuth client authentication (client_secret_basic). client_secret_post (client_id + client_secret form fields) is accepted as well. Clients are registered per tenant by the operator."
      },
      "oidcBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "OIDC access token minted by /oauth2/v1/token. Tenant-scoped by Host header. Also accepts ak_-prefixed personal API keys on the v1 REST surface."
      },
      "hmacAdmin": {
        "type": "apiKey",
        "in": "header",
        "name": "X-CodeB-Admin-Signature",
        "description": "Hex(HMAC-SHA256(WebPhone:AdminSharedSecret, bucketName + '|' + Host)). Bucket name is documented per-endpoint. This scheme is designed for machine-to-machine admin automation (CI, cron, back-office scripts) where OIDC bearer flow isn't practical."
      },
      "credentialAccessToken": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "opaque",
        "description": "OAuth 2.0 access token minted by /vci.ashx?token via pre-authorized_code grant. Used only on POST /vci.ashx?credential."
      },
      "cscUserBasic": {
        "type": "http",
        "scheme": "basic",
        "description": "HTTP Basic with the username and password of a tenant account. Only on POST /csc/v2/signatures/signDocBasic, and only when the operator enabled it for the tenant."
      },
      "whatsappApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-CodeB-WhatsApp-API-Key",
        "description": "Channel API key (wa_live_...) minted by a tenant admin via /whatsapp.ashx?action=apikey-add. Shown once; may be bound to a single message template. Used only on send-external and templates-list-external."
      },
      "walletSessionToken": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Short-lived (600 s) HS256 token from POST /wallet-session-token.ashx (iss=codeb-wallet-session, aud=wallet-backup). Accepted by /wallet-backup.ashx and /wallet-attestation.ashx in place of an OIDC access token."
      },
      "chatWidgetSession": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "opaque",
        "description": "Visitor session id returned by /chat-widget.ashx?op=start-session. Sent as Authorization: Bearer <sessionId>, or carried by the HttpOnly cookie codeb-widget-session that start-session sets."
      },
      "externalInjectSecret": {
        "type": "apiKey",
        "in": "header",
        "name": "X-CodeB-External-Inject-Secret",
        "description": "Per-tenant shared secret for server-to-server message injection into chat (configured with /chat.ashx?op=external-inject-config-set). Compared in constant time."
      },
      "camaraBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Access token of this tenant's OIDC provider from an EUDI wallet sign-in (acr urn:codeb:acr:eudi-wallet, at most 15 minutes old) carrying the CAMARA scope; any registered client unless the site admin limited or switched off the API. API keys are not accepted."
      }
    },
    "parameters": {
      "host": {
        "name": "Host",
        "in": "header",
        "required": false,
        "description": "Tenant selector. Every endpoint is tenant-scoped by the Host header. Missing/unknown Host falls back to primary tenant per per-domain WebPhoneSettings resolution.",
        "schema": {
          "type": "string",
          "example": "phone.aloaha.com"
        }
      }
    },
    "schemas": {
      "CscRqesError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "examples": [
              "invalid_request",
              "invalid_grant",
              "invalid_client",
              "invalid_token"
            ]
          },
          "error_description": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ]
      },
      "CscRqesInfo": {
        "type": "object",
        "description": "CSC section 11.1 service metadata for the EU-wallet profile. specs is 2.2.0.0, the version the EU RQES libraries require.",
        "properties": {
          "specs": {
            "type": "string",
            "const": "2.2.0.0"
          },
          "name": {
            "type": "string"
          },
          "logo": {
            "type": "string",
            "format": "uri"
          },
          "region": {
            "type": "string"
          },
          "lang": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "authType": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "oauth2code"
              ]
            }
          },
          "oauth2": {
            "type": "string",
            "format": "uri",
            "description": "OAuth 2.0 base URI: https://<tenant>/csc/rqes. Endpoints: {oauth2}/oauth2/authorize, {oauth2}/oauth2/token, {oauth2}/oauth2/pushed_authorize, {oauth2}/revoke."
          },
          "supportsRar": {
            "type": "boolean"
          },
          "supportedHashTypes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "2.16.840.1.101.3.4.2.1"
              ]
            }
          },
          "asynchronousOperationMode": {
            "type": "boolean"
          },
          "validationInfo": {
            "type": "boolean"
          },
          "methods": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "credentials/list",
                "credentials/info",
                "signatures/signHash"
              ]
            ]
          },
          "signAlgorithms": {
            "type": "object",
            "properties": {
              "algos": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "signature_formats": {
            "type": "object",
            "properties": {
              "formats": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "envelope_properties": {
                "type": "array",
                "items": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "conformance_levels": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "self_service": {
            "type": "object",
            "description": "Self-service guest accounts from CodeB Wallet (passport/ID card + e-mail code): whether they are on and the guest signing limit per day",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "guest_signatures_per_day": {
                "type": "integer"
              }
            }
          }
        }
      },
      "CscRqesCredentialInfo": {
        "type": "object",
        "properties": {
          "credentialID": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "signatureQualifier": {
            "type": "string",
            "const": "eu_eidas_aes"
          },
          "key": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "enabled",
                  "disabled"
                ]
              },
              "algo": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "len": {
                "type": "integer"
              },
              "curve": {
                "type": "string"
              }
            }
          },
          "cert": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "valid",
                  "expired",
                  "revoked",
                  "suspended"
                ]
              },
              "certificates": {
                "type": "array",
                "items": {
                  "type": "string",
                  "contentEncoding": "base64"
                }
              },
              "issuerDN": {
                "type": "string"
              },
              "serialNumber": {
                "type": "string"
              },
              "subjectDN": {
                "type": "string"
              },
              "validFrom": {
                "type": "string",
                "examples": [
                  "20261013120000Z"
                ]
              },
              "validTo": {
                "type": "string"
              }
            }
          },
          "auth": {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "const": "oauth2code"
              },
              "objects": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            }
          },
          "SCAL": {
            "type": "string",
            "const": "2"
          },
          "multisign": {
            "type": "integer",
            "examples": [
              10
            ]
          },
          "lang": {
            "type": "string"
          }
        }
      },
      "CscRqesTokenResponse": {
        "type": "object",
        "properties": {
          "access_token": {
            "type": "string"
          },
          "token_type": {
            "type": "string",
            "const": "Bearer"
          },
          "expires_in": {
            "type": "integer",
            "examples": [
              3600,
              300
            ]
          },
          "scope": {
            "type": "string",
            "enum": [
              "service",
              "credential"
            ]
          },
          "credentialID": {
            "type": "string",
            "description": "Present for scope=credential."
          }
        },
        "required": [
          "access_token",
          "token_type",
          "expires_in"
        ]
      },
      "OidcDiscovery": {
        "type": "object",
        "required": [
          "issuer",
          "authorization_endpoint",
          "token_endpoint",
          "userinfo_endpoint",
          "jwks_uri",
          "response_types_supported",
          "subject_types_supported",
          "id_token_signing_alg_values_supported"
        ],
        "properties": {
          "issuer": {
            "type": "string",
            "format": "uri"
          },
          "authorization_endpoint": {
            "type": "string",
            "format": "uri"
          },
          "token_endpoint": {
            "type": "string",
            "format": "uri"
          },
          "userinfo_endpoint": {
            "type": "string",
            "format": "uri"
          },
          "jwks_uri": {
            "type": "string",
            "format": "uri"
          },
          "end_session_endpoint": {
            "type": "string",
            "format": "uri"
          },
          "revocation_endpoint": {
            "type": "string",
            "format": "uri"
          },
          "introspection_endpoint": {
            "type": "string",
            "format": "uri"
          },
          "request_parameter_supported": {
            "type": "boolean"
          },
          "request_object_signing_alg_values_supported": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "code_challenge_methods_supported": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "plain",
                "S256"
              ]
            }
          },
          "scopes_supported": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "openid, profile, email, offline_access, network_access, ..."
          },
          "grant_types_supported": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Jwks": {
        "type": "object",
        "required": [
          "keys"
        ],
        "properties": {
          "keys": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "EntityStatementJwt": {
        "type": "string",
        "description": "Signed ES256 JWT per OpenID Federation 1.0 §3.1. Content-Type: application/entity-statement+jwt. Cacheable public, max-age=3600 (matches exp)."
      },
      "VpStartResponse": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string"
          },
          "request_uri": {
            "type": "string",
            "format": "uri"
          },
          "openid4vp_url": {
            "type": "string",
            "description": "openid4vp://... deep link for the wallet"
          },
          "expires_in": {
            "type": "integer"
          }
        }
      },
      "VpResponseResult": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "completed",
              "verified",
              "error"
            ]
          },
          "session_id": {
            "type": "string"
          },
          "presentation": {
            "type": "object"
          },
          "network_config": {
            "$ref": "#/components/schemas/NetworkConfig",
            "description": "Present only when scope=network_access was requested at vp-start."
          },
          "sso_assertion": {
            "type": "string",
            "description": "Opaque token that a downstream RP can redeem via OIDC code exchange."
          }
        }
      },
      "NetworkConfig": {
        "type": "object",
        "description": "Signed WiFi / APN / VPN configuration issued to a wallet after successful PID presentation with scope=network_access. Signature is a compact JWS (ES256, x5c chain) — wallet verifies against the tenant verifier cert, then provisions the network profile on the device.",
        "required": [
          "profile_id",
          "network_type",
          "expires_at",
          "signature"
        ],
        "properties": {
          "profile_id": {
            "type": "string",
            "description": "Tenant-configured profile name (e.g. 'guest-wifi-hotel', 'corporate-vpn')."
          },
          "network_type": {
            "type": "string",
            "enum": [
              "wifi-wpa2-eap",
              "wifi-wpa3-eap",
              "wifi-wpa2-psk",
              "wifi-hotspot20",
              "apn-4g",
              "apn-5g",
              "openvpn",
              "wireguard"
            ]
          },
          "ssid": {
            "type": "string",
            "description": "WiFi SSID (when network_type is wifi-*)"
          },
          "eap_method": {
            "type": "string",
            "description": "PEAP / TTLS / TLS / MSCHAPv2 (WPA2/3-EAP profiles)"
          },
          "identity": {
            "type": "string",
            "description": "Derived from PID claims per tenant policy (e.g. given_name.family_name@tenant.example)"
          },
          "password_or_psk": {
            "type": "string",
            "description": "Ephemeral per-session credential; not present for cert-based EAP-TLS."
          },
          "ca_certificate_pem": {
            "type": "string",
            "description": "Radius CA the wallet should trust for the corporate WPA2-EAP server."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "Absolute expiry — wallet MUST discard the profile after this timestamp."
          },
          "signature": {
            "type": "string",
            "description": "Compact JWS (ES256, x5c chain to tenant verifier cert) over the canonicalised config body."
          }
        }
      },
      "LotlManifest": {
        "type": "object",
        "properties": {
          "as_of": {
            "type": "string",
            "format": "date-time"
          },
          "next_refresh_at": {
            "type": "string",
            "format": "date-time"
          },
          "anchor_count": {
            "type": "integer"
          },
          "countries_covered": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "ISO 3166-1 alpha-2"
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "OAuth 2.0 / OIDC error code where applicable (invalid_request, invalid_client, invalid_grant, unauthorized_client, unsupported_response_type, unsupported_grant_type, invalid_scope, access_denied, login_required, ...)"
          },
          "error_description": {
            "type": "string"
          },
          "error_uri": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "WalletClientsConfig": {
        "type": "object",
        "description": "Per-tenant wallet client_id whitelist. Auto-created at App_Data/<tenant>/wallet-clients.json with the default ['aloaha-web-wallet'] on the first credential-issuance request when absent. Add wallet vendors by editing the file (changes picked up within 5 min). Malformed/empty files fall back to the hardcoded default WITHOUT being overwritten (operator may be mid-edit). Cached 5 minutes per tenant.",
        "required": [
          "client_ids"
        ],
        "properties": {
          "client_ids": {
            "type": "array",
            "description": "Wallet client_ids accepted at /vci.ashx?par and /vci.ashx?authorize.",
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "example": [
              "aloaha-web-wallet",
              "some-other-wallet-vendor-id"
            ]
          },
          "_schema": {
            "type": "string",
            "description": "Optional. Pointer to this schema. Ignored by the loader.",
            "format": "uri"
          },
          "_notes": {
            "type": "string",
            "description": "Optional. Free-form operator notes. Ignored by the loader."
          }
        },
        "additionalProperties": false
      },
      "SelfServiceError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "error_description": {
            "type": "string"
          },
          "attempts_left": {
            "type": "integer"
          }
        },
        "required": [
          "error"
        ]
      },
      "SelfServiceFinal": {
        "type": "object",
        "description": "Final answer of a self-service reading",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "created",
              "exists",
              "refused"
            ]
          },
          "reason": {
            "type": "string",
            "enum": [
              "document_has_account",
              "not_genuine",
              "reading_failed",
              "document_expired",
              "document_unreadable",
              "device",
              "code_attempts",
              "not_opened",
              "device_limit",
              "recently_deleted",
              "rate_limited",
              "daily_cap",
              "too_many_attempts",
              "email_in_use"
            ]
          },
          "message": {
            "type": "string"
          },
          "login": {
            "type": "string"
          },
          "released": {
            "type": "boolean"
          },
          "offers": {
            "type": "object",
            "properties": {
              "pid": {
                "type": "string",
                "format": "uri"
              },
              "photo_id": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        },
        "required": [
          "status",
          "message"
        ]
      },
      "SignRequestSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "signed",
              "declined",
              "withdrawn",
              "expired"
            ]
          },
          "level": {
            "type": "string",
            "enum": [
              "qes",
              "aes"
            ]
          },
          "note": {
            "type": "string"
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "expires": {
            "type": "string",
            "format": "date-time"
          },
          "closed_at": {
            "type": "string"
          },
          "keep_until": {
            "type": "string"
          },
          "current": {
            "type": "integer"
          },
          "my_turn": {
            "type": "boolean"
          },
          "progress": {
            "type": "string",
            "enum": [
              "waiting",
              "request_fetched",
              "document_fetched"
            ]
          },
          "link": {
            "type": "string",
            "description": "eudi-rqes:// wallet link when it is the requester's turn"
          },
          "signers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "k": {
                  "type": "integer"
                },
                "who": {
                  "type": "string",
                  "enum": [
                    "me",
                    "invite"
                  ]
                },
                "email": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "waiting",
                    "active",
                    "signed",
                    "declined",
                    "expired",
                    "withdrawn"
                  ]
                },
                "signed": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "signer": {
                        "type": "string"
                      },
                      "issuer": {
                        "type": "string"
                      },
                      "signing_time": {
                        "type": "string"
                      },
                      "qualified": {
                        "type": "boolean",
                        "description": "Only as stated in the certificate; no trusted-list check"
                      },
                      "self_signed": {
                        "type": "boolean"
                      },
                      "format": {
                        "type": "string"
                      },
                      "changes_checked": {
                        "type": "boolean"
                      }
                    }
                  }
                },
                "expires": {
                  "type": "string"
                },
                "mail": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "sent",
                    "failed",
                    null
                  ],
                  "description": "Invitation mail handed to the mail server, or not (delivery itself is not known)"
                },
                "mail_at": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "mails": {
                  "type": "integer"
                },
                "can_resend": {
                  "type": "boolean"
                }
              }
            }
          },
          "docs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "n": {
                  "type": "integer"
                },
                "label": {
                  "type": "string"
                },
                "size": {
                  "type": "integer"
                },
                "original_kept": {
                  "type": "boolean"
                },
                "signed_kept": {
                  "type": "boolean"
                }
              }
            }
          }
        },
        "required": [
          "id",
          "status",
          "signers",
          "docs"
        ]
      },
      "SignatureReport": {
        "type": "object",
        "description": "[SIG-PANEL 2026-10-16] Report of every signature in a PDF (App_Code/RqesPdfVerify.cs). Certificates and time-stamp authorities are not checked against the EU trusted lists; qualified is only as stated in the certificate.",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "valid",
              "warning",
              "invalid",
              "unsigned"
            ]
          },
          "summary": {
            "type": "string"
          },
          "size": {
            "type": "integer"
          },
          "trust_note": {
            "type": "string"
          },
          "signatures": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer"
                },
                "revision_end": {
                  "type": "integer"
                },
                "covers_whole_file": {
                  "type": "boolean"
                },
                "subfilter": {
                  "type": "string"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "signature",
                    "document_timestamp"
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "valid",
                    "warning",
                    "invalid"
                  ]
                },
                "integrity": {
                  "type": "boolean",
                  "description": "The signed revision matches the signature"
                },
                "later_changes": {
                  "type": "string",
                  "enum": [
                    "none",
                    "signatures_and_validation_data",
                    "validation_data",
                    "other",
                    "not_checked"
                  ]
                },
                "later_changes_detail": {
                  "type": "string"
                },
                "signer": {
                  "type": "string"
                },
                "issuer": {
                  "type": "string"
                },
                "serial": {
                  "type": "string"
                },
                "email": {
                  "type": "string"
                },
                "cert_not_before": {
                  "type": "string",
                  "format": "date-time"
                },
                "cert_not_after": {
                  "type": "string",
                  "format": "date-time"
                },
                "self_signed": {
                  "type": "boolean"
                },
                "qualified": {
                  "type": "boolean",
                  "description": "As stated in the certificate (qcStatements)"
                },
                "chain": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "signing_time": {
                  "type": "string",
                  "format": "date-time",
                  "description": "The signer's own claim"
                },
                "cert_valid_at_signing": {
                  "type": "boolean"
                },
                "timestamp": {
                  "type": "object",
                  "properties": {
                    "time": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "authority": {
                      "type": "string"
                    },
                    "valid": {
                      "type": "boolean"
                    }
                  }
                },
                "format": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "location": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "contactinfo": {
                  "type": "string"
                },
                "problems": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "notes": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "required": [
          "status",
          "summary",
          "signatures"
        ]
      },
      "CscClassicInfo": {
        "type": "object",
        "description": "CSC v2.0.0.2 section 11.1 service metadata of the classic /csc/v2 surface.",
        "properties": {
          "specs": {
            "type": "string",
            "const": "2.0.0.2"
          },
          "name": {
            "type": "string"
          },
          "logo": {
            "type": "string",
            "format": "uri"
          },
          "region": {
            "type": "string",
            "examples": [
              "MT"
            ]
          },
          "lang": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "authType": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "oauth2code"
              ]
            }
          },
          "oauth2": {
            "type": "string",
            "format": "uri",
            "description": "The tenant's OpenID Connect authorization endpoint (https://<tenant>/oidc.ashx?action=authorize). Access tokens from that provider are the bearer tokens of this surface."
          },
          "methods": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "signAlgorithms": {
            "type": "object",
            "properties": {
              "algos": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "examples": [
                  [
                    "1.2.840.10045.4.3.2",
                    "1.2.840.113549.1.1.11"
                  ]
                ]
              }
            }
          },
          "signature_qualifier_supported": {
            "type": "array",
            "items": {
              "type": "string",
              "const": "eu_eidas_aes"
            }
          },
          "signature_formats": {
            "type": "object",
            "properties": {
              "formats": {
                "type": "array",
                "items": {
                  "type": "string",
                  "const": "P"
                }
              },
              "envelope_properties": {
                "type": "array",
                "items": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "conformance_levels": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "Ades-B-B",
                "Ades-B-T",
                "Ades-B-LT",
                "Ades-B-LTA"
              ]
            }
          }
        }
      },
      "CscClassicCredentialInfo": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string"
          },
          "signatureQualifier": {
            "type": "string",
            "const": "eu_eidas_aes"
          },
          "key": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "const": "enabled"
              },
              "algo": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "len": {
                "type": "integer"
              },
              "curve": {
                "type": "string"
              },
              "protection": {
                "type": "string",
                "description": "How the private key is protected (software-backed key)."
              },
              "moduleType": {
                "type": "string"
              },
              "moduleCertification": {
                "type": "string"
              }
            }
          },
          "cert": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "const": "valid"
              },
              "certificates": {
                "type": "array",
                "items": {
                  "type": "string",
                  "contentEncoding": "base64"
                }
              },
              "issuerDN": {
                "type": "string",
                "description": "RFC 4514"
              },
              "serialNumber": {
                "type": "string"
              },
              "subjectDN": {
                "type": "string",
                "description": "RFC 4514"
              },
              "validFrom": {
                "type": "string",
                "examples": [
                  "20261013120000Z"
                ]
              },
              "validTo": {
                "type": "string"
              }
            }
          },
          "authMode": {
            "type": "string",
            "const": "implicit"
          },
          "SCAL": {
            "type": "string",
            "enum": [
              "1",
              "2"
            ]
          },
          "PIN": {
            "type": "object",
            "properties": {
              "presence": {
                "type": "string",
                "enum": [
                  "true",
                  "false"
                ]
              },
              "format": {
                "type": "string",
                "const": "N"
              },
              "label": {
                "type": "string"
              }
            }
          },
          "OTP": {
            "type": "object",
            "properties": {
              "presence": {
                "type": "string",
                "const": "false"
              }
            }
          }
        }
      },
      "CscScal2Pending": {
        "type": "object",
        "description": "credentials/authorize answer when the signature activation needs a second factor (SCAL 2).",
        "properties": {
          "authorization_id": {
            "type": "string"
          },
          "pending": {
            "type": "boolean",
            "const": true
          },
          "SAD": {
            "type": "string",
            "const": ""
          },
          "challenge": {
            "type": "string"
          },
          "webauthn_supported": {
            "type": "boolean",
            "description": "true when the user has a registered passkey"
          },
          "pin_supported": {
            "type": "boolean"
          },
          "expires_in": {
            "type": "integer",
            "examples": [
              300
            ]
          },
          "confirm_endpoint": {
            "type": "string",
            "const": "/csc/v2/credentials/authorize/confirm"
          },
          "webauthn_options": {
            "type": "object",
            "description": "PublicKeyCredentialRequestOptions to pass to navigator.credentials.get() (present when webauthn_supported)."
          }
        },
        "required": [
          "authorization_id",
          "pending"
        ]
      },
      "CscTimestampResponse": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "contentEncoding": "base64",
            "description": "DER RFC 3161 TimeStampToken (embed as id-aa-signatureTimeStampToken)."
          },
          "timestamp": {
            "type": "string",
            "contentEncoding": "base64",
            "description": "Same value as token, under the CSC v2 field name."
          },
          "tsa_url": {
            "type": "string",
            "format": "uri",
            "description": "Time-stamp authority that issued the token."
          },
          "token_size": {
            "type": "integer"
          },
          "hash_algo": {
            "type": "string",
            "const": "sha256"
          }
        },
        "required": [
          "token",
          "timestamp"
        ]
      },
      "CscValidationData": {
        "type": "object",
        "properties": {
          "complete": {
            "type": "boolean",
            "description": "false: a chain or a revocation status could not be completed; the client must stay at B-T and not claim B-LT."
          },
          "certificates": {
            "type": "array",
            "items": {
              "type": "string",
              "contentEncoding": "base64"
            }
          },
          "ocspResponses": {
            "type": "array",
            "items": {
              "type": "string",
              "contentEncoding": "base64"
            },
            "description": "Full DER OCSPResponse objects"
          },
          "crls": {
            "type": "array",
            "items": {
              "type": "string",
              "contentEncoding": "base64"
            }
          },
          "note": {
            "type": "string",
            "description": "Reason when complete=false"
          }
        },
        "required": [
          "complete",
          "certificates",
          "ocspResponses",
          "crls"
        ]
      },
      "CscSignDocLevel": {
        "type": "object",
        "properties": {
          "requested": {
            "type": "string"
          },
          "effective": {
            "type": "string"
          },
          "defaulted": {
            "type": "boolean",
            "description": "true when conformance_level was omitted"
          },
          "note": {
            "type": "string",
            "examples": [
              "tsa_unavailable"
            ]
          }
        }
      },
      "CscRqesAdminStatus": {
        "type": "object",
        "description": "Settings of the tenant's wallet remote-signing client, never the secret itself.",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "build": {
            "type": "string"
          },
          "tenant": {
            "type": "string"
          },
          "endpoint": {
            "type": "string",
            "format": "uri",
            "description": "RSSP base URI for wallets: https://<tenant>/rqes/csc/v2"
          },
          "endpoint_alias": {
            "type": "string",
            "format": "uri"
          },
          "oauth_base": {
            "type": "string",
            "format": "uri"
          },
          "tsa": {
            "type": "string",
            "format": "uri"
          },
          "client_id": {
            "type": "string"
          },
          "wallet_property": {
            "type": "string",
            "description": "Name of the wallet build property that holds the client secret."
          },
          "client_created": {
            "type": "boolean"
          },
          "client_name": {
            "type": "string"
          },
          "redirect_uris": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "secret_length": {
            "type": "integer"
          },
          "secret_rotated_at": {
            "type": "string"
          },
          "clients_file_without_wallet_client": {
            "type": "boolean"
          },
          "rotated": {
            "type": "boolean",
            "description": "Only on rotate"
          }
        }
      },
      "CscRqesAdminError": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": false
          },
          "error": {
            "type": "string"
          },
          "error_description": {
            "type": "string"
          }
        },
        "required": [
          "ok",
          "error"
        ]
      },
      "SiteOkError": {
        "type": "object",
        "required": [
          "ok",
          "error"
        ],
        "properties": {
          "ok": {
            "const": false
          },
          "error": {
            "type": "string",
            "description": "Stable machine-readable error code"
          },
          "error_description": {
            "type": "string"
          }
        },
        "description": "Error body used by the tenant-operations handlers (indexnow, secrets, backup)."
      },
      "SiteProblem": {
        "type": "object",
        "required": [
          "type",
          "title",
          "status"
        ],
        "properties": {
          "type": {
            "type": "string",
            "description": "Problem type URI; the last path segment is the stable code (e.g. .../errors/unauthorized)",
            "format": "uri"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          }
        },
        "description": "Problem-details style error body used by the WhatsApp channel handler (served as application/json)."
      },
      "SiteCaptchaChallenge": {
        "type": "object",
        "properties": {
          "question": {
            "type": "string",
            "description": "Arithmetic question to show the user, e.g. \"3 + 5\" (both operands 2-8)",
            "example": "3 + 5"
          },
          "token": {
            "type": "string",
            "description": "Opaque HMAC-signed challenge state: base64url(answer.expiry) + '.' + base64url(HMAC-SHA256). Valid 15 minutes. Echo back as captcha_token."
          }
        },
        "required": [
          "question",
          "token"
        ]
      },
      "SiteComplianceFields": {
        "type": "object",
        "description": "Operator-entered GDPR documentation fields (controller identity, DPIA, sign-off, records of processing, retention). Every value is a string of at most 8000 characters; keys outside this list are rejected.",
        "properties": {
          "controller_legal_name": {
            "type": "string"
          },
          "controller_address": {
            "type": "string"
          },
          "controller_registry_no": {
            "type": "string"
          },
          "controller_contact": {
            "type": "string"
          },
          "controller_dpo_name": {
            "type": "string"
          },
          "controller_dpo_contact": {
            "type": "string"
          },
          "controller_eu_representative": {
            "type": "string"
          },
          "dpia_tenant_operator": {
            "type": "string"
          },
          "dpia_assessment_date": {
            "type": "string"
          },
          "dpia_dpo_consulted_date": {
            "type": "string"
          },
          "dpia_reviewer_name": {
            "type": "string"
          },
          "dpia_next_review_date": {
            "type": "string"
          },
          "dpia_version": {
            "type": "string"
          },
          "dpia_dpo_opinion": {
            "type": "string"
          },
          "dpia_dpo_conditions": {
            "type": "string"
          },
          "dpia_art36_triggered": {
            "type": "string"
          },
          "dpia_ds_consultation": {
            "type": "string"
          },
          "signoff_controller_name": {
            "type": "string"
          },
          "signoff_controller_date": {
            "type": "string"
          },
          "signoff_dpo_name": {
            "type": "string"
          },
          "signoff_dpo_date": {
            "type": "string"
          },
          "signoff_reviewer_name": {
            "type": "string"
          },
          "signoff_reviewer_date": {
            "type": "string"
          },
          "signoff_next_review_date": {
            "type": "string"
          },
          "ropa_processor_address": {
            "type": "string"
          },
          "ropa_third_country_selfhost": {
            "type": "string"
          },
          "ropa_third_country_saas": {
            "type": "string"
          },
          "ropa_ai_transcription_region": {
            "type": "string"
          },
          "ropa_consent_capture": {
            "type": "string"
          },
          "ropa_consent_retention": {
            "type": "string"
          },
          "ropa_consent_withdrawal": {
            "type": "string"
          },
          "ropa_consent_version": {
            "type": "string"
          },
          "ropa_dpa_version_date": {
            "type": "string"
          },
          "retention_audit": {
            "type": "string"
          },
          "retention_metrics": {
            "type": "string"
          },
          "retention_transaction": {
            "type": "string"
          },
          "retention_pid_days": {
            "type": "string"
          },
          "retention_backup_days": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "SiteSipProvEnvelope": {
        "type": "object",
        "properties": {
          "aor": {
            "type": "string",
            "description": "SIP address of record user@domain"
          },
          "user": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "password": {
            "type": "string",
            "description": "SIP password (delivered once; the token is consumed)"
          },
          "label": {
            "type": "string"
          },
          "transport": {
            "type": "string",
            "const": "TLS"
          },
          "port": {
            "type": "integer",
            "const": 5061
          },
          "srtp": {
            "type": "string",
            "const": "sdes"
          }
        },
        "required": [
          "aor",
          "user",
          "domain",
          "password",
          "transport",
          "port",
          "srtp"
        ],
        "description": "JSON provisioning envelope returned for format=json."
      },
      "SiteEudiRelyingPartyMetadata": {
        "type": "object",
        "properties": {
          "tenant": {
            "type": "string"
          },
          "did_web": {
            "type": "string",
            "description": "did:web identifier of the tenant",
            "example": "did:web:phone.aloaha.com"
          },
          "jar_signing": {
            "type": "string",
            "enum": [
              "registry_issued",
              "self_signed"
            ],
            "description": "Which certificate signs OpenID4VP request objects (JAR)."
          },
          "wrp_registered": {
            "type": "boolean",
            "description": "true when a registry-issued relying-party certificate is installed and a registry record id is on file"
          },
          "identity": {
            "type": "object",
            "properties": {
              "trade_name": {
                "type": "string"
              },
              "legal_names": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "country": {
                "type": "string"
              },
              "info_uri": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "registry_uri": {
                "type": "string"
              },
              "isPSB": {
                "type": "boolean"
              }
            }
          },
          "supervisory_authority": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "country": {
                "type": "string"
              },
              "form_uri": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "entitlements": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "credential_types": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "vct": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "format": {
                  "type": "string",
                  "const": "dc+sd-jwt"
                }
              }
            },
            "description": "Credential types this relying party is registered to request (PID and Photo ID are test credentials)."
          },
          "certs": {
            "type": "object",
            "properties": {
              "wrp_p12_sha256": {
                "type": "string",
                "description": "hex SHA-256 of the installed relying-party certificate file"
              },
              "intended_use_jades_sha256": {
                "type": "string",
                "description": "hex SHA-256 of the installed intended-use (registration) certificate"
              }
            }
          },
          "registry_ids": {
            "type": "object",
            "additionalProperties": true,
            "description": "Registry record ids (keys ending in _id / _ids)."
          },
          "well_known": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Relative paths of sibling discovery documents published by this tenant."
          },
          "registry_base": {
            "type": "string",
            "description": "Base URL of the relying-party registry the tenant registers with"
          },
          "generated_utc": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "tenant",
          "did_web",
          "jar_signing",
          "wrp_registered",
          "certs",
          "well_known",
          "generated_utc"
        ],
        "description": "Public relying-party metadata. identity, supervisory_authority, entitlements and credential_types appear only once the operator has saved a registration config."
      },
      "SiteCertSummary": {
        "type": "object",
        "properties": {
          "subject": {
            "type": "string"
          },
          "issuer": {
            "type": "string"
          },
          "serial_hex": {
            "type": "string"
          },
          "not_before_utc": {
            "type": "string",
            "format": "date-time"
          },
          "not_after_utc": {
            "type": "string",
            "format": "date-time"
          },
          "sha1_thumbprint": {
            "type": "string"
          },
          "sha256_fingerprint": {
            "type": "string"
          }
        }
      },
      "SiteWaSendResult": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "description": "true when the messaging provider accepted the message (2xx)"
          },
          "metaStatus": {
            "type": "integer",
            "description": "HTTP status returned by the messaging provider (0 when the request never left this server)"
          },
          "waMessageId": {
            "type": "string",
            "description": "Provider message id, when accepted"
          },
          "metaError": {
            "type": "string",
            "description": "Provider error message"
          },
          "metaErrorCode": {
            "type": "string"
          },
          "metaErrorDetails": {
            "type": "string"
          },
          "localError": {
            "type": "string",
            "description": "Set when the send was refused locally before reaching the provider (e.g. daily new-recipient limit reached, channel not configured)"
          },
          "keyId": {
            "type": "string",
            "description": "Id of the API key that authorised the call"
          },
          "boundTemplate": {
            "type": "string",
            "description": "Template name the API key is restricted to, if any"
          },
          "boundLanguage": {
            "type": "string",
            "description": "Template language the API key is restricted to, if any"
          }
        },
        "required": [
          "ok",
          "metaStatus"
        ]
      },
      "SiteWaTemplate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "enum": [
              "UTILITY",
              "AUTHENTICATION",
              "MARKETING"
            ]
          },
          "status": {
            "type": "string",
            "description": "Review status (APPROVED, PENDING, IN_APPEAL, PAUSED)"
          },
          "components": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Template components as returned by the provider"
          },
          "placeholders": {
            "description": "Placeholder metadata ({{1}}..{{n}}) extracted from the body component"
          }
        },
        "required": [
          "name",
          "language",
          "status"
        ]
      },
      "SiteWaConfig": {
        "type": "object",
        "properties": {
          "tenant": {
            "type": "string"
          },
          "configured": {
            "type": "boolean"
          },
          "enabled": {
            "type": "boolean"
          },
          "appId": {
            "type": "string"
          },
          "appSecret": {
            "type": "string",
            "description": "Always masked in responses"
          },
          "wabaId": {
            "type": "string",
            "description": "Business account id"
          },
          "phoneNumberId": {
            "type": "string"
          },
          "accessToken": {
            "type": "string",
            "description": "Always masked in responses"
          },
          "verifyToken": {
            "type": "string",
            "description": "Webhook verify token, returned in clear so it can be copied into the provider dashboard; auto-generated when empty"
          },
          "senderPhone": {
            "type": "string"
          },
          "senderDisplayName": {
            "type": "string"
          },
          "routingUsers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Tenant logins that receive inbound messages in their team chat (lower-case, [a-z0-9._-], max 64)"
          },
          "forwardEmails": {
            "type": "string",
            "description": "Comma-separated addresses that receive a copy of every inbound message (max 16)"
          },
          "newChatsPerDayLimit": {
            "type": "integer",
            "description": "Cap on distinct outbound recipients per UTC day (0 = unlimited, max 10000, default 10)"
          },
          "inboxGroupId": {
            "type": "string",
            "description": "Shared inbox chat group id (default wa-inbox)"
          },
          "waApiKeys": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "template": {
                  "type": "string"
                },
                "templateLanguage": {
                  "type": "string"
                },
                "createdUtc": {
                  "type": "string",
                  "format": "date-time"
                },
                "lastUsedUtc": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                },
                "keyMasked": {
                  "type": "string",
                  "description": "Prefix and last 4 characters only; the full key is shown once at creation"
                }
              }
            }
          },
          "createdUtc": {
            "type": "string",
            "format": "date-time"
          },
          "updatedUtc": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "tenant",
          "configured"
        ],
        "description": "Tenant WhatsApp channel configuration with secrets masked. When nothing is configured only {tenant, configured:false} is returned."
      },
      "WalletPlainError": {
        "type": "string",
        "description": "Short machine-readable error code returned as text/plain (for example bad_id, method_not_allowed)."
      },
      "WalletJwkP256Public": {
        "type": "object",
        "description": "Public EC P-256 JWK. Never include the private member d.",
        "required": [
          "kty",
          "crv",
          "x",
          "y"
        ],
        "properties": {
          "kty": {
            "type": "string",
            "const": "EC"
          },
          "crv": {
            "type": "string",
            "const": "P-256"
          },
          "x": {
            "type": "string",
            "description": "base64url"
          },
          "y": {
            "type": "string",
            "description": "base64url"
          }
        }
      },
      "WalletAttestationResponse": {
        "type": "object",
        "required": [
          "wallet_attestation",
          "expires_in"
        ],
        "properties": {
          "wallet_attestation": {
            "type": "string",
            "description": "Compact JWS, header typ=wallet-attestation+jwt, alg=HS256 (tenant key; verifiable by this tenant only). Payload: iss, sub, aud=eudi-wallet-verifier, iat, nbf, exp, jti, cnf.jwk, wallet_name, wallet_link, aal, authorized_by, nonce (when supplied)."
          },
          "token_type": {
            "type": "string",
            "example": "wallet_attestation+jwt"
          },
          "expires_in": {
            "type": "integer",
            "example": 86400
          },
          "iat": {
            "type": "integer"
          },
          "exp": {
            "type": "integer"
          },
          "sub": {
            "type": "string",
            "description": "RFC 7638 thumbprint of walletPublicJwk"
          },
          "iss": {
            "type": "string",
            "example": "https://phone.aloaha.com/wallet-attestation"
          }
        }
      },
      "WalletSessionTokenResponse": {
        "type": "object",
        "required": [
          "access_token",
          "token_type",
          "expires_in"
        ],
        "properties": {
          "access_token": {
            "type": "string",
            "description": "HS256 JWT, iss=codeb-wallet-session, aud=wallet-backup, carries sub, tenant, azp."
          },
          "token_type": {
            "type": "string",
            "const": "Bearer"
          },
          "expires_in": {
            "type": "integer",
            "example": 600
          },
          "aud": {
            "type": "string",
            "example": "wallet-backup"
          },
          "iat": {
            "type": "integer"
          },
          "exp": {
            "type": "integer"
          }
        }
      },
      "WalletVaultBlob": {
        "type": "object",
        "description": "Client-encrypted vault. The server checks only that the three top-level keys exist and never decrypts. Other members are stored as sent.",
        "required": [
          "v",
          "wrappedDeks",
          "cipher"
        ],
        "properties": {
          "v": {
            "description": "Format version chosen by the client"
          },
          "wrappedDeks": {
            "description": "Data-encryption key wrapped under one or more client-held factors"
          },
          "cipher": {
            "description": "Ciphertext of the vault (AES-256-GCM on the client)"
          }
        },
        "additionalProperties": true
      },
      "WalletWuaResponse": {
        "type": "object",
        "required": [
          "wua",
          "wallet_id",
          "exp"
        ],
        "properties": {
          "wua": {
            "type": "string",
            "description": "Compact JWS, typ=wallet-unit-attestation+jwt, alg=ES256, kid=did:web:<host>#issuer. Payload: iss, sub (=wallet_id), iat, exp (+365 days), wallet_name, wallet_version, wallet_solution_id, loa (self-declared label, not a certification), cnf.jwk, key_attestation (copied as supplied, not verified)."
          },
          "wallet_id": {
            "type": "string",
            "description": "32 hex chars derived from the SHA-256 of the JWK thumbprint input",
            "pattern": "^[0-9a-f]{32}$"
          },
          "exp": {
            "type": "integer"
          }
        }
      },
      "WalletWiaResponse": {
        "type": "object",
        "required": [
          "wia",
          "exp"
        ],
        "properties": {
          "wia": {
            "type": "string",
            "description": "Compact JWS, typ=wallet-instance-attestation+jwt, alg=ES256. Payload: iss, sub, iat, exp (+24 h), wua_ref, cnf (from the WUA), nonce (when supplied), wallet_solution_id."
          },
          "exp": {
            "type": "integer"
          }
        }
      },
      "WalletDidDocument": {
        "type": "object",
        "description": "W3C DID Core 1.0 document.",
        "required": [
          "id"
        ],
        "properties": {
          "@context": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "id": {
            "type": "string",
            "example": "did:web:phone.aloaha.com"
          },
          "controller": {
            "type": "string"
          },
          "verificationMethod": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "example": "JsonWebKey"
                },
                "controller": {
                  "type": "string"
                },
                "publicKeyJwk": {
                  "type": "object"
                }
              }
            }
          },
          "authentication": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "assertionMethod": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "service": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        },
        "additionalProperties": true
      },
      "WalletDidResolution": {
        "type": "object",
        "properties": {
          "didDocument": {
            "$ref": "#/components/schemas/WalletDidDocument"
          },
          "resolutionMetadata": {
            "type": "object",
            "properties": {
              "contentType": {
                "type": "string"
              },
              "error": {
                "type": "string",
                "enum": [
                  "notFound",
                  "internalError"
                ]
              },
              "message": {
                "type": "string"
              }
            }
          },
          "documentMetadata": {
            "type": "object"
          }
        }
      },
      "WalletVcdmIssueResponse": {
        "type": "object",
        "required": [
          "credential",
          "format"
        ],
        "properties": {
          "credential": {
            "type": "string",
            "description": "VC-JWT, header typ=vc+jwt, alg=ES256; payload iss=did:web:<host>, sub, iat, exp (+365 days), vc (VCDM 2.0 credential)."
          },
          "format": {
            "type": "string",
            "const": "vc+jwt"
          }
        }
      },
      "WalletVcdmVerifyResult": {
        "type": "object",
        "required": [
          "valid",
          "signature_verified",
          "holder_binding_verified"
        ],
        "properties": {
          "valid": {
            "type": "boolean"
          },
          "signature_verified": {
            "type": "boolean",
            "description": "True only when the issuer signature was checked cryptographically."
          },
          "holder_binding_verified": {
            "type": "boolean",
            "const": false,
            "description": "Always false: this endpoint does not check key binding."
          },
          "holder_binding_note": {
            "type": "string"
          },
          "issuer": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "claims": {
            "type": "object",
            "description": "The vc member of the payload"
          },
          "error": {
            "type": "string",
            "description": "not_jws, parse_failed, bad_typ:..., unsupported_alg:..., expired, bad_signature, malformed_vc_issuer, issuer_mismatch_jwt_vs_vc, issuer_not_trusted_or_signature_invalid"
          }
        }
      },
      "WalletTrustEntry": {
        "type": "object",
        "properties": {
          "host": {
            "type": "string"
          },
          "did": {
            "type": "string"
          },
          "added_at_utc": {
            "type": "string"
          },
          "notes": {
            "type": "string"
          },
          "jwk_cached_at_utc": {
            "type": "string"
          },
          "jwks_count": {
            "type": "integer"
          },
          "stale": {
            "type": "boolean"
          }
        }
      },
      "WalletTrustResolveResult": {
        "type": "object",
        "required": [
          "iss",
          "trusted",
          "jwks"
        ],
        "properties": {
          "iss": {
            "type": "string"
          },
          "trusted": {
            "type": "boolean"
          },
          "jwks": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "stale": {
            "type": "boolean"
          },
          "error": {
            "type": "string",
            "enum": [
              "resolve_failed"
            ]
          }
        }
      },
      "WalletTrustListJson": {
        "type": "object",
        "properties": {
          "scheme_operator": {
            "type": "string"
          },
          "scheme_name": {
            "type": "string"
          },
          "scheme_territory": {
            "type": "string"
          },
          "list_issue_datetime": {
            "type": "string"
          },
          "next_update": {
            "type": "string"
          },
          "tsp_services": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "x509": {
                  "type": "string",
                  "description": "base64 DER issuer certificate"
                },
                "info_uri": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "WalletShareCreated": {
        "type": "object",
        "required": [
          "id",
          "url",
          "expires_utc",
          "ttl_seconds"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-f0-9]{32}$"
          },
          "url": {
            "type": "string",
            "description": "<origin>/vc-verify.html#s=<id>"
          },
          "expires_utc": {
            "type": "string",
            "format": "date-time"
          },
          "ttl_seconds": {
            "type": "integer"
          }
        }
      },
      "WalletVpEvents": {
        "type": "object",
        "properties": {
          "tenant": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "since": {
            "type": [
              "string",
              "null"
            ]
          },
          "events": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "ts": {
                  "type": "string"
                },
                "event": {
                  "type": "string",
                  "description": "starts with vp-"
                },
                "peerId": {
                  "type": "string"
                },
                "ip": {
                  "type": "string"
                },
                "extra": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "WalletCscaStatus": {
        "type": "object",
        "description": "Public summary of the CSCA trust material held for the wallet. Fields appear once known.",
        "properties": {
          "ml_changed_utc": {
            "type": "string"
          },
          "ml_last_success_utc": {
            "type": "string"
          },
          "ml_last_attempt_utc": {
            "type": "string"
          },
          "ml_sha256": {
            "type": "string"
          },
          "ml_source_name": {
            "type": "string"
          },
          "ml_signing_time_utc": {
            "type": "string"
          },
          "ml_csca_count": {
            "type": "integer"
          },
          "crl_changed_utc": {
            "type": "string"
          },
          "crl_last_success_utc": {
            "type": "string"
          },
          "crl_last_attempt_utc": {
            "type": "string"
          },
          "crl_sha256": {
            "type": "string"
          },
          "crl_count": {
            "type": "integer"
          },
          "crl_countries": {},
          "crl_urls": {},
          "crl_fetch_failed": {},
          "crl_rejected": {},
          "refresh_running": {
            "type": "boolean"
          },
          "masterlist_url": {
            "type": "string",
            "example": "/wallet/trust/csca-masterlist.ml"
          },
          "crls_url": {
            "type": "string",
            "example": "/wallet/trust/csca-crls.zip"
          }
        }
      },
      "WalletVerifierMetadata": {
        "type": "object",
        "description": "Verifier discovery document. Either a tenant-provided document or a generated default; both carry _serverBuild, _tenant and _source (tenant-override | auto-synth).",
        "properties": {
          "_serverBuild": {
            "type": "string"
          },
          "_tenant": {
            "type": "string"
          },
          "_source": {
            "type": "string",
            "enum": [
              "tenant-override",
              "auto-synth"
            ]
          },
          "schemaVersion": {
            "type": "string"
          },
          "operator": {
            "type": "object"
          },
          "deployment": {
            "type": "object"
          },
          "protocols": {
            "type": "object"
          },
          "certification": {
            "type": "object"
          },
          "declaredPurposes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "requestedAttributes": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "privacy": {
            "type": "object"
          },
          "updatedUtc": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "BwOk": {
        "type": "object",
        "required": [
          "ok"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          }
        },
        "additionalProperties": true
      },
      "BwCompany": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "reg": {
            "type": "string"
          },
          "juris": {
            "type": "string"
          },
          "addr": {
            "type": "string"
          },
          "vat": {
            "type": "string"
          },
          "didMethod": {
            "type": "string"
          },
          "did": {
            "type": "string",
            "example": "did:web:phone.aloaha.com:business-wallets:acme-ltd"
          },
          "public": {
            "type": "boolean"
          },
          "created_by": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "BwEmployee": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "e_..."
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "wallet_id": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "director",
              "secretary",
              "legal",
              "compliance",
              "employee",
              "agent"
            ]
          },
          "agent_model": {
            "type": "string"
          },
          "agent_provider_hint": {
            "type": "string"
          },
          "agent_purpose": {
            "type": "string"
          },
          "agent_capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "agent_max_ttl_sec": {
            "type": "integer"
          },
          "agent_active": {
            "type": "boolean"
          },
          "agent_created_at": {
            "type": "string"
          },
          "agent_created_by": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "BwRelyingParty": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "rp_..."
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "bank",
              "registry",
              "auditor",
              "authority",
              "csp"
            ]
          },
          "did": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "mobile": {
            "type": "string"
          },
          "enrolled": {
            "type": "string"
          }
        }
      },
      "BwDocMeta": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "d_..."
          },
          "title": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "incorp",
              "ubo",
              "sow",
              "board",
              "poa",
              "financials",
              "bank-ref",
              "tax",
              "ml",
              "director-id",
              "vat",
              "other"
            ]
          },
          "issuer": {
            "type": "string"
          },
          "vct": {
            "type": "string"
          },
          "issued": {
            "type": "string"
          },
          "uploader": {
            "type": "string"
          },
          "pushed_by": {
            "type": "string"
          },
          "mime": {
            "type": "string"
          },
          "orig_name": {
            "type": "string"
          },
          "size": {
            "type": "integer"
          },
          "grants": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Relying-party ids with access"
          },
          "signature": {
            "type": "object"
          },
          "signatures": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "countersignatures": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BwCountersignature"
            }
          }
        },
        "additionalProperties": true
      },
      "BwCountersignature": {
        "type": "object",
        "properties": {
          "ts": {
            "type": "string"
          },
          "signer": {
            "type": "string"
          },
          "statement": {
            "type": "string",
            "enum": [
              "accepted",
              "verified",
              "approved",
              "endorsed",
              "witnessed"
            ]
          },
          "note": {
            "type": "string"
          },
          "via_invite_index": {
            "type": "integer"
          }
        }
      },
      "BwState": {
        "type": "object",
        "properties": {
          "company": {
            "$ref": "#/components/schemas/BwCompany"
          },
          "employees": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BwEmployee"
            }
          },
          "rps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BwRelyingParty"
            }
          },
          "docs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BwDocMeta"
            }
          },
          "audit_count": {
            "type": "integer"
          }
        },
        "additionalProperties": true
      },
      "BwWalletSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "reg": {
            "type": "string"
          },
          "juris": {
            "type": "string"
          },
          "vat": {
            "type": "string"
          },
          "addr": {
            "type": "string"
          },
          "did": {
            "type": "string"
          },
          "did_doc_url": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "wallet_id": {
            "type": "string",
            "example": "urn:aloaha:web-wallet:..."
          },
          "public": {
            "type": "boolean"
          },
          "role": {
            "type": "string"
          },
          "created": {
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "dir_created": {
            "type": "string"
          },
          "employee_count": {
            "type": "integer"
          },
          "rp_count": {
            "type": "integer"
          },
          "doc_count": {
            "type": "integer"
          },
          "vc_count": {
            "type": "integer"
          },
          "audit_count": {
            "type": "integer"
          }
        }
      },
      "BwIdentity": {
        "type": "object",
        "properties": {
          "tenant": {
            "type": "string"
          },
          "bw": {
            "type": "string"
          },
          "did_web": {
            "type": "string"
          },
          "did_webvh": {
            "type": "string"
          },
          "did_key": {
            "type": "string"
          },
          "did_jwk": {
            "type": "string"
          },
          "wallet_id": {
            "type": "string"
          },
          "did_doc_url": {
            "type": "string"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "BwAgentManifest": {
        "type": "object",
        "description": "Public descriptor of an agent employee of a business wallet.",
        "additionalProperties": true,
        "properties": {
          "agent_did": {
            "type": "string"
          },
          "owner_did": {
            "type": "string"
          },
          "did_doc_url": {
            "type": "string"
          },
          "issuer": {
            "type": "string"
          },
          "token_type": {
            "type": "string",
            "const": "codeb-agent-token+jwt"
          },
          "issuer_key": {
            "type": "object",
            "description": "Public JWK"
          },
          "revocation": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string"
              },
              "url": {
                "type": "string"
              }
            }
          }
        }
      },
      "BwAgentTokenVerify": {
        "type": "object",
        "required": [
          "verified"
        ],
        "properties": {
          "verified": {
            "type": "boolean"
          },
          "reason": {
            "type": "string",
            "description": "ok, not_compact_jws, malformed_segment:..., unsupported_alg:..., token_expired, iss_not_this_tenant, iss_bad_companyId, agent_did_missing_fragment, issuer_pfx_missing, kid_mismatch, bad_signature, verify_ex:..., agent_not_found, employee_not_agent, agent_deactivated, token_revoked"
          },
          "typ": {
            "type": "string"
          },
          "agent_did": {
            "type": "string"
          },
          "owner_did": {
            "type": "string"
          },
          "iss": {
            "type": "string"
          },
          "exp": {
            "type": "integer"
          },
          "scope": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sti": {
            "type": "integer"
          },
          "token_kid": {
            "type": "string"
          },
          "current_kid": {
            "type": "string"
          }
        }
      },
      "BwStatusListCredential": {
        "type": "object",
        "description": "Unsigned W3C Bitstring Status List credential (JSON, not a JWT).",
        "properties": {
          "@context": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "id": {
            "type": "string"
          },
          "type": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "issuer": {
            "type": "string"
          },
          "validFrom": {
            "type": "string"
          },
          "credentialSubject": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "statusPurpose": {
                "type": "string"
              },
              "encodedList": {
                "type": "string"
              }
            }
          },
          "revoked_count": {
            "type": "integer"
          }
        }
      },
      "CoreProblem": {
        "type": "object",
        "description": "RFC 9457-style problem document used by the chat, chat-invite, chat-widget, chat-email and property-management handlers (served as application/problem+json).",
        "properties": {
          "type": {
            "type": "string",
            "format": "uri",
            "description": "Problem type URI; the last path segment is the stable error code"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "title",
          "status"
        ]
      },
      "CoreSignInResult": {
        "type": "object",
        "description": "Successful sign-in result shared by login, passkey-signin-finish, totp-verify and magic-link-finish.",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "redirect": {
            "type": "string",
            "description": "Where the page should navigate next. When the return URL was an /oauth2/v1/authorize request, this is the client's redirect_uri with a fresh authorization code."
          },
          "user": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "sso_assertion": {
            "type": "string",
            "description": "Short-lived signed assertion the page keeps to sign in again silently via sso-mint (JWS)."
          },
          "sso_max_age": {
            "type": "integer",
            "description": "Maximum age of the assertion in seconds"
          }
        },
        "required": [
          "ok",
          "redirect"
        ]
      },
      "CoreOkMessage": {
        "type": "object",
        "description": "Uniform answer used by flows that must not reveal whether an account exists.",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "ok"
        ]
      },
      "CoreListEnvelope": {
        "type": "object",
        "description": "Pagination envelope of the v1 REST list endpoints. Item keys are camelCase. ?limit= 1-500 (default 50), ?offset= default 0.",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "total": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "next": {
            "type": [
              "string",
              "null"
            ],
            "description": "Relative URL of the next page, or null"
          }
        },
        "required": [
          "data",
          "total",
          "limit",
          "offset"
        ]
      },
      "CoreSchemaMetadataRecord": {
        "type": "object",
        "description": "Attestation schema catalogue record (one per credential type the tenant publishes).",
        "properties": {
          "id": {
            "type": "string",
            "description": "Slug (file stem of the credential type definition)"
          },
          "version": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rulebookURI": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "rulebookIntegrity": {
            "type": [
              "string",
              "null"
            ],
            "description": "sha256-<base64> of the rulebook markdown"
          },
          "attestationLoS": {
            "type": "string"
          },
          "bindingType": {
            "type": "string"
          },
          "supportedFormats": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "schemaURIs": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "issuer": {
            "type": "string"
          },
          "issuedAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "deprecated": {
            "type": "boolean"
          },
          "signedJwt": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CoreMdocVerifyResult": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "description": "sig_ok && chain_ok"
          },
          "sig_ok": {
            "type": "boolean",
            "description": "IssuerAuth COSE_Sign1 signature over the MSO verifies"
          },
          "chain_ok": {
            "type": "boolean",
            "description": "Issuer certificate chains to a tenant-configured mdoc issuer anchor"
          },
          "doc_type": {
            "type": "string"
          },
          "issuer_cn": {
            "type": "string"
          },
          "mso_valid_from": {
            "type": "string",
            "format": "date-time"
          },
          "mso_valid_until": {
            "type": "string",
            "format": "date-time"
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "error": {
            "type": "string"
          }
        }
      },
      "CoreDataAgreement": {
        "type": "object",
        "description": "Data Agreement shaped after ISO/IEC TS 27560 (purpose, lawful basis, retention), with its revision chain.",
        "properties": {
          "da_id": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "revisions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "rev": {
                  "type": "integer"
                },
                "purpose": {
                  "type": "string"
                },
                "lawful_basis": {
                  "type": "string"
                },
                "controller": {
                  "type": "string"
                },
                "retention_days": {
                  "type": "integer"
                },
                "data_categories": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "third_parties": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "created_by": {
                  "type": "string"
                }
              },
              "additionalProperties": true
            }
          }
        }
      },
      "CoreWebhook": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "active": {
            "type": "boolean"
          },
          "createdAtUtc": {
            "type": "string",
            "format": "date-time"
          },
          "createdBy": {
            "type": "string"
          },
          "lastFiredUtc": {
            "type": [
              "string",
              "null"
            ]
          },
          "failures": {
            "type": "integer"
          }
        }
      },
      "CoreShareLink": {
        "type": "object",
        "description": "Public share link (token) for one recording or transcript.",
        "properties": {
          "token": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "createdAtUtc": {
            "type": "string",
            "format": "date-time"
          },
          "createdBy": {
            "type": "string"
          },
          "expiresUtc": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "CoreLogEvents": {
        "type": "object",
        "description": "Generic admin log envelope: newest-first event rows read from the tenant's own log files.",
        "properties": {
          "ts": {
            "type": "string",
            "format": "date-time"
          },
          "count": {
            "type": "integer"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      },
      "CoreCredentialOfferLinks": {
        "type": "object",
        "properties": {
          "offer_id": {
            "type": "string"
          },
          "offer_uri": {
            "type": "string",
            "format": "uri"
          },
          "deep_link": {
            "type": "string",
            "description": "openid-credential-offer:// link"
          },
          "web_link": {
            "type": "string",
            "format": "uri"
          },
          "vct": {
            "type": "string"
          },
          "expires_utc": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": true
      },
      "CamaraError": {
        "type": "object",
        "required": [
          "status",
          "code",
          "message"
        ],
        "properties": {
          "status": {
            "type": "integer"
          },
          "code": {
            "type": "string",
            "examples": [
              "INVALID_ARGUMENT",
              "UNAUTHENTICATED",
              "PERMISSION_DENIED",
              "INVALID_TOKEN_CONTEXT",
              "NOT_FOUND"
            ]
          },
          "message": {
            "type": "string"
          }
        }
      },
      "NumberVerificationRequest": {
        "type": "object",
        "description": "Exactly one of phoneNumber or hashedPhoneNumber.",
        "properties": {
          "phoneNumber": {
            "type": "string",
            "pattern": "^\\+[1-9][0-9]{4,14}$",
            "examples": [
              "+35699123456"
            ]
          },
          "hashedPhoneNumber": {
            "type": "string",
            "pattern": "^[a-fA-F0-9]{64}$",
            "description": "Hex SHA-256 of the E.164 number including '+'."
          }
        }
      },
      "NumberVerificationResponse": {
        "type": "object",
        "required": [
          "devicePhoneNumberVerified"
        ],
        "properties": {
          "devicePhoneNumberVerified": {
            "type": "boolean"
          }
        }
      },
      "DevicePhoneNumberResponse": {
        "type": "object",
        "required": [
          "devicePhoneNumber"
        ],
        "properties": {
          "devicePhoneNumber": {
            "type": "string",
            "examples": [
              "+35699123456"
            ]
          }
        }
      },
      "KycMatchRequest": {
        "type": "object",
        "properties": {
          "phoneNumber": {
            "type": "string",
            "maxLength": 256
          },
          "name": {
            "type": "string",
            "maxLength": 256
          },
          "givenName": {
            "type": "string",
            "maxLength": 256
          },
          "familyName": {
            "type": "string",
            "maxLength": 256
          },
          "familyNameAtBirth": {
            "type": "string",
            "maxLength": 256
          },
          "birthdate": {
            "type": "string",
            "maxLength": 256
          },
          "gender": {
            "type": "string",
            "maxLength": 256
          },
          "address": {
            "type": "string",
            "maxLength": 256
          },
          "streetName": {
            "type": "string",
            "maxLength": 256
          },
          "streetNumber": {
            "type": "string",
            "maxLength": 256
          },
          "postalCode": {
            "type": "string",
            "maxLength": 256
          },
          "locality": {
            "type": "string",
            "maxLength": 256
          },
          "region": {
            "type": "string",
            "maxLength": 256
          },
          "country": {
            "type": "string",
            "maxLength": 256
          },
          "email": {
            "type": "string",
            "maxLength": 256
          }
        },
        "minProperties": 1
      },
      "MatchResult": {
        "type": "string",
        "enum": [
          "true",
          "false",
          "not_available"
        ]
      },
      "KycMatchResponse": {
        "type": "object",
        "description": "Only the properties that were sent are answered.",
        "properties": {
          "nameMatch": {
            "$ref": "#/components/schemas/MatchResult"
          },
          "givenNameMatch": {
            "$ref": "#/components/schemas/MatchResult"
          },
          "familyNameMatch": {
            "$ref": "#/components/schemas/MatchResult"
          },
          "familyNameAtBirthMatch": {
            "$ref": "#/components/schemas/MatchResult"
          },
          "birthdateMatch": {
            "$ref": "#/components/schemas/MatchResult"
          },
          "genderMatch": {
            "$ref": "#/components/schemas/MatchResult"
          },
          "addressMatch": {
            "$ref": "#/components/schemas/MatchResult"
          },
          "streetNameMatch": {
            "$ref": "#/components/schemas/MatchResult"
          },
          "streetNumberMatch": {
            "$ref": "#/components/schemas/MatchResult"
          },
          "postalCodeMatch": {
            "$ref": "#/components/schemas/MatchResult"
          },
          "localityMatch": {
            "$ref": "#/components/schemas/MatchResult"
          },
          "regionMatch": {
            "$ref": "#/components/schemas/MatchResult"
          },
          "countryMatch": {
            "$ref": "#/components/schemas/MatchResult"
          },
          "emailMatch": {
            "$ref": "#/components/schemas/MatchResult"
          }
        }
      },
      "VcallStart": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "pattern": "^[0-9]{6}$"
          },
          "expiresIn": {
            "type": "integer"
          }
        }
      },
      "VcallStatus": {
        "type": "object",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "waiting",
              "verified",
              "declined",
              "expired"
            ]
          },
          "expiresIn": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "method": {
            "type": "string",
            "enum": [
              "eudi"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "pid",
              "document"
            ]
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "phone": {
            "type": "string"
          }
        }
      },
      "VcallCode": {
        "type": "object",
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^[0-9 -]{6,8}$"
          }
        }
      },
      "VcallClaim": {
        "type": "object",
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "sharePhone": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "VcallClaimResult": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          }
        }
      },
      "VcallAttestRequest": {
        "type": "object",
        "required": [
          "cnf_jwk"
        ],
        "properties": {
          "cnf_jwk": {
            "type": "object",
            "required": [
              "kty",
              "crv",
              "x",
              "y"
            ],
            "properties": {
              "kty": {
                "const": "EC"
              },
              "crv": {
                "const": "P-256"
              },
              "x": {
                "type": "string"
              },
              "y": {
                "type": "string"
              }
            }
          }
        }
      },
      "VcallAttestResponse": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "description": "compact JWS, typ codeb-vcall+jwt"
          },
          "cap": {
            "type": "string",
            "minLength": 43,
            "maxLength": 43
          },
          "cap_expires_in": {
            "type": "integer"
          }
        }
      },
      "VcallAnnounce": {
        "type": "object",
        "required": [
          "cap",
          "bucket",
          "blob"
        ],
        "properties": {
          "cap": {
            "type": "string"
          },
          "bucket": {
            "type": "string",
            "pattern": "^[0-9a-f]{4}$"
          },
          "blob": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{16,4096}$"
          }
        }
      },
      "VcallPending": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "blob": {
                  "type": "string"
                },
                "expires": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          }
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Missing/invalid Bearer OR missing/invalid HMAC signature. WWW-Authenticate: Bearer realm=\"codeb-admin\".",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Authenticated but insufficient privileges (e.g. admin op requiring superuser).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimited": {
        "description": "429 Too Many Requests. Public endpoints have per-IP rate limits; retry after the interval in Retry-After.",
        "headers": {
          "Retry-After": {
            "schema": {
              "type": "integer"
            },
            "description": "seconds"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  },
  "security": [],
  "paths": {
    "/rqes/csc/v2/info": {
      "post": {
        "tags": [
          "csc-rqes"
        ],
        "operationId": "cscRqesInfo",
        "summary": "CSC v2 service metadata for EU wallets (GET also accepted)",
        "description": "Publishes the OAuth 2.0 base URI (oauth2) of the remote-signing authorization server, the supported methods (credentials/list, credentials/info, signatures/signHash, signatures/timestamp), PAdES B-B / B-T, and self_service. Any HTTP method is answered; a body is ignored. The classic /csc/v2/info is unchanged. Rate limit: 30 requests per minute per IP.",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "security": [],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "lang": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Service metadata",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/CscRqesInfo"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "methods": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "examples": [
                            [
                              "credentials/list",
                              "credentials/info",
                              "signatures/signHash",
                              "signatures/timestamp"
                            ]
                          ]
                        },
                        "conformance_levels": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "Ades-B-B",
                              "Ades-B-T"
                            ]
                          }
                        },
                        "self_service": {
                          "type": "boolean",
                          "description": "true when the operator lets people create a guest account from the wallet; false hides that option in the wallet."
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "https_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          }
        },
        "x-codeb-audience": "wallet"
      },
      "get": {
        "tags": [
          "csc-rqes"
        ],
        "operationId": "cscRqesInfoGet",
        "summary": "CSC v2 service metadata for EU wallets (GET)",
        "description": "Publishes the OAuth 2.0 base URI (oauth2) of the remote-signing authorization server, the supported methods (credentials/list, credentials/info, signatures/signHash, signatures/timestamp), PAdES B-B / B-T, and self_service. Any HTTP method is answered; a body is ignored. The classic /csc/v2/info is unchanged. Rate limit: 30 requests per minute per IP.",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Service metadata",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/CscRqesInfo"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "methods": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "examples": [
                            [
                              "credentials/list",
                              "credentials/info",
                              "signatures/signHash",
                              "signatures/timestamp"
                            ]
                          ]
                        },
                        "conformance_levels": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "Ades-B-B",
                              "Ades-B-T"
                            ]
                          }
                        },
                        "self_service": {
                          "type": "boolean",
                          "description": "true when the operator lets people create a guest account from the wallet; false hides that option in the wallet."
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "https_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          }
        },
        "x-codeb-audience": "wallet"
      }
    },
    "/rqes/csc/v2/credentials/list": {
      "post": {
        "tags": [
          "csc-rqes"
        ],
        "operationId": "cscRqesCredentialsList",
        "summary": "List the signed-in user's signing credential",
        "description": "Returns the caller's credential id; with credentialInfo=true also credentialInfos[] in the CSC v2 shape (certificates none/single/chain). Accepts the service or credential token from /csc/rqes/oauth2/token, or an OIDC access token of the tenant.",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "security": [
          {
            "cscServiceToken": []
          },
          {
            "cscCredentialToken": []
          },
          {
            "oidcBearer": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "credentialInfo": {
                    "type": "boolean",
                    "description": "true adds credentialInfos[]"
                  },
                  "certificates": {
                    "type": "string",
                    "enum": [
                      "none",
                      "single",
                      "chain"
                    ],
                    "default": "single"
                  },
                  "certInfo": {
                    "type": "boolean"
                  },
                  "authInfo": {
                    "type": "boolean"
                  },
                  "onlyValid": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Credential ids (and details when credentialInfo=true)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "credentialIDs": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "credentialInfos": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CscRqesCredentialInfo"
                      }
                    }
                  },
                  "required": [
                    "credentialIDs"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "invalid_token: missing or invalid access token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                },
                "description": "Bearer realm=\"codeb-csc\""
              }
            }
          },
          "403": {
            "description": "https_required, or access_denied: the account was deleted (no token of a deleted guest account reaches any CSC action)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "413": {
            "description": "body_too_large (over 32 KB)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited: more than 30 requests per minute per IP for this action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "500": {
            "description": "server_error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "501": {
            "description": "crypto_module_not_configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          }
        },
        "x-codeb-audience": "wallet"
      }
    },
    "/rqes/csc/v2/credentials/info": {
      "post": {
        "tags": [
          "csc-rqes"
        ],
        "operationId": "cscRqesCredentialsInfo",
        "summary": "Details of one signing credential (CSC v2 shape)",
        "description": "Key, certificate (certificates=chain adds the issuer certificate), auth mode oauth2code, SCAL 2 and multisign 10.",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "security": [
          {
            "cscServiceToken": []
          },
          {
            "cscCredentialToken": []
          },
          {
            "oidcBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "credentialID": {
                    "type": "string"
                  },
                  "certificates": {
                    "type": "string",
                    "enum": [
                      "none",
                      "single",
                      "chain"
                    ]
                  }
                },
                "required": [
                  "credentialID"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Credential details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesCredentialInfo"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request: invalid_json, credentialID_required, malformed_credentialID, credentialID_unknown",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "401": {
            "description": "invalid_token: missing or invalid access token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                },
                "description": "Bearer realm=\"codeb-csc\""
              }
            }
          },
          "403": {
            "description": "https_required, or access_denied: the account was deleted (no token of a deleted guest account reaches any CSC action)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "413": {
            "description": "body_too_large (over 32 KB)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited: more than 30 requests per minute per IP for this action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "500": {
            "description": "server_error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "501": {
            "description": "crypto_module_not_configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          }
        },
        "x-codeb-audience": "wallet"
      }
    },
    "/rqes/csc/v2/signatures/signHash": {
      "post": {
        "tags": [
          "csc-rqes"
        ],
        "operationId": "cscRqesSignHash",
        "summary": "Sign document hashes with a credential-scope token (no SAD)",
        "description": "Every hash must be one of the hashes the user confirmed for this token; each confirmed hash can be signed once and the token covers numSignatures signatures in total. signAlgo defaults to the key's own algorithm and must fit the key type. ECDSA signatures are returned DER-encoded (Ecdsa-Sig-Value), ready for CMS / PAdES. Field names hashes / hashAlgorithmOID (CSC v2) and hash / hashAlgo are both accepted. A SAD from the classic flow is still accepted with an OIDC bearer. Guest accounts may sign at most 5 documents per UTC day across signHash, signDoc and signDocBasic (each hash counts); signing as an invited signer of someone else's sign-request.html request is given back. Nothing is charged when signing fails.",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "security": [
          {
            "cscCredentialToken": []
          },
          {
            "oidcBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "credentialID": {
                    "type": "string"
                  },
                  "hashes": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "contentEncoding": "base64"
                    },
                    "description": "SHA-256 hashes (base64 or base64url); alias: hash"
                  },
                  "hashAlgorithmOID": {
                    "type": "string",
                    "const": "2.16.840.1.101.3.4.2.1",
                    "description": "alias: hashAlgo"
                  },
                  "signAlgo": {
                    "type": "string",
                    "examples": [
                      "1.2.840.10045.4.3.2"
                    ]
                  },
                  "signAlgoParams": {
                    "type": "string"
                  },
                  "operationMode": {
                    "type": "string",
                    "const": "S"
                  },
                  "SAD": {
                    "type": "string",
                    "description": "Only with an OIDC bearer (classic flow)"
                  }
                },
                "required": [
                  "credentialID",
                  "hashes"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "One base64 signature per hash, in request order",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "signatures": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "contentEncoding": "base64"
                      }
                    }
                  },
                  "required": [
                    "signatures"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request: credentialID does not match the authorization, hashes_required, only_sha256_supported, hash_must_be_sha256_32bytes, hash was not authorized for this token, signAlgo does not fit the credential key, hash already signed with this authorization or no signatures left, credentialID_unknown",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid token, or a service token (WWW-Authenticate: error=\"insufficient_scope\", scope=\"credential\")",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                },
                "description": "Bearer realm=\"codeb-csc\""
              }
            }
          },
          "403": {
            "description": "https_required, or access_denied: the account was deleted (no token of a deleted guest account reaches any CSC action)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "413": {
            "description": "body_too_large (over 32 KB)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (30 per minute per IP), or quota_exceeded: a guest account reached its daily limit; Retry-After = seconds until 00:00 UTC. error_description says how many signatures are left today.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "500": {
            "description": "server_error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "501": {
            "description": "crypto_module_not_configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable: the guest limit could not be checked, signing is refused (Retry-After 60)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          }
        },
        "x-codeb-audience": "wallet"
      }
    },
    "/csc/rqes/oauth2/pushed_authorize": {
      "post": {
        "tags": [
          "csc-rqes"
        ],
        "operationId": "cscRqesPar",
        "summary": "Pushed authorization request (RFC 9126)",
        "security": [
          {
            "cscClientBasic": []
          },
          {}
        ],
        "description": "Same parameters as the authorization endpoint, as form fields. Client authentication is optional here (checked at the token endpoint).",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "response_type": {
                    "type": "string",
                    "description": "Must be code."
                  },
                  "client_id": {
                    "type": "string",
                    "description": "Registered client id."
                  },
                  "redirect_uri": {
                    "type": "string",
                    "description": "Registered redirect URI, e.g. rqes://oauth/callback. May be omitted when the client has exactly one."
                  },
                  "scope": {
                    "type": "string",
                    "description": "service or credential (CSC v2 section 8.4)."
                  },
                  "state": {
                    "type": "string",
                    "description": "Opaque client state, returned unchanged."
                  },
                  "code_challenge": {
                    "type": "string",
                    "description": "PKCE S256 challenge (required)."
                  },
                  "code_challenge_method": {
                    "type": "string",
                    "description": "Must be S256."
                  },
                  "prompt": {
                    "type": "string",
                    "description": "login forces a fresh sign-in."
                  },
                  "credentialID": {
                    "type": "string",
                    "description": "scope=credential: the credential to authorize."
                  },
                  "numSignatures": {
                    "type": "integer",
                    "description": "scope=credential: number of signatures, 1-10, equal to the number of hashes."
                  },
                  "hashes": {
                    "type": "string",
                    "description": "scope=credential: comma-separated SHA-256 document hashes (base64url; base64 and URL-encoded base64 accepted)."
                  },
                  "hashAlgorithmOID": {
                    "type": "string",
                    "description": "scope=credential: 2.16.840.1.101.3.4.2.1 (SHA-256)."
                  },
                  "authorization_details": {
                    "type": "string",
                    "description": "Alternative to the credential parameters: RFC 9396 JSON array with one entry of type credential (credentialID, numSignatures, hashAlgorithmOID, documentDigests[{hash,label}])."
                  }
                },
                "required": [
                  "response_type",
                  "client_id",
                  "code_challenge",
                  "code_challenge_method"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "request_uri, single use, valid 60 s",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "request_uri": {
                      "type": "string"
                    },
                    "expires_in": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "401": {
            "description": "Wrong client credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          }
        }
      }
    },
    "/csc/rqes/oauth2/authorize": {
      "get": {
        "tags": [
          "csc-rqes"
        ],
        "operationId": "cscRqesAuthorize",
        "summary": "Authorization endpoint (browser)",
        "description": "The user signs in with the tenant's own sign-in (password, passkey or EU wallet), then confirms on a consent page: for scope=credential the page lists the credential and the documents' SHA-256 fingerprints. Afterwards the browser is redirected to redirect_uri with code (single use, 60 s) and state, or with error=access_denied.",
        "parameters": [
          {
            "name": "response_type",
            "in": "query",
            "required": true,
            "description": "Must be code.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "client_id",
            "in": "query",
            "required": true,
            "description": "Registered client id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "redirect_uri",
            "in": "query",
            "required": false,
            "description": "Registered redirect URI, e.g. rqes://oauth/callback. May be omitted when the client has exactly one.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "description": "service or credential (CSC v2 section 8.4).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "Opaque client state, returned unchanged.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code_challenge",
            "in": "query",
            "required": false,
            "description": "PKCE S256 challenge (required).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code_challenge_method",
            "in": "query",
            "required": false,
            "description": "Must be S256.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "prompt",
            "in": "query",
            "required": false,
            "description": "login forces a fresh sign-in.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "request_uri",
            "in": "query",
            "required": false,
            "description": "urn:ietf:params:oauth:request_uri:... from pushed_authorize; then only client_id (and state) are needed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "credentialID",
            "in": "query",
            "required": false,
            "description": "scope=credential: the credential to authorize.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "numSignatures",
            "in": "query",
            "required": false,
            "description": "scope=credential: number of signatures, 1-10, equal to the number of hashes.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "hashes",
            "in": "query",
            "required": false,
            "description": "scope=credential: comma-separated SHA-256 document hashes (base64url; base64 and URL-encoded base64 accepted).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hashAlgorithmOID",
            "in": "query",
            "required": false,
            "description": "scope=credential: 2.16.840.1.101.3.4.2.1 (SHA-256).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "authorization_details",
            "in": "query",
            "required": false,
            "description": "Alternative to the credential parameters: RFC 9396 JSON array with one entry of type credential (credentialID, numSignatures, hashAlgorithmOID, documentDigests[{hash,label}]).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to the sign-in, then to redirect_uri?code=...&state=... (or ?error=...)"
          },
          "400": {
            "description": "HTML error page (unknown client or redirect_uri, expired request)"
          }
        }
      },
      "post": {
        "tags": [
          "csc-rqes"
        ],
        "operationId": "cscRqesConsentSubmit",
        "summary": "Submit the signing consent page (browser form post)",
        "description": "Posted by the consent page that GET /csc/rqes/oauth2/authorize shows after the sign-in (scope=credential). Requires the per-flow consent cookie and the matching csrf field. decision=approve redirects to redirect_uri with code (single use, 60 s); anything else, a CSRF mismatch, or an approval more than 5 minutes after the sign-in redirects with error=access_denied and a short error_description. Not called by API clients directly.",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "consent_id": {
                    "type": "string",
                    "maxLength": 64,
                    "pattern": "^[A-Za-z0-9_-]+$"
                  },
                  "csrf": {
                    "type": "string"
                  },
                  "decision": {
                    "type": "string",
                    "enum": [
                      "approve",
                      "deny"
                    ]
                  }
                },
                "required": [
                  "consent_id",
                  "csrf",
                  "decision"
                ]
              }
            }
          }
        },
        "responses": {
          "302": {
            "description": "Redirect to redirect_uri with code and state, or error=access_denied"
          },
          "400": {
            "description": "HTML error page (invalid or expired request, already answered)",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "slow_down: more than 60 requests per minute per IP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          }
        },
        "x-codeb-audience": "signed-in"
      }
    },
    "/csc/rqes/oauth2/token": {
      "post": {
        "tags": [
          "csc-rqes"
        ],
        "operationId": "cscRqesToken",
        "summary": "Token endpoint (authorization_code + PKCE)",
        "security": [
          {
            "cscClientBasic": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "grant_type": {
                    "type": "string",
                    "const": "authorization_code"
                  },
                  "code": {
                    "type": "string"
                  },
                  "redirect_uri": {
                    "type": "string"
                  },
                  "code_verifier": {
                    "type": "string"
                  },
                  "client_id": {
                    "type": "string"
                  },
                  "client_secret": {
                    "type": "string",
                    "description": "client_secret_post"
                  }
                },
                "required": [
                  "grant_type",
                  "code",
                  "code_verifier"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Access token (service: 1 h; credential: 5 min, bound to credentialID + hashes)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesTokenResponse"
                }
              }
            }
          },
          "400": {
            "description": "invalid_grant / unsupported_grant_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "401": {
            "description": "invalid_client",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          }
        }
      }
    },
    "/csc/rqes/revoke": {
      "post": {
        "tags": [
          "csc-rqes"
        ],
        "operationId": "cscRqesRevoke",
        "summary": "Token revocation (RFC 7009)",
        "security": [
          {
            "cscClientBasic": []
          },
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string"
                  }
                },
                "required": [
                  "token"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Revoked (also returned for unknown tokens)"
          }
        }
      }
    },
    "/.well-known/openid-configuration": {
      "get": {
        "tags": [
          "well-known",
          "oidc-op"
        ],
        "operationId": "getDiscovery",
        "summary": "OIDC discovery document (alias: /oauth2/v1/.well-known/openid-configuration + /oidc.ashx?action=discovery)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OidcDiscovery"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/jwks.json": {
      "get": {
        "tags": [
          "well-known",
          "oidc-op"
        ],
        "operationId": "getJwks",
        "summary": "JWKS (alias: /oauth2/v1/keys + /oidc.ashx?action=jwks)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Jwks"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/openid-federation": {
      "get": {
        "tags": [
          "well-known",
          "oidc-federation"
        ],
        "operationId": "getFederationEntity",
        "summary": "OpenID Federation 1.0 §3.1 entity statement (alias: /oidc.ashx?action=federation-entity)",
        "responses": {
          "200": {
            "description": "Signed ES256 entity statement JWT",
            "content": {
              "application/entity-statement+jwt": {
                "schema": {
                  "$ref": "#/components/schemas/EntityStatementJwt"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/eudiw-verifier-metadata": {
      "get": {
        "tags": [
          "well-known",
          "eu-wallet-verifier"
        ],
        "operationId": "getVerifierMetadata",
        "summary": "EUDI verifier metadata (alias .json)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/openid-credential-issuer": {
      "get": {
        "tags": [
          "well-known",
          "eu-wallet-issuer"
        ],
        "operationId": "getIssuerMetadata",
        "summary": "OpenID4VCI credential issuer metadata (alias: /vci.ashx?metadata)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              },
              "application/jwt": {
                "schema": {
                  "type": "string",
                  "description": "compact JWS"
                }
              }
            }
          },
          "406": {
            "description": "signed_metadata_unavailable: application/jwt was asked for but this issuer has no access certificate to sign with. Only when the Accept header does not also list application/json (or */*); otherwise the JSON metadata is returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Content negotiation: Accept: application/jwt (preferred over JSON) returns the metadata as one compact JWS, Content-Type application/jwt, header typ openidvci-issuer-metadata+jwt, signed with this site's issuer access certificate (x5c [leaf, CA]); never with the credential-signing key. That certificate comes from a registrar's access-certificate CA or from this site's own CA (POST /wrpac-ca.ashx?issue-own-issuer). If JWT was asked for but no access certificate is installed (or signed metadata is switched off with Vci:SignedMetadataEnabled), the answer is 406 {\"error\":\"signed_metadata_unavailable\"}, never unsigned JSON: a wallet should repeat the request without application/jwt. Vary: Accept. Only the application/jwt answer is signed with the access certificate; the JSON answer's embedded signed_metadata claim is unchanged."
      }
    },
    "/.well-known/openid-credential-issuer/jwks": {
      "get": {
        "tags": [
          "well-known",
          "eu-wallet-issuer"
        ],
        "operationId": "getIssuerJwks",
        "summary": "OpenID4VCI issuer JWKS (alias: /vci.ashx?jwks)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Jwks"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/openapi.json": {
      "get": {
        "tags": [
          "well-known"
        ],
        "operationId": "getOpenapi",
        "summary": "This document — machine-readable API spec (alias: /openapi.json)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/dnt-policy.txt": {
      "get": {
        "tags": [
          "well-known"
        ],
        "operationId": "getDntPolicy",
        "summary": "Do Not Track compliance policy",
        "description": "Plain-text statement that the site does no visitor tracking (no third-party analytics, advertising, social widgets, tag managers or fingerprinting), so DNT: 1 and Sec-GPC: 1 are honoured by default. Normally served as a static file; when that file is absent the request is answered by dnt-policy.ashx, which writes the request host into the title and scope lines and adds the `Tk: N` header. Anonymous.",
        "security": [],
        "x-codeb-audience": "public",
        "responses": {
          "200": {
            "description": "Do Not Track policy text with the request host substituted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "X-Build-Version": {
                "description": "Handler build slug (changes with every behaviour change).",
                "schema": {
                  "type": "string"
                }
              },
              "X-Tenant": {
                "description": "Request host as parsed.",
                "schema": {
                  "type": "string"
                }
              },
              "Tk": {
                "description": "Tracking status: always N (not tracking).",
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "description": "public, max-age=3600",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ]
      }
    },
    "/.well-known/traffic-advice": {
      "get": {
        "tags": [
          "well-known"
        ],
        "operationId": "getTrafficAdvice",
        "summary": "Private prefetch-proxy traffic advice",
        "description": "Static, host-independent opt-in for privacy-preserving prefetch proxies: `[{\"user_agent\":\"prefetch-proxy\",\"fraction\":1.0}]`. GET and HEAD only (HEAD returns the headers with Content-Length). Cache-Control: public, max-age=86400. Served by traffic-advice.ashx through a URL rewrite.",
        "security": [],
        "x-codeb-audience": "public",
        "responses": {
          "200": {
            "description": "Traffic advice",
            "content": {
              "application/trafficadvice+json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "user_agent": {
                        "const": "prefetch-proxy"
                      },
                      "fraction": {
                        "type": "number",
                        "const": 1.0
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "X-Build-Version": {
                "description": "Handler build slug (changes with every behaviour change).",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "description": "Method other than GET or HEAD (Allow: GET, HEAD)",
            "headers": {
              "Allow": {
                "description": "GET, HEAD",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ]
      },
      "head": {
        "tags": [
          "well-known"
        ],
        "operationId": "headTrafficAdvice",
        "summary": "Traffic advice headers only",
        "security": [],
        "x-codeb-audience": "public",
        "responses": {
          "200": {
            "description": "Headers of the GET response, no body"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ]
      }
    },
    "/oauth2/v1/authorize": {
      "get": {
        "tags": [
          "oidc-op"
        ],
        "operationId": "authorize",
        "summary": "Authorization endpoint (RFC 6749 §3.1). Aliases: /oidc.ashx?action=authorize.",
        "parameters": [
          {
            "name": "response_type",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "code",
                "id_token",
                "code id_token"
              ]
            }
          },
          {
            "name": "client_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "redirect_uri",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "openid + optional profile/email/offline_access/network_access"
            }
          },
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "nonce",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "prompt",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "none",
                "login",
                "consent",
                "select_account"
              ]
            }
          },
          {
            "name": "code_challenge",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code_challenge_method",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "S256",
                "plain"
              ]
            }
          },
          {
            "name": "request",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "Signed JWT request object (RFC 9101). Merged with query params — query wins on conflict."
            }
          },
          {
            "name": "id_token_hint",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "max_age",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to redirect_uri (with code|error) OR to /login.html (session bootstrap)."
          },
          "400": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "description": "[EIDCARD-SIGNIN] acr_values=urn:codeb:acr:eidcard sends the user to the eID card sign-in page (loginidcard.html); the ID token then carries acr urn:codeb:acr:eidcard and amr [\"sc\",\"pop\"]."
      },
      "post": {
        "tags": [
          "oidc-op"
        ],
        "operationId": "authorizePost",
        "summary": "Same as GET /authorize but form-encoded",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "302": {
            "description": "Redirect (see GET)"
          }
        }
      }
    },
    "/oauth2/v1/token": {
      "post": {
        "tags": [
          "oidc-op"
        ],
        "operationId": "token",
        "summary": "Token endpoint (RFC 6749 §3.2) — supports authorization_code, refresh_token, client_credentials, RFC 7523 jwt-bearer, urn:ietf:params:oauth:grant-type:pre-authorized_code (OID4VCI), urn:openid:params:grant-type:ciba (OpenID CIBA, agent clients). Alias: /oidc.ashx?action=token.",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "grant_type"
                ],
                "properties": {
                  "grant_type": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  },
                  "redirect_uri": {
                    "type": "string"
                  },
                  "code_verifier": {
                    "type": "string"
                  },
                  "refresh_token": {
                    "type": "string"
                  },
                  "assertion": {
                    "type": "string"
                  },
                  "pre-authorized_code": {
                    "type": "string"
                  },
                  "auth_req_id": {
                    "type": "string",
                    "description": "CIBA: the id from bc-authorize (grant_type=urn:openid:params:grant-type:ciba, client authentication of the agent)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Access + optionally id + refresh tokens",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "description": "CIBA (poll mode): until the person decides the answer is 400 authorization_pending; polling faster than interval gives slow_down (interval +5 s); then access_denied, expired_token, or 200 with access_token (1 hour, aud = the agent client, scope sign_requests, act.sub = the agent, role agent - guest for a guest account -, no auth_time) and id_token; no refresh_token. The auth_req_id can be redeemed once. A token of an agent is accepted only by the signing requests API and the MCP server; every other endpoint (including userinfo and token introspection without resource=sign_requests) treats it as invalid, and it stops working within a minute after the person removes the agent."
      }
    },
    "/oauth2/v1/userinfo": {
      "get": {
        "tags": [
          "oidc-op"
        ],
        "operationId": "userinfo",
        "summary": "Userinfo endpoint (OIDC Core 5.3). Alias: /oidc.ashx?action=userinfo.",
        "description": "Returns the claims of the access token's subject. Bearer in the Authorization header, or `access_token` in a form-encoded POST body (max 8 KB). ID tokens are refused; revoked access tokens are refused. role and groups are included when the scope contains profile or groups; profile claims follow the granted scopes; verified EU Wallet claims are merged per the client's wallet-claim policy. Cache-Control: no-store.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "responses": {
          "200": {
            "description": "Claims",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sub": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "sub"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "tags": [
          "oidc-op"
        ],
        "operationId": "userinfoPost",
        "summary": "Userinfo endpoint, form-encoded POST variant (access_token in body)",
        "description": "Same as GET; the token may be sent as `access_token` in an application/x-www-form-urlencoded body of at most 8 KB instead of the Authorization header.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "requestBody": {
          "required": false,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "access_token": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Claims",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sub": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "sub"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/oauth2/v1/logout": {
      "get": {
        "tags": [
          "oidc-op"
        ],
        "operationId": "endSession",
        "summary": "End Session (RP-Initiated Logout 1.0). Alias: /oidc.ashx?action=end_session.",
        "description": "Returns a small HTML page that sends Clear-Site-Data, removes the site's sign-in storage and navigates to post_logout_redirect_uri when it is registered for client_id (otherwise to a sanitised same-site URL or /login.html).",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "post_logout_redirect_uri",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "client_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sign-out page",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/oauth2/v1/revoke": {
      "post": {
        "tags": [
          "oidc-op"
        ],
        "operationId": "revoke",
        "summary": "Token revocation (RFC 7009). Alias: /oidc.ashx?action=revoke.",
        "description": "Revokes a refresh token (or records an access token jti as revoked). Confidential clients must authenticate with client_id + client_secret in the form body. Always answers {} for unknown tokens (RFC 7009).",
        "security": [],
        "x-codeb-audience": "public",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string"
                  },
                  "token_type_hint": {
                    "type": "string",
                    "enum": [
                      "refresh_token",
                      "access_token"
                    ]
                  },
                  "client_id": {
                    "type": "string"
                  },
                  "client_secret": {
                    "type": "string"
                  }
                },
                "required": [
                  "token"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Revoked or unknown",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request (token required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "invalid_client",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "method_not_allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oauth2/v1/introspect": {
      "post": {
        "tags": [
          "oidc-op"
        ],
        "operationId": "introspect",
        "summary": "Token introspection (RFC 7662). Alias: /oidc.ashx?action=introspect.",
        "description": "Returns active plus the token's claims (scope, client_id, username, token_type, exp, iat, nbf, sub, aud, iss, jti, role) for refresh tokens and JWT access/ID tokens of this tenant; {active:false} otherwise. Confidential clients authenticate with client_id + client_secret in the form body.",
        "security": [],
        "x-codeb-audience": "public",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string"
                  },
                  "token_type_hint": {
                    "type": "string"
                  },
                  "client_id": {
                    "type": "string"
                  },
                  "client_secret": {
                    "type": "string"
                  }
                },
                "required": [
                  "token"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Introspection",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "active": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "active"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "invalid_client",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "method_not_allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=vp-start": {
      "get": {
        "tags": [
          "eu-wallet-verifier"
        ],
        "operationId": "vpStart",
        "summary": "Start an OpenID4VP session (creates request_uri + openid4vp:// deep link for the wallet).",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "vp-start"
              ]
            }
          },
          {
            "name": "preset",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "Named DCQL preset (e.g. 'pid-basic', 'age-over-18', 'network_access-hotel-guest')"
            }
          },
          {
            "name": "client_id_prefix",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "x509_hash",
                "x509_san_dns"
              ],
              "default": "x509_hash"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "openid or openid network_access — network_access triggers signed NetworkConfig issuance on successful presentation"
            }
          },
          {
            "name": "network_profile",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "Named profile from network-policies.json when scope includes network_access"
            }
          },
          {
            "name": "query",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "login",
              "description": "DCQL query: login (EU Wallet PID as SD-JWT or ISO mdoc in one request; the wallet offers whichever it holds; also used with link=1), login-sdjwt (the PID as SD-JWT only), login-pid-any (same as login), login-card (the PID in either format or the CodeB sign-in card in one request; the wallet offers whichever it holds; not with link=1), signin-card (only the CodeB sign-in card), aloaha-identity, aloaha-age. The sign-in card proves possession of the card, not who the person is. age-av (alias age-verify-av): only the EU proof-of-age attestation (ISO mdoc, doctype eu.europa.ec.av.1, element age_over_18 alone, intent_to_retain false); such a session never signs anyone in - vp-response returns only the age result; any other document is refused (400 invalid_presentation). sca (EUDI ARF TS12 payment / SCA confirmation with an SCA attestation: needs vct and transaction_data; signs nobody in)."
            }
          },
          {
            "name": "registrar",
            "in": "query",
            "required": false,
            "description": "Which access certificate signs this session's request object: eu = EU reference registry certificate, de = German registrar certificate, codeb = this site's own access-certificate CA (wrpac-ca.ashx; test and private use, wallets must trust that CA). Empty = tenant default.",
            "schema": {
              "type": "string",
              "enum": [
                "eu",
                "de",
                "codeb"
              ]
            }
          },
          {
            "name": "vct",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 256,
              "description": "query=sca only: type (vct) of the SCA attestation to request, https URL or urn."
            }
          },
          {
            "name": "claims",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "query=sca only: card attributes to disclose, comma separated (a-z, 0-9, _; at most 10)."
            }
          },
          {
            "name": "transaction_data",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "OpenID4VP 1.0 transaction_data: base64url of a JSON array of 1-16 base64url-encoded entries {type, credential_ids, ...}. Entries with a payload are EUDI ARF TS12 entries: type urn:eudi:sca:payment:1 | urn:eudi:sca:login_risk_transaction:1 | urn:eudi:sca:account_access:1 | urn:eudi:sca:emandate:1 (or a type mapped onto one of them per tenant), transaction_data_hashes_alg must include sha-256, credential_ids must name SD-JWT VC queries of the request, payload valid against the TS12 data model. The wallet must return transaction_data_hashes (SHA-256 of each entry string) in its KB-JWT; TS12 entries also need jti (single use, the authentication code), amr (two factor categories) and response_mode. Errors: 400 invalid_request 'transaction_data invalid: ts12_<reason>'."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Session created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VpStartResponse"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=vp-request": {
      "get": {
        "tags": [
          "eu-wallet-verifier"
        ],
        "operationId": "vpRequest",
        "summary": "Retrieve the signed Authorization Request JWT (JAR).",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "vp-request"
              ]
            }
          },
          {
            "name": "session_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Signed JAR",
            "content": {
              "application/oauth-authz-req+jwt": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=vp-response": {
      "post": {
        "tags": [
          "eu-wallet-verifier"
        ],
        "operationId": "vpResponse",
        "summary": "Wallet POSTs its verifiable presentation here (direct_post or direct_post.jwt). The vp_token is auto-detected: SD-JWT VC compact serialization or mDoc CBOR (routed to MDocVerifier.Verify when the body starts with a CBOR map header 0xA0-0xBB). mDoc verification requires trust anchors under App_Data/<tenant>/trust/mdoc-issuers/*.cer; missing directory returns HTTP 501 mdoc_verify_not_configured. Response includes NetworkConfig when scope=network_access was requested.",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object"
              }
            },
            "application/jose": {
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verified",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VpResponseResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "description": "mdoc_verify_not_configured -- add issuer certs under App_Data/<tenant>/trust/mdoc-issuers/ to enable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "eu-wallet-verifier"
        ],
        "operationId": "vpResponsePoll",
        "summary": "Poll an OpenID4VP session from the browser that started it (vp_bind cookie).",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "vp-response"
              ]
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Completed. For sessions that sent transaction_data the body also has transaction_data: {verified, hashes_alg, hashes, types, transaction_ids, sca: {authentication_code, amr, kb_iat}}. A query=sca session signs nobody in: user is empty, claims holds only the requested card attributes, vct and test_credential.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "completed"
                      ]
                    },
                    "claims": {
                      "type": "object"
                    },
                    "transaction_data": {
                      "type": "object",
                      "properties": {
                        "verified": {
                          "type": "boolean"
                        },
                        "hashes_alg": {
                          "type": "string"
                        },
                        "hashes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "types": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "transaction_ids": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "sca": {
                          "type": "object",
                          "properties": {
                            "authentication_code": {
                              "type": "string"
                            },
                            "amr": {
                              "type": "array",
                              "items": {
                                "type": "object"
                              }
                            },
                            "kb_iat": {
                              "type": "integer"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "Still waiting for the wallet (status pending | delivered)."
          },
          "401": {
            "description": "same_device_binding_failed: the polling browser does not hold the vp_bind cookie."
          },
          "403": {
            "description": "transaction_data_not_confirmed: the session sent transaction_data and the wallet did not confirm it."
          }
        }
      }
    },
    "/oidc.ashx?action=network-config": {
      "get": {
        "tags": [
          "network-access"
        ],
        "operationId": "networkConfig",
        "summary": "Retrieve the signed NetworkConfig for a completed network_access session (idempotent, cacheable until config.expires_at).",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "network-config"
              ]
            }
          },
          {
            "name": "session_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NetworkConfig"
                }
              }
            }
          },
          "404": {
            "description": "Unknown or expired session"
          }
        }
      }
    },
    "/vci.ashx?metadata": {
      "get": {
        "tags": [
          "eu-wallet-issuer"
        ],
        "operationId": "issuerMetadata",
        "summary": "OpenID4VCI credential issuer metadata (alias /.well-known/openid-credential-issuer). Advertises authorization_endpoint, pushed_authorization_request_endpoint, grant_types_supported (both authorization_code and urn:ietf:params:oauth:grant-type:pre-authorized_code), code_challenge_methods_supported=[S256], response_types_supported=[code], and token_endpoint_auth_methods_supported=[none] (public client, PKCE mandatory).",
        "parameters": [
          {
            "name": "metadata",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              },
              "application/jwt": {
                "schema": {
                  "type": "string",
                  "description": "compact JWS"
                }
              }
            }
          },
          "406": {
            "description": "signed_metadata_unavailable: application/jwt was asked for but this issuer has no access certificate to sign with",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Content negotiation: Accept: application/jwt (preferred over JSON) returns the metadata as one compact JWS, Content-Type application/jwt, header typ openidvci-issuer-metadata+jwt, signed with this site's issuer access certificate (x5c [leaf, CA]); never with the credential-signing key. That certificate comes from a registrar's access-certificate CA or from this site's own CA (POST /wrpac-ca.ashx?issue-own-issuer). If JWT was asked for but no access certificate is installed (or signed metadata is switched off with Vci:SignedMetadataEnabled), the answer is 406 {\"error\":\"signed_metadata_unavailable\"}, never unsigned JSON: a wallet should repeat the request without application/jwt. Vary: Accept. Only the application/jwt answer is signed with the access certificate; the JSON answer's embedded signed_metadata claim is unchanged."
      }
    },
    "/vci.ashx?jwks": {
      "get": {
        "tags": [
          "eu-wallet-issuer"
        ],
        "operationId": "issuerJwks",
        "summary": "OpenID4VCI issuer JWKS (alias /.well-known/openid-credential-issuer/jwks).",
        "parameters": [
          {
            "name": "jwks",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Jwks"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?token": {
      "post": {
        "tags": [
          "eu-wallet-issuer"
        ],
        "operationId": "issuerToken",
        "summary": "Token endpoint per OpenID4VCI. Supports both authorization_code (with PKCE) and urn:ietf:params:oauth:grant-type:pre-authorized_code grants.",
        "description": "Also refresh_token (re-issuance). A refresh token stays with the client it was issued to and, if the first token was DPoP-bound, with that DPoP key; when the client presented a wallet attestation, also with that attestation's key (cnf.jwk). One move is allowed: a token issued to the reference Wallet Provider's client (setting Vci:WalletClientSwitchFrom, default eudiw-abca) may be redeemed by codeb-wallet-app with this site's own wallet attestation for the same wallet instance key (or, for older tokens, the same DPoP key). The next refresh token then belongs to codeb-wallet-app. Anything else: 400 invalid_grant (sign in again). [PHOTOID-RETRY] Same-phone retry: a key-bound pre-authorized offer from the identity check (PID, Photo ID) or an administrator's proof-of-age offer whose credentials were never confirmed with credential_accepted can be redeemed again by the same phone (proof of the same bound key) within 15 minutes of its last redemption, at most 3 times; the credentials of the earlier attempt are revoked in the status list, tokens of an earlier attempt are refused at ?credential, and credential_accepted (or the end of the window) closes the offer. [WALLET-REVOKE] A wallet attestation of a revoked wallet instance is refused with 403 wallet_revoked.",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "grant_type"
                ],
                "properties": {
                  "grant_type": {
                    "type": "string",
                    "enum": [
                      "authorization_code",
                      "urn:ietf:params:oauth:grant-type:pre-authorized_code"
                    ]
                  },
                  "code": {
                    "type": "string",
                    "description": "Present when grant_type=authorization_code. Single-use; consumed even on failed exchange."
                  },
                  "redirect_uri": {
                    "type": "string",
                    "description": "Byte-exact match with PAR/authorize value when grant_type=authorization_code."
                  },
                  "code_verifier": {
                    "type": "string",
                    "minLength": 43,
                    "maxLength": 128,
                    "description": "PKCE verifier for authorization_code grant."
                  },
                  "client_id": {
                    "type": "string",
                    "description": "Required for authorization_code; must match the whitelisted client from PAR."
                  },
                  "pre-authorized_code": {
                    "type": "string",
                    "description": "Present when grant_type=urn:ietf:params:oauth:grant-type:pre-authorized_code."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Access token + fresh c_nonce (same shape for both grants).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "access_token",
                    "token_type",
                    "expires_in"
                  ],
                  "properties": {
                    "access_token": {
                      "type": "string"
                    },
                    "token_type": {
                      "type": "string",
                      "enum": [
                        "Bearer"
                      ]
                    },
                    "expires_in": {
                      "type": "integer"
                    },
                    "c_nonce": {
                      "type": "string"
                    },
                    "c_nonce_expires_in": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_grant / invalid_client / invalid_request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "wallet_revoked: the wallet instance was revoked by its holder or the provider",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?credential": {
      "post": {
        "tags": [
          "eu-wallet-issuer"
        ],
        "operationId": "issueCredential",
        "summary": "Issue a credential in the requested format (dc+sd-jwt or mso_mdoc). Rate-limited per source IP.",
        "parameters": [
          {
            "name": "credential",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "credentialAccessToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "title": "SD-JWT VC",
                    "type": "object",
                    "required": [
                      "format",
                      "vct",
                      "proof"
                    ],
                    "properties": {
                      "format": {
                        "type": "string",
                        "enum": [
                          "dc+sd-jwt"
                        ]
                      },
                      "vct": {
                        "type": "string"
                      },
                      "proof": {
                        "type": "object",
                        "required": [
                          "proof_type"
                        ],
                        "properties": {
                          "proof_type": {
                            "type": "string",
                            "enum": [
                              "jwt",
                              "cwt"
                            ]
                          },
                          "jwt": {
                            "type": "string"
                          },
                          "cwt": {
                            "type": "string",
                            "description": "Base64url COSE_Sign1 (RFC 9052) wrapping a CBOR CWT claim set (RFC 8392). Alternative to `jwt`. Wallets MUST send exactly one of `jwt` or `cwt`; sending both is rejected with `invalid_proof`."
                          }
                        }
                      }
                    }
                  },
                  {
                    "title": "mDoc / ISO 18013-5",
                    "type": "object",
                    "required": [
                      "format",
                      "doctype",
                      "proof"
                    ],
                    "properties": {
                      "format": {
                        "type": "string",
                        "enum": [
                          "mso_mdoc"
                        ]
                      },
                      "doctype": {
                        "type": "string",
                        "enum": [
                          "eu.europa.ec.eudi.pid.1"
                        ],
                        "description": "Only EUDI PID supported today; any other doctype returns unsupported_credential_type."
                      },
                      "proof": {
                        "type": "object",
                        "required": [
                          "proof_type"
                        ],
                        "properties": {
                          "proof_type": {
                            "type": "string",
                            "enum": [
                              "jwt",
                              "cwt"
                            ],
                            "description": "cwt returns unsupported_proof_type today."
                          },
                          "jwt": {
                            "type": "string"
                          },
                          "cwt": {
                            "type": "string",
                            "description": "Base64url COSE_Sign1 (RFC 9052) wrapping a CBOR CWT claim set (RFC 8392). Alternative to `jwt`. Wallets MUST send exactly one of `jwt` or `cwt`; sending both is rejected with `invalid_proof`."
                          }
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Credential + format tag. For mso_mdoc, credential is base64url-encoded mDoc bytes (CBOR + COSE_Sign1 issuerAuth).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "credential",
                    "format"
                  ],
                  "properties": {
                    "credential": {
                      "type": "string"
                    },
                    "format": {
                      "type": "string",
                      "enum": [
                        "dc+sd-jwt",
                        "mso_mdoc"
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "description": "[AV-ISSUER] The proof of age (credential_configuration_id eu.europa.ec.av.1) is issued as mso_mdoc only, from a birth date this site read from a passport / ID card chip, to the phone that read the document. [PHOTOID-RETRY] An access token of an earlier collection attempt of the same offer is refused."
      }
    },
    "/vci.ashx?create-offer": {
      "post": {
        "tags": [
          "eu-wallet-issuer"
        ],
        "operationId": "createCredentialOffer",
        "summary": "Create a pre-authorized credential offer for a subject.",
        "parameters": [
          {
            "name": "create-offer",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Offer created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "description": "Administrator. [AV-ISSUER] With vct eu.europa.ec.av.1 it creates a proof-of-age offer (test credential): body {vct: \"eu.europa.ec.av.1\", subject, days 1-30 (default 7)}. The subject's account needs a released passport / ID card check with a birth date read from the chip; the offer is bound to the key of the phone that read the document (only that CodeB Wallet can collect it) and carries test_credential and a note. The credential is an ISO mdoc (doctype and namespace eu.europa.ec.av.1) holding age_over_18 (plus the age_over_NN of the tenant setting Vci:AvAgeOverExtra) and nothing else: no name, no birth date. Validity Vci:AvValidityDays (default 90), never beyond the day a stated value would stop being true; revocable through the status list. 400 invalid_request when the account has no checked birth date or no bound wallet key; 429 rate_limited."
      }
    },
    "/vci.ashx?offer-ref=<handle>": {
      "get": {
        "tags": [
          "eu-wallet-issuer"
        ],
        "operationId": "getCredentialOfferByStoreRef",
        "summary": "Credential offer behind the app store link's handle (rate-limited per IP).",
        "description": "The CodeB Wallet store link (Play Install Referrer) carries this URI as credential_offer_uri instead of the offer itself. One handle per offer, valid at most 7 days and never longer than the offer; it answers again only within 10 minutes of its first use, and a used handle is never issued again. Same response as ?offer=<id>.",
        "responses": {
          "200": {
            "description": "Offer",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Unknown, expired or used handle"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/vci.ashx?offer=<id>": {
      "get": {
        "tags": [
          "eu-wallet-issuer"
        ],
        "operationId": "getCredentialOffer",
        "summary": "Public wallet-facing offer retrieval (rate-limited per IP).",
        "responses": {
          "200": {
            "description": "Offer",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/lotl.ashx?status": {
      "get": {
        "tags": [
          "lotl"
        ],
        "operationId": "lotlStatus",
        "summary": "LOTL cache manifest — freshness, next refresh, anchor count, countries covered.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LotlManifest"
                }
              }
            }
          }
        }
      }
    },
    "/lotl.ashx?anchors": {
      "get": {
        "tags": [
          "lotl"
        ],
        "operationId": "lotlAnchors",
        "summary": "List cached EU trust-list anchors (optionally one country)",
        "description": "Trust anchors from the cached EU List of Trusted Lists; `country` filters by ISO country code. The cache refreshes itself when older than its refresh interval.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "anchors",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "ISO 3166 alpha-2"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "country_filter": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "anchors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/lotl.ashx?anchor=<sha256>": {
      "get": {
        "tags": [
          "lotl"
        ],
        "operationId": "lotlAnchor",
        "summary": "Download one cached trust anchor as PEM",
        "description": "Anchor by SHA-256 (64 hex). Use /oidc.ashx?action=lotl-cert-inspect for a decoded view.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "anchor",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Certificate",
            "content": {
              "application/x-pem-file": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "invalid_anchor_id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/lotl.ashx?refresh": {
      "post": {
        "tags": [
          "lotl"
        ],
        "operationId": "lotlRefresh",
        "summary": "Refresh the EU trust-list cache now",
        "description": "Fetches the LOTL and national lists synchronously; answers already_in_flight when a refresh is running. Auth: OIDC bearer with role admin or superuser (checked by introspection); no HMAC.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "refresh",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/rp-cert.ashx?ca": {
      "get": {
        "tags": [
          "rp-cert"
        ],
        "operationId": "rpCertCa",
        "summary": "Download the tenant's RP CA certificate (PEM or DER)",
        "description": "Public. format=pem (default) or der; served as attachment. The CA is created on first use.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "ca",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pem",
                "der"
              ],
              "default": "pem"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "CA certificate",
            "content": {
              "application/x-pem-file": {
                "schema": {
                  "type": "string"
                }
              },
              "application/pkix-cert": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "500": {
            "description": "ca_missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/rp-cert.ashx?issue": {
      "post": {
        "tags": [
          "rp-cert"
        ],
        "operationId": "rpCertIssue",
        "summary": "Issue an RP verifier certificate for an OIDC client",
        "description": "Mints a leaf certificate under the tenant RP CA for `client_id`; days 1-730 (default 90). The private key is returned only with include_key=true (PFX + password), otherwise discarded. Parameters are query parameters. Auth: OIDC bearer with role admin (checked by introspection).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "issue",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          },
          {
            "name": "client_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 730,
              "default": 90
            }
          },
          {
            "name": "include_key",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Issued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "client_id": {
                      "type": "string"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "cert_pem": {
                      "type": "string"
                    },
                    "ca_pem": {
                      "type": "string"
                    },
                    "expires_utc": {
                      "type": "string"
                    },
                    "days_valid": {
                      "type": "integer"
                    },
                    "pfx_base64": {
                      "type": "string"
                    },
                    "pfx_password": {
                      "type": "string"
                    },
                    "note": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_client_id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "ca_load_failed / mint_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/rp-cert.ashx?list": {
      "get": {
        "tags": [
          "rp-cert"
        ],
        "operationId": "rpCertList",
        "summary": "List issued RP verifier certificates",
        "description": "Up to 500 leaves (subject, issued, expires, serial, thumbprint). Auth: OIDC bearer with role admin.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "list",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "truncated": {
                      "type": "boolean"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "leaves": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?room-info=<code>": {
      "get": {
        "tags": [
          "signaling"
        ],
        "operationId": "signalRoomInfo",
        "summary": "Read the shape of a room (existence, mode, peer count, lock state) without joining. Anonymous, cheap, safe to poll.",
        "description": "Added 2026-09-28. Used by native clients to check whether a room is active before opening a WebSocket. No PII.",
        "parameters": [
          {
            "name": "room-info",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._-]{1,128}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "exists": {
                      "type": "boolean"
                    },
                    "mode": {
                      "type": "string",
                      "enum": [
                        "mesh",
                        "sfu"
                      ]
                    },
                    "peerCount": {
                      "type": "integer"
                    },
                    "locked": {
                      "type": "boolean"
                    },
                    "controlLocked": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?room-create": {
      "post": {
        "tags": [
          "signaling"
        ],
        "operationId": "signalRoomCreate",
        "summary": "Mint a fresh room code (or accept a caller-supplied one) plus, optionally, a short-lived invite JWS.",
        "description": "Added 2026-09-28. Auth: OIDC bearer or ak_ API key.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9._-]{1,128}$"
                  },
                  "mintInvite": {
                    "type": "boolean",
                    "default": false
                  },
                  "inviteExpMin": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1440,
                    "default": 60
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "invite": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "join": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Bearer required"
          },
          "405": {
            "description": "POST required"
          }
        }
      }
    },
    "/signal.ashx?invite-mint": {
      "post": {
        "tags": [
          "signaling"
        ],
        "operationId": "signalInviteMint",
        "summary": "Mint an invite JWS for an existing room. HS256, tenant-scoped, WebPhone:InviteSecret (falls back to AdminSharedSecret).",
        "description": "Added 2026-09-28. Present the returned JWS as ?tok=<jws> on the WS URL.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "room"
                ],
                "properties": {
                  "room": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9._-]{1,128}$"
                  },
                  "sub": {
                    "type": "string"
                  },
                  "expMin": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1440,
                    "default": 60
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "invite": {
                      "type": "string"
                    },
                    "expiresUtc": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "room": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "No signing secret configured on tenant"
          }
        }
      }
    },
    "/signal.ashx?turn-creds": {
      "get": {
        "tags": [
          "signaling"
        ],
        "operationId": "signalTurnCreds",
        "summary": "Fresh ICE server list (STUN + TURN with HMAC-SHA1 REST credentials) outside a WebSocket session.",
        "description": "Added 2026-09-28. Same shape as welcome.iceServers. TTL is WebPhone:TurnTtlSec (default 3600 s).",
        "parameters": [
          {
            "name": "peerId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "iceServers": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "expiresIn": {
                      "type": "integer"
                    },
                    "peerId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?attest-verify&t=<jws>": {
      "get": {
        "tags": [
          "signaling"
        ],
        "operationId": "signalAttestVerify",
        "summary": "Verify an identity-attest JWS minted by the identity-attest WS frame. Short-lived (5 min); public.",
        "description": "Added 2026-09-28. Used by consent dialogs that prefer server-side verification over local HMAC.",
        "parameters": [
          {
            "name": "t",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "payload": {
                      "type": "object"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?whitelist=list": {
      "get": {
        "tags": [
          "sip-admin"
        ],
        "operationId": "whitelistList",
        "summary": "Enumerate PSTN whitelist entries for the calling tenant.",
        "description": "Numbers allowed for outbound PSTN dialling when the whitelist is enforced. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'whitelist-list|<Host>') (AdminSharedSecret must be at least 24 chars).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "whitelist",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "list"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "read failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?whitelist=add": {
      "post": {
        "tags": [
          "sip-admin"
        ],
        "operationId": "whitelistAdd",
        "summary": "Add one PSTN number to whitelist. HMAC bucket: whitelist-add|Host|bodyLen.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "number"
                ],
                "properties": {
                  "number": {
                    "type": "string"
                  },
                  "comment": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/signal.ashx?oidc-clients=1": {
      "get": {
        "tags": [
          "integrations-admin"
        ],
        "operationId": "oidcClientsList",
        "summary": "List the tenant's registered OIDC clients",
        "description": "Clients with redirect URIs and description (secrets are not returned in clear). Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "oidc-clients",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "clients": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "client_id": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "redirect_uris": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "post_logout_redirect_uris": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "additionalProperties": true
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?oidc-clients-save=1": {
      "post": {
        "tags": [
          "integrations-admin"
        ],
        "operationId": "oidcClientsSave",
        "summary": "Create or update a registered OIDC client",
        "description": "client_id: letters, digits, _ - . : (max 128; codeb-admin is reserved). redirect_uris and post_logout_redirect_uris must be https (http only for localhost). secret_mode: regenerate, clear, explicit (client_secret >= 16 chars) or keep (default). Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "oidc-clients-save",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "client_id": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "redirect_uris": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "post_logout_redirect_uris": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "secret_mode": {
                    "type": "string",
                    "enum": [
                      "keep",
                      "regenerate",
                      "clear",
                      "explicit"
                    ]
                  },
                  "client_secret": {
                    "type": "string"
                  }
                },
                "required": [
                  "client_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "client_id": {
                      "type": "string"
                    },
                    "created": {
                      "type": "boolean"
                    },
                    "has_secret": {
                      "type": "boolean"
                    },
                    "client_type": {
                      "type": "string"
                    },
                    "client_secret": {
                      "type": "string",
                      "description": "Only when just generated"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "invalid_client_id, reserved_client_id, invalid_redirect_uri, weak_secret",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?oidc-clients-genkey=1": {
      "get": {
        "tags": [
          "integrations-admin"
        ],
        "operationId": "oidcClientsGenkey",
        "summary": "Generate a random client_secret (shown once)",
        "description": "Returns a freshly generated secret for the client form; nothing is stored until oidc-clients-save. GET only (the handler does not answer POST). Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "oidc-clients-genkey",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "client_secret": {
                      "type": "string"
                    },
                    "length": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?list-vp-events": {
      "get": {
        "tags": [
          "monitoring"
        ],
        "operationId": "listVpEvents",
        "summary": "List recent OpenID4VP verifier events of the tenant",
        "description": "Newest-first vp-* events parsed from the tenant's identity-provider logs; limit 1-10000 (default 500). Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'list-vp-events|<Host>') (AdminSharedSecret must be at least 24 chars).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "list-vp-events",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10000,
              "default": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/chat.ashx?op=me": {
      "get": {
        "tags": [
          "chat"
        ],
        "operationId": "chatMe",
        "summary": "Return the OIDC-clamped identity of the calling chat user.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/chat.ashx?op=list-threads": {
      "get": {
        "tags": [
          "chat"
        ],
        "operationId": "chatListThreads",
        "summary": "List the caller's DM and group threads",
        "description": "Threads sorted by last activity with preview and unread count (up to 200; hasMore when truncated). Invited guests see only their thread. Auth: OIDC bearer, or the signed invite-session cookie set by op=invite-redeem (invited guests are limited to their one thread). Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "list-threads"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "threads": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "enum": [
                              "dm",
                              "group"
                            ]
                          },
                          "pairKey": {
                            "type": "string"
                          },
                          "peerLogin": {
                            "type": "string"
                          },
                          "peerName": {
                            "type": "string"
                          },
                          "groupId": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "participantCount": {
                            "type": "integer"
                          },
                          "lastMessageUtc": {
                            "type": "string"
                          },
                          "lastMessagePreview": {
                            "type": "string"
                          },
                          "unread": {
                            "type": "integer"
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "pageCap": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/chat.ashx?op=send": {
      "post": {
        "tags": [
          "chat"
        ],
        "operationId": "chatSend",
        "summary": "Send a message to a DM peer or a group",
        "description": "Thread by `with` (peer login) or `groupId`. JSON body field is `body` (max 4000 chars); optional replyTo {id, sender, snippet}. Delivered live over the chat WebSocket. 30 messages burst, then 1 per 2 s per user (429 + Retry-After). Auth: OIDC bearer, or the signed invite-session cookie set by op=invite-redeem (invited guests are limited to their one thread). Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "send"
              ]
            }
          },
          {
            "name": "with",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Peer login (DM)"
          },
          {
            "name": "groupId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Group id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "body": {
                    "type": "string",
                    "maxLength": 4000
                  },
                  "replyTo": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "sender": {
                        "type": "string"
                      },
                      "snippet": {
                        "type": "string"
                      }
                    }
                  }
                },
                "required": [
                  "body"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stored",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "id": {
                      "type": "string"
                    },
                    "tsUtcMs": {
                      "type": "integer"
                    },
                    "pairKey": {
                      "type": "string"
                    },
                    "peerLogin": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "bad-peer, self-dm, bad-body, empty-body",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "403": {
            "description": "not-a-participant",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "404": {
            "description": "peer-not-found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "405": {
            "description": "method-not-allowed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "413": {
            "description": "body-too-large",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          }
        }
      }
    },
    "/chat.ashx?op=upload": {
      "post": {
        "tags": [
          "chat"
        ],
        "operationId": "chatUpload",
        "summary": "File transfer (multipart/form-data).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "parameters": [
          {
            "name": "with",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "groupId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/chat.ashx?op=download": {
      "get": {
        "tags": [
          "chat"
        ],
        "operationId": "chatDownload",
        "summary": "Download a file shared in a thread",
        "description": "File by SHA-256; served only when a thread the caller belongs to references it (`with` / `groupId` narrow the check). Auth: OIDC bearer, or the signed invite-session cookie set by op=invite-redeem (invited guests are limited to their one thread). Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "download"
              ]
            }
          },
          {
            "name": "sha",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            },
            "description": "64-hex SHA-256"
          },
          {
            "name": "with",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "groupId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "File",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "bad-sha",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "404": {
            "description": "not-found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/chat-ws.ashx?ticket=<nonce>": {
      "get": {
        "tags": [
          "chat"
        ],
        "operationId": "chatWsUpgrade",
        "summary": "WebSocket upgrade — realtime chat push. Ticket minted via /chat.ashx?op=ws-ticket.",
        "responses": {
          "101": {
            "description": "Switching Protocols (WebSocket)"
          }
        }
      }
    },
    "/chat-widget.ashx?op=probe": {
      "get": {
        "tags": [
          "chat-widget"
        ],
        "operationId": "widgetProbe",
        "summary": "Public 'Chat with us' widget config for the calling origin.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/chat-widget.ashx?op=start-session": {
      "post": {
        "tags": [
          "chat-widget"
        ],
        "operationId": "widgetStart",
        "summary": "Anonymous visitor session (no auth).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/chat-invite.ashx?op=create": {
      "post": {
        "tags": [
          "chat"
        ],
        "operationId": "inviteCreate",
        "summary": "Create a signed chat or meeting invitation link",
        "description": "Mints an HMAC-signed invitation token and hotlink for a thread of a channel. Auth: OIDC bearer (anonymous callers cannot mint). Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "create"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channel": {
                    "type": "string"
                  },
                  "threadKey": {
                    "type": "string"
                  },
                  "inviteeEmail": {
                    "type": "string",
                    "format": "email"
                  },
                  "inviteeDisplayName": {
                    "type": "string"
                  },
                  "scope": {
                    "type": "string",
                    "enum": [
                      "chat",
                      "meeting"
                    ],
                    "default": "chat"
                  }
                },
                "required": [
                  "channel",
                  "threadKey"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Invitation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string"
                    },
                    "hotlink": {
                      "type": "string"
                    },
                    "nonce": {
                      "type": "string"
                    },
                    "expiresUtc": {
                      "type": "string"
                    },
                    "scope": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad-body, missing-channel, missing-thread, bad-scope",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "405": {
            "description": "method-not-allowed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/chat-invite.ashx?op=verify": {
      "get": {
        "tags": [
          "chat"
        ],
        "operationId": "inviteVerify",
        "summary": "Public verification of a chat invite token (single-use, expiry-clamped).",
        "parameters": [
          {
            "name": "t",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/chat-email.ashx?op=list-threads": {
      "get": {
        "tags": [
          "chat-email"
        ],
        "operationId": "emailListThreads",
        "summary": "List e-mail channel threads",
        "description": "Up to 200 threads of the e-mail channel. Auth: OIDC bearer of a tenant admin. Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "list-threads"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "threads": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/pms.ashx?op=list-threads": {
      "get": {
        "tags": [
          "pms"
        ],
        "operationId": "pmsListThreads",
        "summary": "List guest conversations from the property-management portal",
        "description": "Paged list (limit default 200, offset) proxied from the configured portal. Auth: OIDC bearer of a signed-in operator; 60 requests per minute per operator. 503 when the property-management integration is not configured. Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "list-threads"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 200
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "provider": {
                      "type": "string"
                    },
                    "total": {
                      "type": "integer"
                    },
                    "offset": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "conversations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "502": {
            "description": "upstream-error / bad-upstream",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "503": {
            "description": "not-configured",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/pms.ashx?op=reply": {
      "post": {
        "tags": [
          "pms"
        ],
        "operationId": "pmsReply",
        "summary": "Reply to a guest conversation in the property-management portal",
        "description": "Posts the operator's reply to the portal. Body max 8 KB. Auth: OIDC bearer of a signed-in operator; 60 requests per minute per operator. 503 when the property-management integration is not configured. Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "reply"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "conversationId": {
                    "type": "integer"
                  },
                  "body": {
                    "type": "string"
                  }
                },
                "required": [
                  "conversationId",
                  "body"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Portal answer",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "bad-encoding, bad-json, missing-fields",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "405": {
            "description": "method-not-allowed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "413": {
            "description": "body-too-large",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "502": {
            "description": "upstream-error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "503": {
            "description": "not-configured",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/api.ashx/v1": {
      "get": {
        "tags": [
          "v1-rest"
        ],
        "operationId": "v1Root",
        "summary": "v1 REST self-describe (endpoints, build, auth notes).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api.ashx/v1/calls": {
      "post": {
        "tags": [
          "v1-rest"
        ],
        "operationId": "v1CreateCall",
        "summary": "Place an outbound AI call.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "phone"
                ],
                "properties": {
                  "phone": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "systemPrompt": {
                    "type": "string"
                  },
                  "apiKey": {
                    "type": "string"
                  },
                  "voice": {
                    "type": "string"
                  },
                  "language": {
                    "type": "string"
                  },
                  "maxSeconds": {
                    "type": "integer"
                  },
                  "retries": {
                    "type": "integer"
                  },
                  "scheduleAtUtc": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "context": {
                    "type": "string",
                    "maxLength": 2048,
                    "description": "Added to the prompt as 'Context for this call'."
                  },
                  "number": {
                    "type": "string",
                    "description": "Virtual number of the tenant: its MCP tools are offered on the call; its prompt is used when systemPrompt is empty."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Call queued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "v1-rest"
        ],
        "operationId": "v1ListCalls",
        "summary": "List outbound AI calls",
        "description": "Paged; optional `status` CSV filter. Auth: Bearer OIDC access token of a tenant admin, or an ak_ API key. Errors: {error, error_description}.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated status values"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreListEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api.ashx/v1/calls/{id}": {
      "get": {
        "tags": [
          "v1-rest"
        ],
        "operationId": "v1GetCall",
        "summary": "Get one outbound AI call (status and outcome)",
        "description": "Call id 1-64 chars [A-Za-z0-9_-]. Auth: Bearer OIDC access token of a tenant admin, or an ak_ API key. Errors: {error, error_description}.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,64}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Call",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "invalid_callid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api.ashx/v1/calls/{id}/hangup": {
      "post": {
        "tags": [
          "v1-rest"
        ],
        "operationId": "v1HangupCall",
        "summary": "Cancel or terminate an outbound AI call",
        "description": "Cancels a queued call or ends a running one. Auth: Bearer OIDC access token of a tenant admin, or an ak_ API key. Errors: {error, error_description}.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,64}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cancelled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "invalid_callid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api.ashx/v1/numbers": {
      "get": {
        "tags": [
          "v1-rest"
        ],
        "operationId": "v1ListNumbers",
        "summary": "List the tenant's virtual numbers",
        "description": "Paged. Auth: Bearer OIDC access token of a tenant admin, or an ak_ API key. Errors: {error, error_description}.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreListEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "bad_gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api.ashx/v1/transcripts": {
      "get": {
        "tags": [
          "v1-rest"
        ],
        "operationId": "v1ListTranscripts",
        "summary": "List call transcripts",
        "description": "Paged; filters: source (caller source), q (text), since (ISO date). Auth: Bearer OIDC access token of a tenant admin, or an ak_ API key. Errors: {error, error_description}.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreListEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "bad_gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api.ashx/v1/transcripts/{callId}": {
      "get": {
        "tags": [
          "v1-rest"
        ],
        "operationId": "v1GetTranscript",
        "summary": "Get the full transcript of a call",
        "description": "Looked up by call id (or file name containing it). Auth: Bearer OIDC access token of a tenant admin, or an ak_ API key. Errors: {error, error_description}.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "callId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,64}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transcript",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "invalid_callid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api.ashx/v1/inbound-routes": {
      "get": {
        "tags": [
          "v1-rest"
        ],
        "operationId": "v1ListInboundRoutes",
        "summary": "List inbound DID routes",
        "description": "Paged; items {did, fromNumber, user}. Auth: Bearer OIDC access token of a tenant admin, or an ak_ API key. Errors: {error, error_description}.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreListEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "bad_gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "v1-rest"
        ],
        "operationId": "v1CreateInboundRoute",
        "summary": "Create an inbound DID route",
        "description": "Inserted before the '*' catch-all row. Body field names are PascalCase; each max 64 chars; body max 8 KiB. Auth: Bearer OIDC access token of a tenant admin, or an ak_ API key. Errors: {error, error_description}.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "Did": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "FromNumber": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "User": {
                    "type": "string",
                    "maxLength": 64
                  }
                },
                "required": [
                  "Did",
                  "User"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created route",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "invalid_body, invalid_json, missing_did, did_too_long, missing_user, user_too_long, from_too_long",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "duplicate_route",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "write_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api.ashx/v1/outbound-routes": {
      "get": {
        "tags": [
          "v1-rest"
        ],
        "operationId": "v1ListOutboundRoutes",
        "summary": "List outbound trunk-routing rules",
        "description": "Paged rules plus defaultTrunkId. Auth: Bearer OIDC access token of a tenant admin, or an ak_ API key. Errors: {error, error_description}.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/CoreListEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "defaultTrunkId": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "v1-rest"
        ],
        "operationId": "v1CreateOutboundRoute",
        "summary": "Create an outbound trunk-routing rule",
        "description": "Body field names are PascalCase (Match, TrunkIds); Match max 64 chars; TrunkIds non-empty, each max 64 chars; body max 8 KiB. Auth: Bearer OIDC access token of a tenant admin, or an ak_ API key. Errors: {error, error_description}.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "Match": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "TrunkIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 64
                    }
                  }
                },
                "required": [
                  "Match",
                  "TrunkIds"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created rule",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "invalid_body, invalid_json, missing_match, match_too_long, missing_trunkids, trunkid_too_long",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "duplicate",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "write_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api.ashx/v1/webhooks": {
      "get": {
        "tags": [
          "v1-rest"
        ],
        "operationId": "v1ListWebhooks",
        "summary": "List webhook subscriptions",
        "description": "Paged; items {id, url, events, active, createdAtUtc, createdBy, lastFiredUtc, failures}. Secrets are never returned. Auth: Bearer OIDC access token of a tenant admin, or an ak_ API key. Errors: {error, error_description}.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreListEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api.ashx/v1/auditlog": {
      "get": {
        "tags": [
          "v1-rest"
        ],
        "operationId": "v1AuditLog",
        "summary": "List identity and admin audit events",
        "description": "Paged; filters event, user, since. Auth: Bearer OIDC access token of a tenant admin, or an ak_ API key. Errors: {error, error_description}.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreListEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sip-tls/health": {
      "get": {
        "tags": [
          "bridge-health"
        ],
        "operationId": "sipTlsHealth",
        "summary": "SIPS listener state + auto-blacklist counters.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/sip-ws/health": {
      "get": {
        "tags": [
          "bridge-health"
        ],
        "operationId": "sipWsHealth",
        "summary": "SIP-over-WSS listener state.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/sfu/health": {
      "get": {
        "tags": [
          "bridge-health"
        ],
        "operationId": "sfuHealth",
        "summary": "SFU module status.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/sitemap.xml": {
      "get": {
        "tags": [
          "well-known"
        ],
        "operationId": "sitemap",
        "summary": "Per-tenant XML sitemap generated from the published pages",
        "description": "Built from a scan of the public HTML pages at the site root and under /de/, minus a deny list of admin, sign-in and tenant-scoped pages. Each <url> carries <loc> on the canonical host (Site:CanonicalHost or the request host), <lastmod> (file date), <changefreq>, <priority> and EN/DE hreflang alternates when both language versions exist. Cached in-process for 60 seconds per canonical host. The same document is also answered at legacy sitemap URLs (for example /sitemap_index.xml, /wp-sitemap*.xml, /page-sitemap.xml, /sitemap1.xml) so older crawler bookmarks keep working. Anonymous, no parameters.",
        "security": [],
        "x-codeb-audience": "public",
        "responses": {
          "200": {
            "description": "Sitemap (sitemaps.org 0.9 urlset with xhtml:link alternates)",
            "content": {
              "application/xml": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "X-Build-Version": {
                "description": "Handler build slug (changes with every behaviour change).",
                "schema": {
                  "type": "string"
                }
              },
              "X-Tenant": {
                "description": "Request host as parsed.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Canonical-Host": {
                "description": "Host used in every <loc>.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Url-Count": {
                "description": "Number of <url> entries.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ]
      }
    },
    "/robots.txt": {
      "get": {
        "tags": [
          "well-known"
        ],
        "operationId": "robots",
        "summary": "Per-tenant robots.txt",
        "description": "Serves the site's robots.txt with the Sitemap: line rewritten to the tenant's canonical host (Site:CanonicalHost from the tenant settings when set, otherwise the request host). The Disallow list is the same for every tenant. If the source file is missing a minimal allow-all file pointing at /sitemap.xml is returned. Served by robots.ashx through a URL rewrite; anonymous, no parameters.",
        "security": [],
        "x-codeb-audience": "public",
        "responses": {
          "200": {
            "description": "robots.txt",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "X-Build-Version": {
                "description": "Handler build slug (changes with every behaviour change).",
                "schema": {
                  "type": "string"
                }
              },
              "X-Tenant": {
                "description": "Request host as parsed.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Canonical-Host": {
                "description": "Host written into the Sitemap: line.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ]
      }
    },
    "/vci.ashx?par": {
      "post": {
        "tags": [
          "eu-wallet-issuer"
        ],
        "operationId": "issuerPar",
        "summary": "Pushed Authorization Request (RFC 9126). Wallet pushes the authorization request out-of-band and receives a one-shot request_uri.",
        "parameters": [
          {
            "name": "par",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "client_id",
                  "response_type",
                  "redirect_uri",
                  "code_challenge",
                  "code_challenge_method"
                ],
                "properties": {
                  "client_id": {
                    "type": "string",
                    "description": "Must be present in App_Data/<tenant>/wallet-clients.json (fallback: aloaha-web-wallet)."
                  },
                  "response_type": {
                    "type": "string",
                    "enum": [
                      "code"
                    ]
                  },
                  "redirect_uri": {
                    "type": "string",
                    "format": "uri"
                  },
                  "code_challenge": {
                    "type": "string",
                    "minLength": 43,
                    "maxLength": 128
                  },
                  "code_challenge_method": {
                    "type": "string",
                    "enum": [
                      "S256"
                    ]
                  },
                  "scope": {
                    "type": "string"
                  },
                  "authorization_details": {
                    "type": "string",
                    "description": "JSON string per RFC 9396."
                  },
                  "state": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "PAR accepted; returns single-use request_uri.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_uri",
                    "expires_in"
                  ],
                  "properties": {
                    "request_uri": {
                      "type": "string",
                      "example": "urn:ietf:params:oauth:request_uri:abc123"
                    },
                    "expires_in": {
                      "type": "integer",
                      "example": 60
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_request / invalid_client",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "wallet_revoked: the wallet instance was revoked by its holder or the provider",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "[WALLET-REVOKE] A wallet attestation of a revoked wallet instance is refused with 403 wallet_revoked."
      }
    },
    "/vci.ashx?authorize": {
      "get": {
        "tags": [
          "eu-wallet-issuer"
        ],
        "operationId": "issuerAuthorize",
        "summary": "OpenID4VCI authorization endpoint. Redirects to OIDC sign-in when unauthenticated, then to the wallet's redirect_uri with a fresh code.",
        "parameters": [
          {
            "name": "authorize",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "request_uri",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Value returned by /vci.ashx?par. When present, all other authorization parameters are ignored."
          },
          {
            "name": "client_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "response_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "code"
              ]
            }
          },
          {
            "name": "redirect_uri",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uri"
            }
          },
          {
            "name": "code_challenge",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code_challenge_method",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "S256"
              ]
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "authorization_details",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to redirect_uri with ?code=<opaque>&state=<echoed>&iss=<issuer> (RFC 9207).",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request / invalid_client",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "[PID-SIGNIN 2026-10-17] For a PID request (scope, configuration id or authorization_details naming a PID) the page first offers \"Read your passport or ID card with CodeB Wallet\" next to the normal sign-in (signed out), or, after the sign-in, for an account without a passport / ID card or with an identity check to renew. Switch: tenant setting Vci:PidSigninReading (default on)."
      }
    },
    "/wallet/emrtd/relay.ashx": {
      "post": {
        "tags": [
          "emrtd"
        ],
        "operationId": "emrtdRelay",
        "summary": "Relay protocol v1 between CodeB Wallet and the server's reading terminal",
        "description": "One endpoint for the whole reading. Every request is a JSON object with `v: 1`, `op` and `session`; every answer is HTTP 200 with a JSON object whose `op` says what comes next (`info`, `apdu`, `aa_challenge`, `done`, `cancelled` or `error` with `code`). The first `start` carries the phone's Key Attestation chain (and a Play Integrity token when the server requires it); its key is then bound to the session and every later request must carry `X-CodeB-Signature` made with it. Ops: `info` (challenge, requester, data groups), `start` (attestation, access key `{type:'can',can}` or `{type:'mrz',documentNumber,dateOfBirth,dateOfExpiry}`, app and card details), `response` (`seq`, `rapdu` base64url, `ms`), `card_error` (`tag_lost`), `cancel`, `evidence` (local reading fallback, only when the server allows it). Limits: 5 starts per session, 3 wrong access keys, per-IP rate limit, body cap. Rewritten to emrtd-relay.ashx?p=relay.",
        "security": [],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "name": "X-CodeB-Signature",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required on every request after the first attested `start`."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "v": {
                    "const": 1
                  },
                  "op": {
                    "type": "string",
                    "enum": [
                      "info",
                      "start",
                      "response",
                      "card_error",
                      "cancel",
                      "evidence"
                    ]
                  },
                  "session": {
                    "type": "string"
                  },
                  "attestation": {
                    "type": "object",
                    "description": "start only: keyChain (Key Attestation), playIntegrityToken, issuanceKey (wallet issuance-key proof)"
                  },
                  "access": {
                    "type": "object"
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "relay",
                      "local_aa"
                    ]
                  },
                  "seq": {
                    "type": "integer"
                  },
                  "rapdu": {
                    "type": "string"
                  },
                  "error": {
                    "type": "string"
                  }
                },
                "required": [
                  "op",
                  "session"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Next step of the protocol (always 200; errors as op=error with code such as session_unknown, session_expired, signature_invalid, attestation_failed, integrity_failed, wrong_key, protocol)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "op": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "challenge": {
                      "type": "string"
                    },
                    "apdu": {
                      "type": "string"
                    },
                    "seq": {
                      "type": "integer"
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "verdict": {
                          "type": "string",
                          "enum": [
                            "genuine",
                            "not_verified",
                            "not_genuine"
                          ]
                        },
                        "reasons": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "mode": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "required": [
                    "op"
                  ]
                }
              }
            }
          },
          "405": {
            "description": "Not POST"
          },
          "413": {
            "description": "Body too large"
          },
          "415": {
            "description": "Not application/json"
          },
          "429": {
            "description": "Rate limit",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait"
              }
            }
          }
        }
      }
    },
    "/wallet/emrtd/session": {
      "get": {
        "tags": [
          "emrtd"
        ],
        "operationId": "emrtdSessionPage",
        "summary": "App Link landing page of a reading session (shown when the wallet is not installed)",
        "description": "HTML page (HTTP 200, no redirect) behind the App Link `https://<host>/wallet/emrtd/session?id=<sid>`; CodeB Wallet opens the link directly. noindex, strict CSP; the session id is not echoed.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "HTML page",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/wallet/emrtd/status": {
      "get": {
        "tags": [
          "emrtd"
        ],
        "operationId": "emrtdSigninStatus",
        "summary": "State of a sign-in reading, polled by the browser that started it",
        "description": "Only for sign-in readings and only from the browser that holds the session's `codeb_emrtd` cookie.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "sid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "State",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "state": {
                      "type": "string",
                      "enum": [
                        "waiting",
                        "reading",
                        "done",
                        "failed"
                      ]
                    },
                    "code": {
                      "type": "string"
                    },
                    "verdict": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Unknown session or wrong browser",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "state": {
                      "const": "unknown"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/emrtd-relay.ashx?p=invite-info": {
      "post": {
        "tags": [
          "emrtd"
        ],
        "operationId": "emrtdInviteInfo",
        "summary": "What an invitation link allows (label, expiry, readings left)",
        "description": "Used by /wallet/emrtd/try. The invitation token travels in the body, never in a URL. 300 requests per minute per IP.",
        "security": [],
        "x-codeb-audience": "public",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "i": {
                    "type": "string",
                    "description": "Invitation token"
                  }
                },
                "required": [
                  "i"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Invitation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "label": {
                      "type": "string"
                    },
                    "expires": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "readings_left": {
                      "type": "integer"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "try",
                        "onboard",
                        "verify"
                      ]
                    },
                    "account_created": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Unknown or used up",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limit",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait"
              }
            }
          }
        }
      }
    },
    "/emrtd-relay.ashx?p=invite-new": {
      "post": {
        "tags": [
          "emrtd"
        ],
        "operationId": "emrtdInviteNewSession",
        "summary": "Start a reading session from an invitation",
        "security": [],
        "x-codeb-audience": "public",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "i": {
                    "type": "string"
                  }
                },
                "required": [
                  "i"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Session",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sid": {
                      "type": "string"
                    },
                    "view": {
                      "type": "string",
                      "description": "Token for invite-session"
                    },
                    "link": {
                      "type": "string",
                      "format": "uri"
                    },
                    "expires": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "readings_left": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Unknown invitation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "No readings left",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limit",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait"
              }
            }
          },
          "503": {
            "description": "Too many open readings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/emrtd-relay.ashx?p=invite-session": {
      "post": {
        "tags": [
          "emrtd"
        ],
        "operationId": "emrtdInviteSession",
        "summary": "Live state and result of an invitation reading",
        "description": "Polled by the invitee page every 2 s. Shows state, verdict, a preview of the chip data to the person who read it, and the outcome for the account (created, released, offers).",
        "security": [],
        "x-codeb-audience": "public",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sid": {
                    "type": "string"
                  },
                  "view": {
                    "type": "string"
                  }
                },
                "required": [
                  "sid",
                  "view"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Session view",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Unknown session or wrong view token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/emrtd-relay.ashx?p=account-check": {
      "post": {
        "tags": [
          "emrtd"
        ],
        "operationId": "emrtdAccountCheck",
        "summary": "Start a passport / ID card check of the signed-in user's own account",
        "description": "Answers with the reading link the page opens on the phone. 5 per minute per account.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expected_family_name": {
                    "type": "string"
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reading link",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limit",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait"
              }
            }
          }
        }
      }
    },
    "/emrtd-relay.ashx?p=pid-offer": {
      "get": {
        "tags": [
          "emrtd"
        ],
        "operationId": "emrtdPidOffer",
        "summary": "Credential offer (authorization code) for the PID test credential",
        "description": "The link in the release mail. Contains no secrets: the wallet signs in to collect.",
        "security": [],
        "x-codeb-audience": "public",
        "responses": {
          "200": {
            "description": "OpenID4VCI credential offer",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "credential_issuer": {
                      "type": "string",
                      "format": "uri"
                    },
                    "credential_configuration_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "grants": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/emrtd-relay.ashx?p=admin-new": {
      "post": {
        "tags": [
          "emrtd"
        ],
        "operationId": "emrtdAdminNewTest",
        "summary": "Admin: new test reading session (emrtd-test.html)",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "forceLocalAa": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Session",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sid": {
                      "type": "string"
                    },
                    "link": {
                      "type": "string"
                    },
                    "expires": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Local fallback switched off",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "413": {
            "description": "Body over 1 KB"
          },
          "503": {
            "description": "Too many open sessions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/emrtd-relay.ashx?p=admin-session": {
      "get": {
        "tags": [
          "emrtd"
        ],
        "operationId": "emrtdAdminSession",
        "summary": "Admin: state, verdict, evidence summary and preview of a test session",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "sid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Session view",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Unknown or expired",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/emrtd-relay.ashx?p=admin-evidence": {
      "get": {
        "tags": [
          "emrtd"
        ],
        "operationId": "emrtdAdminEvidence",
        "summary": "Admin: latest evidence records, hash-chain check and configuration",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "responses": {
          "200": {
            "description": "Evidence summary",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/emrtd-relay.ashx?p=admin-invites": {
      "get": {
        "tags": [
          "emrtd"
        ],
        "operationId": "emrtdAdminInvites",
        "summary": "Admin: list invitations",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "responses": {
          "200": {
            "description": "Invitations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "invites": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/emrtd-relay.ashx?p=admin-invite-new": {
      "post": {
        "tags": [
          "emrtd"
        ],
        "operationId": "emrtdAdminInviteNew",
        "summary": "Admin: new invitation (try, account opening or account check)",
        "description": "type `try` (chip check only), `onboard` (open an account; e-mail required) or `verify` (check an existing account; `account` and `expected_family_name`). Mails the link when an e-mail is given.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "try",
                      "onboard",
                      "verify"
                    ]
                  },
                  "label": {
                    "type": "string"
                  },
                  "days": {
                    "type": "integer"
                  },
                  "readings": {
                    "type": "integer"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "account": {
                    "type": "string"
                  },
                  "expected_family_name": {
                    "type": "string"
                  },
                  "expected_birthdate": {
                    "type": "string"
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Invitation with link",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/emrtd-relay.ashx?p=admin-invite-revoke": {
      "post": {
        "tags": [
          "emrtd"
        ],
        "operationId": "emrtdAdminInviteRevoke",
        "summary": "Admin: withdraw an invitation",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Withdrawn",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Unknown",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/emrtd-relay.ashx?p=admin-proofing": {
      "get": {
        "tags": [
          "emrtd"
        ],
        "operationId": "emrtdAdminProofing",
        "summary": "Admin: accounts waiting for an identity-proofing decision",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/emrtd-relay.ashx?p=admin-proofing-decide": {
      "post": {
        "tags": [
          "emrtd"
        ],
        "operationId": "emrtdAdminProofingDecide",
        "summary": "Admin: release or reject an account's document check",
        "description": "A release offers the PID and Photo ID test credentials to the wallet that read the document.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string"
                  },
                  "decision": {
                    "type": "string",
                    "enum": [
                      "release",
                      "reject"
                    ]
                  },
                  "note": {
                    "type": "string"
                  }
                },
                "required": [
                  "user",
                  "decision"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Decided",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Unknown account",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/emrtd-relay.ashx?p=self-info": {
      "get": {
        "tags": [
          "emrtd-self-service"
        ],
        "operationId": "selfServiceInfo",
        "summary": "Is opening an account in the app switched on?",
        "description": "The wallet hides 'Create a CodeB account' when `self_service` is false. Also in POST /rqes/csc/v2/info. 120 per minute per IP.",
        "security": [],
        "x-codeb-audience": "wallet",
        "responses": {
          "200": {
            "description": "Switch and limits",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "self_service": {
                      "type": "boolean"
                    },
                    "account_role": {
                      "const": "guest"
                    },
                    "guest_signatures_per_day": {
                      "type": "integer",
                      "examples": [
                        5
                      ]
                    },
                    "session_minutes": {
                      "type": "integer",
                      "examples": [
                        15
                      ]
                    }
                  },
                  "required": [
                    "self_service"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limit",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait"
              }
            }
          }
        }
      }
    },
    "/emrtd-relay.ashx?p=self-session": {
      "post": {
        "tags": [
          "emrtd-self-service"
        ],
        "operationId": "selfServiceSession",
        "summary": "Start a reading session for a new guest account",
        "description": "Creates a reading session of kind `self` (15 minutes; it ends after 5 minutes if no phone sent `start`). The device check runs in the relay `start`: Key Attestation, the wallet's issuance-key proof and, when the server has it configured, a Play Integrity verdict `ok`; otherwise the relay answers attestation_failed / integrity_failed and reads nothing. 10 per minute and 30 per hour per network.",
        "security": [],
        "x-codeb-audience": "wallet",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "lang": {
                    "type": "string",
                    "examples": [
                      "en"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Session",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "session": {
                      "type": "string"
                    },
                    "relay_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "session_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "expires_in": {
                      "type": "integer",
                      "examples": [
                        900
                      ]
                    }
                  },
                  "required": [
                    "session",
                    "relay_url",
                    "expires_in"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceError"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited or daily_cap",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait"
              }
            }
          },
          "503": {
            "description": "self_service_off or busy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceError"
                }
              }
            }
          }
        }
      }
    },
    "/emrtd-relay.ashx?p=self-code": {
      "post": {
        "tags": [
          "emrtd-self-service"
        ],
        "operationId": "selfServiceCode",
        "summary": "Mail a one-time code to confirm the e-mail address",
        "description": "After the reading ended (`op: done`) and within 15 minutes of self-session. Checks the reading and the limits first, so a final refusal can already come here. The 6-digit code is valid for 10 minutes and kept only in memory as an HMAC. At most 3 addresses or code mails per reading (an address already in use counts too; the 4th try ends the reading), at most 3 codes per address and hour.",
        "security": [],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "name": "X-CodeB-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Signature over the raw request body made with the relay key the wallet bound in the relay `start` of this session (same scheme as on the relay requests)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "session": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  }
                },
                "required": [
                  "session",
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Code sent, or the reading's final answer",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "status": {
                          "const": "code_sent"
                        },
                        "email": {
                          "type": "string"
                        },
                        "expires_in": {
                          "type": "integer"
                        },
                        "sends_left": {
                          "type": "integer"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/SelfServiceFinal"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_email or invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceError"
                }
              }
            }
          },
          "403": {
            "description": "signature_invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceError"
                }
              }
            }
          },
          "404": {
            "description": "session_unknown",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceError"
                }
              }
            }
          },
          "409": {
            "description": "email_in_use (counts as a try) or not_ready",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceError"
                }
              }
            }
          },
          "410": {
            "description": "session_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceError"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (codes per address) or a final refusal (status refused)",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/SelfServiceError"
                    },
                    {
                      "$ref": "#/components/schemas/SelfServiceFinal"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait"
              }
            }
          },
          "503": {
            "description": "self_service_off or temporarily_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceError"
                }
              }
            }
          }
        }
      }
    },
    "/emrtd-relay.ashx?p=self-finish": {
      "post": {
        "tags": [
          "emrtd-self-service"
        ],
        "operationId": "selfServiceFinish",
        "summary": "Open the guest account with the confirmed address",
        "description": "Release rule `self_service`: genuine chip, document not expired and not expiring today, no account for this document, attested phone with issuance key, limits (one account per phone, 10 openings per network and hour, daily cap, 24 h after a delete on the same phone or document), code right for this address, address neither a login nor another account's e-mail. Five wrong codes per reading end it. The final answer is fixed per reading: repeats return it again and create or mail nothing. Accepted until 25 minutes after self-session.",
        "security": [],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "name": "X-CodeB-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Signature over the raw request body made with the relay key the wallet bound in the relay `start` of this session (same scheme as on the relay requests)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "session": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "code": {
                    "type": "string",
                    "pattern": "^[0-9]{6}$"
                  }
                },
                "required": [
                  "session",
                  "email",
                  "code"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "created / exists / refused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceFinal"
                }
              }
            }
          },
          "400": {
            "description": "code_required, code_invalid (with attempts_left), code_expired, invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceError"
                }
              }
            }
          },
          "403": {
            "description": "signature_invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceError"
                }
              }
            }
          },
          "404": {
            "description": "session_unknown",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceError"
                }
              }
            }
          },
          "409": {
            "description": "not_ready, or a final refusal email_in_use",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/SelfServiceError"
                    },
                    {
                      "$ref": "#/components/schemas/SelfServiceFinal"
                    }
                  ]
                }
              }
            }
          },
          "410": {
            "description": "session_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceError"
                }
              }
            }
          },
          "429": {
            "description": "Final refusal: device_limit, recently_deleted, rate_limited, daily_cap, too_many_attempts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceFinal"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait"
              }
            }
          },
          "503": {
            "description": "self_service_off or temporarily_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceError"
                }
              }
            }
          }
        }
      }
    },
    "/emrtd-relay.ashx?p=self-delete": {
      "post": {
        "tags": [
          "emrtd-self-service"
        ],
        "operationId": "selfServiceDelete",
        "summary": "The signed-in guest deletes the own account (GDPR Art. 17)",
        "description": "Access token of the site's own sign-in (client codeb-admin), role guest only. Removes the account, photos, every document binding, open offers, the account's signing requests and signing key, revokes the PID / Photo ID test credentials already issued (status list) and revokes the access token used. The same phone and document can open a new account after 24 hours. 3 per minute per account.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deleted": {
                      "const": true
                    },
                    "credentials_revoked": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "sign_in_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceError"
                }
              }
            }
          },
          "403": {
            "description": "not_allowed (not a guest account)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceError"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceError"
                }
              }
            }
          },
          "409": {
            "description": "not_deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceError"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait"
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable (nothing changed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceError"
                }
              }
            }
          }
        }
      }
    },
    "/sign-request.ashx?ca": {
      "get": {
        "tags": [
          "sign-request"
        ],
        "operationId": "signRequestCa",
        "summary": "The relying-party CA certificate the wallet pins (PEM)",
        "security": [],
        "x-codeb-audience": "wallet",
        "responses": {
          "200": {
            "description": "PEM",
            "content": {
              "application/x-pem-file": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/sign-request.ashx?r={sid}": {
      "get": {
        "tags": [
          "sign-request"
        ],
        "operationId": "signRequestObject",
        "summary": "Signed request object of the active step (OpenID4VP, ETSI TS 119 432)",
        "description": "Fresh ES256 JWT, typ oauth-authz-req+jwt, exp 15 minutes, x5c chain to the CA from ?ca. Claims: client_id x509_san_dns:<host>, response_mode direct_post, response_uri, state, nonce, signatureQualifier (eu_eidas_qes / eu_eidas_aes), documentDigests (label + SHA-256 per document), documentLocations (?doc URLs). The wallet link is eudi-rqes://?client_id=...&request_uri=<this URL>. When the requester placed a visible signature field for this signer: codeb_signature_fields = [{document (index into documentDigests), name (the empty field in the PDF, e.g. CodeB_Signer1), page, rect (hint for a preview; the field in the PDF counts), appearance (allowed: handwritten, id_image, name_only), required_visible, handwritten_image? {uri, hash}}]. handwritten_image is present only when the signer drew a signature on the web page (GET ?sigimg=); hash = SHA-256 of the PNG, base64. The answer must sign into exactly that field; when required_visible the field needs a visible appearance. A wallet that cannot show it answers error=access_denied with error_description=signature_appearance_unavailable.",
        "security": [],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "name": "sid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{22}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JWT",
            "content": {
              "application/oauth-authz-req+jwt": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Unknown step",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "not_yet: earlier signers have not signed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "410": {
            "description": "request_closed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit"
          }
        }
      }
    },
    "/sign-request.ashx?doc={sid}.{n}.{token}": {
      "get": {
        "tags": [
          "sign-request"
        ],
        "operationId": "signRequestDocument",
        "summary": "Input PDF n of the active step (original or the previous signer's PDF)",
        "security": [],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "name": "sid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "n",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9
            }
          },
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PDF",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Unknown",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "410": {
            "description": "Closed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit"
          }
        }
      }
    },
    "/sign-request.ashx?respond={sid}": {
      "post": {
        "tags": [
          "sign-request"
        ],
        "operationId": "signRequestRespond",
        "summary": "Wallet answer (direct_post): signed PDFs or a decline",
        "description": "Each signed PDF must be an incremental update of the input, byte for byte, with one verifying CMS signature; changes that could hide or replace content are refused; the PAdES level is reported. Idempotent for the same state and body. When an invited signer's answer is accepted, a guest account's signatures for it do not count toward its daily limit. With a visible signature field for this signer the signed PDF must have signed exactly that field (position unchanged, no other field signed; with required_visible a visible appearance); otherwise the answer is refused.",
        "security": [],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "name": "sid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "state": {
                    "type": "string"
                  },
                  "documentWithSignature": {
                    "type": "string",
                    "description": "JSON array of base64 PDFs, one per document"
                  },
                  "error": {
                    "type": "string",
                    "examples": [
                      "user_cancelled"
                    ]
                  }
                },
                "required": [
                  "state"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request or invalid_signed_document (with the reason)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Unknown",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "410": {
            "description": "request_closed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/sign-request.ashx?invite={sid}": {
      "get": {
        "tags": [
          "sign-request"
        ],
        "operationId": "signRequestInvitee",
        "summary": "Invited person's page data (documents, who asks, own turn, wallet link, downloads)",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "sid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Page data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Unknown",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "description": "sign_field {width, height (points), drawn} is present on the person's turn when a visible signature field is placed for them and handwritten is allowed: the page offers to draw the signature (POST ?sigimg=)."
      }
    },
    "/sign-request.ashx?final={sid}.{n}.{token}": {
      "get": {
        "tags": [
          "sign-request"
        ],
        "operationId": "signRequestFinal",
        "summary": "Signed PDF for an invited signer, once everyone has signed",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "sid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "n",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PDF",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Unknown or not yet signed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/sign-request.ashx?api=create": {
      "post": {
        "tags": [
          "sign-request"
        ],
        "operationId": "signRequestCreate",
        "summary": "Create a signing request",
        "description": "1-10 PDFs (40 MB each, 50 MB together), signature level qes (signature card whose certificate states a qualified signature) or aes, optional note, `self=1` to sign first, invited e-mails in signing order (up to 5; guests 2; 20 invitations a day). Your own turn stays open 24 h, an invited person's 72 h; requests are kept 30 days after they close. The first invited signer is mailed at once when the requester does not sign first. Visible signature fields (optional): `fields` = JSON array [{\"doc\": n, \"signer\": 1-based signing position, \"page\": 1-based, \"rect\": [x1, y1, x2, y2] in PDF points}], at most one field per signer and document, at least 60 x 20 points, inside the page, at most 10 per document. Before the documents are hashed the server adds an empty signature field CodeB_Signer<n> per entry as an incremental update; the wallet signs into that field and draws the appearance. `appearance` = comma list of what the signer may use (handwritten, id_image, name_only; default all three); `required_visible` is no longer needed: a signer with a field always signs visibly (no invisible fallback). Without `fields` nothing changes. AI apps and agents: an access token from the MCP sign-in or from OpenID CIBA (scope sign_requests) works on api=create, list, status, invite, resend, withdraw, download, verify and verify-upload (not on delete, not on the card path); the request records via_agent.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary"
                    }
                  },
                  "label": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "level": {
                    "type": "string",
                    "enum": [
                      "qes",
                      "aes"
                    ]
                  },
                  "note": {
                    "type": "string"
                  },
                  "self": {
                    "type": "string",
                    "enum": [
                      "0",
                      "1"
                    ]
                  },
                  "invite": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "email"
                    }
                  },
                  "fields": {
                    "type": "string",
                    "description": "JSON array of visible signature fields: [{\"doc\":0,\"signer\":1,\"page\":1,\"rect\":[72,90,272,150]}]"
                  },
                  "appearance": {
                    "type": "string",
                    "description": "comma list: handwritten, id_image, name_only (default: all three)"
                  },
                  "required_visible": {
                    "type": "string",
                    "enum": [
                      "0",
                      "1"
                    ],
                    "description": "No longer needed (ignored): a signer with a signature field always signs visibly.",
                    "deprecated": true
                  }
                },
                "required": [
                  "file",
                  "level"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignRequestSummary"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request (with the reason)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "description": "limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "slow_down",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/sign-request.ashx?api=list": {
      "get": {
        "tags": [
          "sign-request"
        ],
        "operationId": "signRequestList",
        "summary": "The signed-in user's own signing requests",
        "description": "Each account sees only its own requests.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "responses": {
          "200": {
            "description": "List",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requests": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SignRequestSummary"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/sign-request.ashx?api=status": {
      "get": {
        "tags": [
          "sign-request"
        ],
        "operationId": "signRequestStatus",
        "summary": "One request (polled by the page)",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignRequestSummary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not found or another account's",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "description": "On the requester's own turn (my_turn) with a visible signature field placed for them: sign_field {width, height, drawn} and sid (the step id for POST ?sigimg=). Each signer also has fields: [{\"doc\",\"page\",\"rect\"}] - where that signer signs (empty without signature fields)."
      }
    },
    "/sign-request.ashx?api=invite": {
      "post": {
        "tags": [
          "sign-request"
        ],
        "operationId": "signRequestInvite",
        "summary": "Add invited signers at the end of an open request",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "emails": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "email"
                    }
                  }
                },
                "required": [
                  "id",
                  "emails"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignRequestSummary"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "not_open, already_invited or limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "slow_down",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/sign-request.ashx?api=resend": {
      "post": {
        "tags": [
          "sign-request"
        ],
        "operationId": "signRequestResend",
        "summary": "Send the invitation e-mail again to the invited person whose turn it is",
        "description": "Owner only, open request; at most 3 times per signer, not twice within a minute; counts as an invitation for the daily limit. The summary's `mail` field says whether the mail was handed to the mail server.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignRequestSummary"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "not_open, not_waiting, resend_limit or limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "slow_down",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "mail_failed: could not be handed to the mail server",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/sign-request.ashx?api=withdraw": {
      "post": {
        "tags": [
          "sign-request"
        ],
        "operationId": "signRequestWithdraw",
        "summary": "Withdraw an open request (the invited person whose turn it was is told)",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "not_open",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/sign-request.ashx?api=delete": {
      "post": {
        "tags": [
          "sign-request"
        ],
        "operationId": "signRequestDelete",
        "summary": "Delete a request and its documents",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "not_open",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/sign-request.ashx?api=download": {
      "get": {
        "tags": [
          "sign-request"
        ],
        "operationId": "signRequestDownload",
        "summary": "Download an original or the (latest) signed PDF of an own request",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "n",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "original",
                "signed"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PDF",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found or no longer kept",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/sign-request.ashx?verify={sid}.{n}.{token}": {
      "get": {
        "tags": [
          "sign-request"
        ],
        "operationId": "signRequestFinalReport",
        "summary": "Signature report of the final signed PDF (invited signer)",
        "description": "Same token as `final=`. Every signature in the PDF is checked: integrity of the signed revision, later changes, certificate and timestamp. No check against the EU trusted lists.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "sid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "n",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignatureReport"
                }
              }
            }
          },
          "404": {
            "description": "Unknown or not yet signed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "busy (two reports at a time)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/sign-request.ashx?api=verify": {
      "get": {
        "tags": [
          "sign-request"
        ],
        "operationId": "signRequestReport",
        "summary": "Signature report of an original or signed PDF of an own request",
        "description": "30 per minute per account.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "n",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "original",
                "signed"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignatureReport"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Not signed in",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found or no longer kept",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "slow_down",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "busy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/sign-request.ashx?api=verify-upload": {
      "post": {
        "tags": [
          "sign-request"
        ],
        "operationId": "signRequestReportUpload",
        "summary": "Signature report of any PDF (not stored)",
        "description": "The body is the PDF itself (at most 40 MB). Nothing is stored. 10 per minute per account. The page sends a local file only when it contains signatures and the user asks for the check.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "requestBody": {
          "required": true,
          "content": {
            "application/pdf": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignatureReport"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request (not a PDF)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Not signed in",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Larger than 40 MB",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "slow_down",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "busy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/sign-request.ashx?api=inspect": {
      "post": {
        "tags": [
          "sign-request"
        ],
        "operationId": "signRequestInspect",
        "summary": "Page sizes and rotation of a PDF, to place signature fields",
        "description": "Body = the PDF (application/pdf, at most 40 MB; nothing is stored). Returns {\"pages\":[{\"page\",\"x1\",\"y1\",\"x2\",\"y2\",\"width\",\"height\",\"rotate\"}],\"page_count\",\"size\",\"min_field\":[60,20],\"max_fields_per_document\":10}: each page's media box (inherited from the page tree) in PDF points and the page rotation (0/90/180/270), the same values the server uses to check fields in api=create. Place a field rect [x1,y1,x2,y2] inside the box (origin at its lower-left corner in PDF user space; for a rotated page convert from the displayed view). 30 calls a minute per account. Also for AI apps and agents with the permission sign_requests.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "requestBody": {
          "required": true,
          "content": {
            "application/pdf": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pages",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request (not a PDF, or it could not be read)"
          },
          "401": {
            "description": "sign_in_required"
          },
          "413": {
            "description": "Larger than 40 MB"
          },
          "429": {
            "description": "slow_down"
          }
        }
      }
    },
    "/csc/v2/info": {
      "get": {
        "tags": [
          "csc-signing"
        ],
        "operationId": "cscInfo",
        "summary": "CSC v2 service metadata of the classic signing API (POST also accepted)",
        "description": "CSC v2.0.0.2 section 11.1 metadata of the classic remote-signing API: methods, signature algorithms (ECDSA P-256 with SHA-256, RSA with SHA-256), PAdES formats and conformance levels. Advanced electronic signatures with a per-user, software-backed signing key; not a qualified signature service. Any HTTP method is answered. Rate limit: 30 requests per minute per IP.",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Service metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscClassicInfo"
                }
              }
            }
          },
          "403": {
            "description": "https_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          }
        },
        "x-codeb-audience": "public"
      }
    },
    "/csc/v2/auth/login": {
      "post": {
        "tags": [
          "csc-signing"
        ],
        "operationId": "cscAuthLogin",
        "summary": "Check an OIDC access token and echo it as a CSC access token",
        "description": "Verifies the OIDC access token in the Authorization header (issued by this tenant) and returns it unchanged in the CSC auth/login shape. No new token is minted.",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Token accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "access_token": {
                      "type": "string"
                    },
                    "token_type": {
                      "type": "string",
                      "const": "Bearer"
                    },
                    "expires_in": {
                      "type": "integer",
                      "const": 3600
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "invalid_token: bearer_required or introspect_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                },
                "description": "Bearer realm=\"codeb-csc\""
              }
            }
          },
          "403": {
            "description": "https_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "413": {
            "description": "invalid_request / body_too_large (request body over the cap)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited: more than 30 requests per minute from one IP address for this action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "500": {
            "description": "server_error / crypto module error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          }
        },
        "x-codeb-audience": "signed-in"
      }
    },
    "/csc/v2/auth/revoke": {
      "post": {
        "tags": [
          "csc-signing"
        ],
        "operationId": "cscAuthRevoke",
        "summary": "Revoke an OIDC access or refresh token",
        "description": "Revokes the token given in the body. A verifiable OIDC access token is revoked by its jti until it expires; any other value is treated as an opaque refresh token and marked revoked. Possession of the token is the authorization: no Authorization header is needed.",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string"
                  }
                },
                "required": [
                  "token"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Revoked",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_request: invalid_json or token_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "403": {
            "description": "https_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "405": {
            "description": "post_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "413": {
            "description": "body_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          }
        },
        "x-codeb-audience": "signed-in"
      }
    },
    "/csc/v2/credentials/list": {
      "post": {
        "tags": [
          "csc-signing"
        ],
        "operationId": "cscCredentialsList",
        "summary": "List the signed-in user's signing credential",
        "description": "Returns the credential id of the caller's own signing key. The key and its certificate are created on first use. Each user has exactly one credential.",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Ignored on the classic surface."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Credential ids",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "credentialIDs": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "maxItems": 1
                    }
                  },
                  "required": [
                    "credentialIDs"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "invalid_token: bearer_required or introspect_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                },
                "description": "Bearer realm=\"codeb-csc\""
              }
            }
          },
          "403": {
            "description": "https_required (plain HTTP), or access_denied: the token belongs to a guest account that was deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "413": {
            "description": "invalid_request / body_too_large (request body over the cap)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited: more than 30 requests per minute from one IP address for this action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "500": {
            "description": "server_error / crypto module error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "501": {
            "description": "crypto_module_not_configured: the tenant has no signing module",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          }
        },
        "x-codeb-audience": "signed-in"
      }
    },
    "/csc/v2/credentials/info": {
      "post": {
        "tags": [
          "csc-signing"
        ],
        "operationId": "cscCredentialsInfo",
        "summary": "Details of the caller's signing credential (key, certificate, SCAL, PIN)",
        "description": "Key attributes, the signing certificate (DNs in RFC 4514 form, GeneralizedTime validity), SCAL level and whether a sign PIN is presented. SCAL is 1 unless the operator sets the default to 2.",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "credentialID": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{8,128}$"
                  }
                },
                "required": [
                  "credentialID"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Credential details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscClassicCredentialInfo"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request: invalid_json, credentialID_required, malformed_credentialID or credentialID_unknown",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "401": {
            "description": "invalid_token: bearer_required or introspect_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                },
                "description": "Bearer realm=\"codeb-csc\""
              }
            }
          },
          "403": {
            "description": "https_required (plain HTTP), or access_denied: the token belongs to a guest account that was deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "413": {
            "description": "invalid_request / body_too_large (request body over the cap)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited: more than 30 requests per minute from one IP address for this action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "500": {
            "description": "server_error / crypto module error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "501": {
            "description": "crypto_module_not_configured: the tenant has no signing module",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          }
        },
        "x-codeb-audience": "signed-in"
      }
    },
    "/csc/v2/credentials/authorize": {
      "post": {
        "tags": [
          "csc-signing"
        ],
        "operationId": "cscCredentialsAuthorize",
        "summary": "Authorize hashes: returns a SAD (SCAL 1) or a pending SCAL 2 challenge",
        "description": "Binds up to 10 SHA-256 document hashes to the caller's credential. SCAL 1 returns a Signature Activation Data JWT (SAD, valid 5 minutes) right away. SCAL 2 (operator default, or ?scal=2) stores a pending authorization for 5 minutes and returns a challenge plus WebAuthn request options when the user has a passkey; the SAD is released by credentials/authorize/confirm. Only reachable with an OIDC access token; the EU-wallet profile tokens are refused here.",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "scal",
            "in": "query",
            "required": false,
            "description": "1 or 2; overrides the operator default.",
            "schema": {
              "type": "string",
              "enum": [
                "1",
                "2"
              ]
            }
          }
        ],
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "credentialID": {
                    "type": "string"
                  },
                  "numSignatures": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10,
                    "default": 1
                  },
                  "hash": {
                    "oneOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "contentEncoding": "base64"
                        },
                        "maxItems": 10
                      },
                      {
                        "type": "string",
                        "contentEncoding": "base64"
                      }
                    ],
                    "description": "Standard base64 of 32-byte SHA-256 hashes"
                  },
                  "hashAlgo": {
                    "type": "string",
                    "default": "2.16.840.1.101.3.4.2.1"
                  }
                },
                "required": [
                  "credentialID",
                  "hash"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "SCAL 1: {SAD}. SCAL 2: pending record",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "SAD": {
                          "type": "string",
                          "description": "JWT, aud csc-sad, valid 300 s"
                        }
                      },
                      "required": [
                        "SAD"
                      ]
                    },
                    {
                      "$ref": "#/components/schemas/CscScal2Pending"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request: credentialID_required, malformed_credentialID, hash_required, hash_empty, too_many_hashes, hash_must_be_sha256_32bytes, credentialID_unknown",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "401": {
            "description": "invalid_token: bearer_required or introspect_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                },
                "description": "Bearer realm=\"codeb-csc\""
              }
            }
          },
          "403": {
            "description": "https_required (plain HTTP), or access_denied: the token belongs to a guest account that was deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "413": {
            "description": "invalid_request / body_too_large (request body over the cap)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited: more than 30 requests per minute from one IP address for this action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "500": {
            "description": "server_error / crypto module error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "501": {
            "description": "crypto_module_not_configured: the tenant has no signing module",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          }
        },
        "x-codeb-audience": "signed-in"
      }
    },
    "/csc/v2/credentials/authorize/confirm": {
      "post": {
        "tags": [
          "csc-signing"
        ],
        "operationId": "cscCredentialsAuthorizeConfirm",
        "summary": "Confirm a pending SCAL 2 authorization and release the SAD",
        "description": "Second step of SCAL 2. The bearer's user must match the pending record. Factor: a WebAuthn assertion (verified against the user's registered passkey: challenge, origin, RP id hash, user presence and verification, signature, counter) or the user's Sign PIN in the X-CSC-Sign-PIN header or the pin field, checked against a salted PBKDF2-SHA256 hash set with credentials/pin. Five wrong PINs in a row lock the PIN factor for 15 minutes. A wrong PIN keeps the pending record so the user can retry within its lifetime; it is deleted on success, on a failed passkey check, on a lock, on a user mismatch and on expiry. On a tenant with Csc:DefaultScal=2 only a SAD released here can sign (a SCAL1 SAD gets 403 access_denied SAD_scal_too_low).",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "X-CSC-Sign-PIN",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 12
            }
          }
        ],
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "authorization_id": {
                    "type": "string",
                    "minLength": 8,
                    "maxLength": 64
                  },
                  "webauthn_assertion": {
                    "type": "object",
                    "description": "PublicKeyCredential assertion JSON (id, response.clientDataJSON, authenticatorData, signature, userHandle)"
                  },
                  "pin": {
                    "type": "string"
                  }
                },
                "required": [
                  "authorization_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "SAD released",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "SAD": {
                      "type": "string"
                    },
                    "authorization_id": {
                      "type": "string"
                    },
                    "scal": {
                      "type": "string",
                      "const": "2"
                    },
                    "confirm_factor": {
                      "type": "string",
                      "examples": [
                        "webauthn-hwk",
                        "webauthn-swk",
                        "pin"
                      ]
                    }
                  },
                  "required": [
                    "SAD"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request (authorization_id_required, malformed_authorization_id, authorization_expired, confirmation_factor_required) or webauthn_verification_failed; invalid_pin (wrong PIN, the pending authorization stays).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "401": {
            "description": "invalid_token: bearer_required or introspect_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                },
                "description": "Bearer realm=\"codeb-csc\""
              }
            }
          },
          "403": {
            "description": "invalid_token / user_mismatch, access_denied / pin_not_set (no Sign PIN set yet), access_denied / credential_locked (Retry-After).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "invalid_request / authorization_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "413": {
            "description": "invalid_request / body_too_large (request body over the cap)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited: more than 30 requests per minute from one IP address for this action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "500": {
            "description": "server_error / crypto module error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "501": {
            "description": "crypto_module_not_configured: the tenant has no signing module",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          }
        },
        "x-codeb-audience": "signed-in"
      }
    },
    "/csc/v2/signatures/signHash": {
      "post": {
        "tags": [
          "csc-signing"
        ],
        "operationId": "cscSignHash",
        "summary": "Sign SHA-256 hashes with a SAD",
        "description": "Signs up to 10 hashes with the caller's key. The SAD must verify, be unexpired, carry aud csc-sad, belong to the same user and credential, and list exactly the same hashes in the same order. CSC v2 names hashes / hashAlgorithmOID are accepted next to hash / hashAlgo. Guest accounts may sign at most 5 documents per UTC day across signHash, signDoc and signDocBasic (each hash counts); a signature made as an invited signer of another person's sign-request.html request is given back. The counter is not charged when signing fails.",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "credentialID": {
                    "type": "string"
                  },
                  "SAD": {
                    "type": "string"
                  },
                  "hash": {
                    "oneOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "contentEncoding": "base64"
                        },
                        "maxItems": 10
                      },
                      {
                        "type": "string",
                        "contentEncoding": "base64"
                      }
                    ]
                  },
                  "hashes": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "contentEncoding": "base64"
                    },
                    "description": "Alias of hash"
                  },
                  "hashAlgo": {
                    "type": "string",
                    "default": "2.16.840.1.101.3.4.2.1"
                  },
                  "hashAlgorithmOID": {
                    "type": "string",
                    "description": "Alias of hashAlgo"
                  },
                  "signAlgo": {
                    "type": "string",
                    "default": "1.2.840.10045.4.3.2"
                  }
                },
                "required": [
                  "credentialID",
                  "SAD",
                  "hash"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "One base64 signature per hash, in request order",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "signatures": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "contentEncoding": "base64"
                      }
                    }
                  },
                  "required": [
                    "signatures"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request: credentialID_required, SAD_required, hash_required, hash_empty, too_many_hashes, SAD_invalid:*, SAD_aud_mismatch, SAD_expired, SAD_iat_future, SAD_iat_too_old, SAD_sub_mismatch, SAD_credentialID_mismatch, SAD_hash_missing, SAD_hash_count_mismatch, SAD_hash_content_mismatch, credentialID_unknown, hash_must_be_sha256_32bytes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "401": {
            "description": "invalid_token: bearer_required or introspect_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                },
                "description": "Bearer realm=\"codeb-csc\""
              }
            }
          },
          "403": {
            "description": "https_required (plain HTTP), or access_denied: the token belongs to a guest account that was deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "413": {
            "description": "invalid_request / body_too_large (request body over the cap)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (30 per minute per IP), or quota_exceeded: a guest account reached its daily limit; Retry-After = seconds until 00:00 UTC",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "500": {
            "description": "server_error / crypto module error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "501": {
            "description": "crypto_module_not_configured: the tenant has no signing module",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable: the guest limit could not be checked; signing is refused rather than unlimited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          }
        },
        "x-codeb-audience": "signed-in"
      }
    },
    "/csc/v2/signatures/signDoc": {
      "post": {
        "tags": [
          "csc-signing"
        ],
        "operationId": "cscSignDoc",
        "summary": "Sign whole PDFs server-side (PAdES B-B / B-T / B-LT / B-LTA)",
        "description": "Takes up to 10 base64 PDFs, adds a PAdES signature as an incremental update and returns the signed PDFs. B-LT adds a /DSS with certificates and OCSP/CRL data for the signer and time-stamp chains; B-LTA adds a document time stamp. The highest level actually reached is reported per document in conformanceLevels and in the X-CSC-Effective-Level header. The SAD must be valid for the same user and credential and allow at least as many signatures as documents (the document hashes are computed server-side, so the SAD's hash list is not compared). Encrypted PDFs are refused. Body cap 10 MB. The guest daily limit applies (each document counts).",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "credentialID": {
                    "type": "string"
                  },
                  "SAD": {
                    "type": "string"
                  },
                  "documents": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 10,
                    "items": {
                      "type": "object",
                      "properties": {
                        "document": {
                          "type": "string",
                          "contentEncoding": "base64",
                          "description": "The PDF"
                        },
                        "signature_format": {
                          "type": "string",
                          "const": "P",
                          "default": "P"
                        },
                        "conformance_level": {
                          "type": "string",
                          "description": "AdES-B-B, AdES-B-T, AdES-B-LT or AdES-B-LTA (case-insensitive; PAdES- prefix and short B-x forms accepted). Omitted: AdES-B-T, which falls back to B-B when the time-stamp authority is unreachable."
                        },
                        "signed_envelope_property": {
                          "type": "string",
                          "enum": [
                            "Revision",
                            "Approval"
                          ],
                          "default": "Approval"
                        },
                        "container": {
                          "type": "string",
                          "const": "No"
                        },
                        "signAlgo": {
                          "type": "string",
                          "enum": [
                            "1.2.840.10045.4.3.2",
                            "1.2.840.113549.1.1.11"
                          ]
                        },
                        "parameters": {
                          "type": "object",
                          "properties": {
                            "signing_time": {
                              "type": "string",
                              "description": "ISO 8601"
                            },
                            "signing_reason": {
                              "type": "string"
                            },
                            "signing_location": {
                              "type": "string"
                            },
                            "contact_info": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "required": [
                        "document"
                      ]
                    }
                  }
                },
                "required": [
                  "credentialID",
                  "SAD",
                  "documents"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Signed PDFs",
            "headers": {
              "X-CSC-Effective-Level": {
                "schema": {
                  "type": "string"
                },
                "description": "Comma-separated effective levels"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "documentWithSignature": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "contentEncoding": "base64"
                      }
                    },
                    "signatureObject": {
                      "type": "null"
                    },
                    "responseID": {
                      "type": "null"
                    },
                    "conformanceLevels": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CscSignDocLevel"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_request (SAD_* errors, documents_empty, too_many_documents, pdf_base64_invalid, unsupported_signAlgo, ...), unsupported_signature_format, unsupported_conformance_level, pdf_encrypted_unsupported, pdf_parse_error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "401": {
            "description": "invalid_token: bearer_required or introspect_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                },
                "description": "Bearer realm=\"codeb-csc\""
              }
            }
          },
          "403": {
            "description": "https_required (plain HTTP), or access_denied: the token belongs to a guest account that was deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "413": {
            "description": "invalid_request / body_too_large (request body over the cap)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited, or quota_exceeded for a guest account (Retry-After = seconds until 00:00 UTC)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "500": {
            "description": "server_error / crypto module error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "501": {
            "description": "crypto_module_not_configured: the tenant has no signing module",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "502": {
            "description": "tsa_upstream_failed: an explicitly requested B-T/B-LT/B-LTA could not get a time stamp",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable: guest limit check unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          }
        },
        "x-codeb-audience": "signed-in"
      }
    },
    "/csc/v2/signatures/signDocBasic": {
      "post": {
        "tags": [
          "csc-signing"
        ],
        "operationId": "cscSignDocBasic",
        "summary": "Sign one raw PDF with username + password (opt-in per tenant)",
        "description": "Convenience endpoint for scripts: POST the raw PDF (application/pdf, up to 10 MB) with HTTP Basic credentials of a tenant account and get the signed PDF back. Off unless the operator enables it for the tenant (501 not_configured otherwise). Requested level defaults to AdES-B-LTA and degrades automatically (for example to B-B when the time-stamp authority is unreachable); requested and effective levels are returned in headers. Every authentication failure returns the same 401 body. The guest daily limit applies (one document per call).",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "level",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "AdES-B-LTA"
            },
            "description": "AdES-B-B, AdES-B-T, AdES-B-LT or AdES-B-LTA (PAdES- prefix and short forms accepted)"
          },
          {
            "name": "reason",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "location",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "contact",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "cscUserBasic": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/pdf": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The signed PDF",
            "headers": {
              "X-CSC-Requested-Level": {
                "schema": {
                  "type": "string"
                }
              },
              "X-CSC-Effective-Level": {
                "schema": {
                  "type": "string"
                }
              },
              "X-CSC-Level-Note": {
                "schema": {
                  "type": "string"
                },
                "description": "Why the effective level is lower"
              },
              "X-CSC-Byte-Range": {
                "schema": {
                  "type": "string"
                }
              },
              "X-CSC-Signed-Bytes": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request (body_empty, read_body_failed), unsupported_conformance_level, pdf_encrypted_unsupported, pdf_parse_error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "401": {
            "description": "invalid_credentials (WWW-Authenticate: Basic realm=\"codeb-csc\")",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "403": {
            "description": "https_required, or access_denied for a deleted guest account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "405": {
            "description": "post_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "413": {
            "description": "body_too_large / pdf_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited, or quota_exceeded for a guest account (Retry-After = seconds until 00:00 UTC)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "500": {
            "description": "server_error / crypto_module_error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "501": {
            "description": "not_configured (the endpoint is not enabled for this tenant) or crypto_module_not_configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable: guest limit check unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          }
        },
        "x-codeb-audience": "signed-in"
      }
    },
    "/csc/v2/signatures/timestamp": {
      "post": {
        "tags": [
          "csc-signing"
        ],
        "operationId": "cscTimestamp",
        "summary": "Get an RFC 3161 time stamp for a hash (TSA proxy)",
        "description": "Proxies an RFC 3161 time-stamp request for one SHA-256 hash to the operator-configured time-stamp authority, with a configured fallback when the first one does not answer, and returns the DER TimeStampToken (as token and, under the CSC v2 name, timestamp). Used to raise a client-assembled PAdES signature from B-B to B-T. Signs nothing with the user's key. A nonce is generated when none is sent.",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "hash": {
                    "type": "string",
                    "contentEncoding": "base64",
                    "description": "32-byte SHA-256 hash, standard base64"
                  },
                  "hashAlgo": {
                    "type": "string",
                    "const": "2.16.840.1.101.3.4.2.1",
                    "default": "2.16.840.1.101.3.4.2.1"
                  },
                  "nonce": {
                    "type": "string",
                    "description": "Optional hex nonce"
                  }
                },
                "required": [
                  "hash"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Time stamp",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscTimestampResponse"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request: invalid_json, hash_required, hash_must_be_sha256_32bytes, only_sha256_supported",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "401": {
            "description": "invalid_token: bearer_required or introspect_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                },
                "description": "Bearer realm=\"codeb-csc\""
              }
            }
          },
          "403": {
            "description": "https_required (plain HTTP), or access_denied: the token belongs to a guest account that was deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "413": {
            "description": "invalid_request / body_too_large (request body over the cap)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited: more than 30 requests per minute from one IP address for this action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "500": {
            "description": "invalid_tsa_url (operator configuration error) or server_error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "502": {
            "description": "tsa_upstream_failed: no time-stamp authority answered with a valid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          }
        },
        "x-codeb-audience": "signed-in"
      }
    },
    "/csc/v2/signatures/validationData": {
      "post": {
        "tags": [
          "csc-signing"
        ],
        "operationId": "cscValidationData",
        "summary": "Validation data (certs, OCSP, CRLs) for a client-built PAdES B-LT",
        "description": "Extension, not part of CSC v2. For clients that assemble the signed PDF themselves: returns the certificates, OCSP responses and CRLs a PAdES B-LT /DSS needs for the caller's own signing certificate and for the time-stamp authority of the given token. The token must be a valid RFC 3161 token, at most 2 hours old, from a time-stamp authority this server obtained or issued tokens from itself. Extra limit: 20 calls per 10 minutes per user.",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "credentialID": {
                    "type": "string"
                  },
                  "timestampToken": {
                    "type": "string",
                    "contentEncoding": "base64",
                    "description": "DER RFC 3161 TimeStampToken (64 bytes to 16 KB)"
                  },
                  "includeSigner": {
                    "type": "boolean",
                    "default": true,
                    "description": "false for a document time stamp (only the TSA chain)"
                  }
                },
                "required": [
                  "credentialID",
                  "timestampToken"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Validation data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscValidationData"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request: credentialID_required, malformed_credentialID, credentialID_unknown, timestampToken_required, timestampToken_malformed, timestampToken_signer_not_in_token, timestampToken_unknown_tsa, timestampToken_not_fresh, timestampToken_invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "401": {
            "description": "invalid_token: bearer_required or introspect_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                },
                "description": "Bearer realm=\"codeb-csc\""
              }
            }
          },
          "403": {
            "description": "https_required (plain HTTP), or access_denied: the token belongs to a guest account that was deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "413": {
            "description": "invalid_request / body_too_large (request body over the cap)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (per IP, or 20 per 10 minutes per user; Retry-After 60)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "500": {
            "description": "server_error / crypto module error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "501": {
            "description": "crypto_module_not_configured: the tenant has no signing module",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          }
        },
        "x-codeb-audience": "signed-in"
      }
    },
    "/csc/v2/signatures/tsa": {
      "post": {
        "tags": [
          "csc-signing"
        ],
        "operationId": "cscTsa",
        "summary": "RFC 3161 time-stamp authority of the tenant (DER in, DER out)",
        "description": "The tenant's own time-stamp authority: POST a DER TimeStampReq (application/timestamp-query, up to 32 KB) and receive a DER TimeStampResp signed with the tenant's time-stamping certificate. SHA-256, SHA-384 and SHA-512 message imprints are accepted; the nonce is echoed; the certificate is included when certReq is set. Self-signed responder certificate and a private policy OID: designed to follow RFC 3161; not a qualified time-stamp service. No authentication; per-IP rate limit 30 per minute.",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/timestamp-query": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "TimeStampResp, status granted",
            "content": {
              "application/timestamp-reply": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "TimeStampResp with status rejection (badAlg or badDataFormat)",
            "content": {
              "application/timestamp-reply": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "403": {
            "description": "https_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "405": {
            "description": "post_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "413": {
            "description": "body_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "500": {
            "description": "TimeStampResp with status rejection (systemFailure)",
            "content": {
              "application/timestamp-reply": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          }
        },
        "x-codeb-audience": "public"
      }
    },
    "/csc/v2/ocsp": {
      "get": {
        "tags": [
          "csc-signing"
        ],
        "operationId": "cscOcspGet",
        "summary": "OCSP responder for the per-user signing certificates (GET)",
        "description": "RFC 6960 responder for the signing certificates this tenant issues (enables PAdES B-LT). GET form: ?req=<base64 DER OCSPRequest> (URL-encoded). Only the first request in requestList is answered; status good, revoked or unknown; nextUpdate is one hour after thisUpdate; the nonce extension is echoed. Protocol errors are OCSP responses with responseStatus malformedRequest (1) or internalError (2), served with HTTP 200. No authentication.",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "req",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Base64 of the DER OCSPRequest"
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "OCSPResponse (DER)",
            "content": {
              "application/ocsp-response": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "403": {
            "description": "https_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "429": {
            "description": "OCSPResponse with responseStatus tryLater (3)",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            },
            "content": {
              "application/ocsp-response": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          }
        },
        "x-codeb-audience": "public"
      },
      "post": {
        "tags": [
          "csc-signing"
        ],
        "operationId": "cscOcspPost",
        "summary": "OCSP responder for the per-user signing certificates (POST)",
        "description": "Same responder, POST form: body is the DER OCSPRequest (application/ocsp-request, up to 32 KB). Other HTTP methods get 405 with an OCSP malformedRequest body.",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/ocsp-request": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OCSPResponse (DER); malformedRequest for an oversized or unreadable request",
            "content": {
              "application/ocsp-response": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "403": {
            "description": "https_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed (Allow: GET, POST)",
            "content": {
              "application/ocsp-response": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "429": {
            "description": "OCSPResponse with responseStatus tryLater (3)",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            },
            "content": {
              "application/ocsp-response": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          }
        },
        "x-codeb-audience": "public"
      }
    },
    "/rqes/csc/v2/signatures/timestamp": {
      "post": {
        "tags": [
          "csc-rqes"
        ],
        "operationId": "cscRqesTimestamp",
        "summary": "TSA proxy for EU wallets: RFC 3161 time stamp for one hash",
        "description": "Proxies an RFC 3161 time-stamp request for one SHA-256 hash to the operator-configured time-stamp authority, with a configured fallback when the first one does not answer, and returns the DER TimeStampToken (as token and, under the CSC v2 name, timestamp). Used to raise a client-assembled PAdES signature from B-B to B-T. Signs nothing with the user's key. A nonce is generated when none is sent. Reachable with the service or credential token from /csc/rqes/oauth2/token (or an OIDC access token); it mints no SAD and consumes no signature.",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "security": [
          {
            "cscServiceToken": []
          },
          {
            "cscCredentialToken": []
          },
          {
            "oidcBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "hash": {
                    "type": "string",
                    "contentEncoding": "base64",
                    "description": "32-byte SHA-256 hash, standard base64"
                  },
                  "hashAlgo": {
                    "type": "string",
                    "const": "2.16.840.1.101.3.4.2.1",
                    "default": "2.16.840.1.101.3.4.2.1"
                  },
                  "nonce": {
                    "type": "string",
                    "description": "Optional hex nonce"
                  }
                },
                "required": [
                  "hash"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Time stamp",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscTimestampResponse"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request: invalid_json, hash_required, hash_must_be_sha256_32bytes, only_sha256_supported",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "401": {
            "description": "invalid_token: missing or invalid access token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                },
                "description": "Bearer realm=\"codeb-csc\""
              }
            }
          },
          "403": {
            "description": "https_required, or access_denied: the account was deleted (no token of a deleted guest account reaches any CSC action)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "413": {
            "description": "body_too_large (over 32 KB)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited: more than 30 requests per minute per IP for this action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "500": {
            "description": "invalid_tsa_url (operator configuration error) or server_error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "502": {
            "description": "tsa_upstream_failed: no time-stamp authority answered with a valid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          }
        },
        "x-codeb-audience": "wallet"
      }
    },
    "/csc/rqes/oauth2/revoke": {
      "post": {
        "tags": [
          "csc-rqes"
        ],
        "operationId": "cscRqesRevokeOauth2Path",
        "summary": "Token revocation (RFC 7009), same as /csc/rqes/revoke",
        "description": "Alias of POST /csc/rqes/revoke at the same base as the other OAuth endpoints. Client authentication is optional; with it, only that client's tokens are revoked. Always 200 (also for unknown tokens) unless the client credentials are wrong.",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "security": [
          {
            "cscClientBasic": []
          },
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string"
                  }
                },
                "required": [
                  "token"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Revoked (also returned for unknown tokens)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "invalid_client (WWW-Authenticate: Basic realm=\"csc-rqes\")",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "405": {
            "description": "post_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            }
          },
          "429": {
            "description": "slow_down",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          }
        },
        "x-codeb-audience": "wallet"
      }
    },
    "/csc-rqes-admin.ashx?action=status": {
      "post": {
        "tags": [
          "csc-rqes-admin"
        ],
        "operationId": "cscRqesAdminStatus",
        "summary": "Wallet remote-signing client: settings without the secret",
        "description": "Returns the RSSP endpoint for wallets, the OAuth base, the tenant's time-stamp authority URL, the client id, redirect URIs, secret length and last rotation time. Superuser only (OIDC access token whose role is superuser). POST, body at most 4 KB, responses not cached.",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminStatus"
                }
              }
            }
          },
          "400": {
            "description": "bad_tenant or bad_action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            }
          },
          "401": {
            "description": "bearer_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            }
          },
          "403": {
            "description": "superuser_required (invalid token or role is not superuser) or https_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            }
          },
          "405": {
            "description": "method_not_allowed: POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            }
          },
          "413": {
            "description": "body_too_large (over 4 KB)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited: 30 requests per minute per IP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "500": {
            "description": "server_error: the clients file could not be read or written",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            }
          }
        },
        "x-codeb-audience": "admin"
      }
    },
    "/csc-rqes-admin.ashx?action=create": {
      "post": {
        "tags": [
          "csc-rqes-admin"
        ],
        "operationId": "cscRqesAdminCreate",
        "summary": "Create the wallet remote-signing client",
        "description": "Creates the tenant's wallet client (same result as the first sign-in call) when it does not exist yet, then returns the settings. Audited. Superuser only (OIDC access token whose role is superuser). POST, body at most 4 KB, responses not cached.",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Settings after creation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminStatus"
                }
              }
            }
          },
          "400": {
            "description": "bad_tenant or bad_action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            }
          },
          "401": {
            "description": "bearer_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            }
          },
          "403": {
            "description": "superuser_required (invalid token or role is not superuser) or https_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            }
          },
          "405": {
            "description": "method_not_allowed: POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            }
          },
          "409": {
            "description": "tenant_not_provisioned",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            }
          },
          "413": {
            "description": "body_too_large (over 4 KB)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited: 30 requests per minute per IP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "500": {
            "description": "server_error: the clients file could not be read or written",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            }
          }
        },
        "x-codeb-audience": "admin"
      }
    },
    "/csc-rqes-admin.ashx?action=reveal": {
      "post": {
        "tags": [
          "csc-rqes-admin"
        ],
        "operationId": "cscRqesAdminReveal",
        "summary": "Reveal the wallet client secret (audited)",
        "description": "Returns the client secret and the ready-to-paste wallet build line. Every reveal is written to the tenant's audit log (without the secret). Superuser only (OIDC access token whose role is superuser). POST, body at most 4 KB, responses not cached.",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Secret",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "client_id": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string",
                      "description": "The client secret"
                    },
                    "wallet_line": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad_tenant or bad_action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            }
          },
          "401": {
            "description": "bearer_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            }
          },
          "403": {
            "description": "superuser_required (invalid token or role is not superuser) or https_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            }
          },
          "404": {
            "description": "no_client: the wallet client has not been created yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            }
          },
          "405": {
            "description": "method_not_allowed: POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            }
          },
          "413": {
            "description": "body_too_large (over 4 KB)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited: 30 requests per minute per IP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "500": {
            "description": "server_error: the clients file could not be read or written",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            }
          }
        },
        "x-codeb-audience": "admin"
      }
    },
    "/csc-rqes-admin.ashx?action=rotate": {
      "post": {
        "tags": [
          "csc-rqes-admin"
        ],
        "operationId": "cscRqesAdminRotate",
        "summary": "Rotate the wallet client secret (audited)",
        "description": "Generates a new client secret; the old one is refused at /csc/rqes/oauth2/token from then on, so wallet builds carrying it stop working. Audited. Superuser only (OIDC access token whose role is superuser). POST, body at most 4 KB, responses not cached.",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "confirm": {
                    "type": "string",
                    "const": "rotate"
                  }
                },
                "required": [
                  "confirm"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Settings after rotation (rotated=true)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminStatus"
                }
              }
            }
          },
          "400": {
            "description": "confirm_required, bad_tenant or bad_action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            }
          },
          "401": {
            "description": "bearer_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            }
          },
          "403": {
            "description": "superuser_required (invalid token or role is not superuser) or https_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            }
          },
          "404": {
            "description": "no_client",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            }
          },
          "405": {
            "description": "method_not_allowed: POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            }
          },
          "413": {
            "description": "body_too_large (over 4 KB)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited: 30 requests per minute per IP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "500": {
            "description": "server_error: the clients file could not be read or written",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CscRqesAdminError"
                }
              }
            }
          }
        },
        "x-codeb-audience": "admin"
      }
    },
    "/captcha.ashx": {
      "get": {
        "tags": [
          "site-forms"
        ],
        "operationId": "siteCaptchaChallenge",
        "summary": "Get a stateless arithmetic spam-check challenge",
        "description": "Issues a small addition question plus an HMAC-signed token that carries the expected answer and a 15-minute expiry. No session or cookie; the token is echoed back as `captcha_token` (with the user's `captcha_answer`) on POST /signup.ashx and POST /contact.ashx, which verify it before applying their rate limits. The handler does not check the HTTP method. Responses carry Cache-Control: no-store. No third-party CAPTCHA service is involved.",
        "security": [],
        "x-codeb-audience": "public",
        "responses": {
          "200": {
            "description": "Challenge",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteCaptchaChallenge"
                }
              }
            }
          },
          "503": {
            "description": "Signing key unavailable (error captcha_misconfigured)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ]
      }
    },
    "/signup.ashx": {
      "post": {
        "tags": [
          "site-forms"
        ],
        "operationId": "siteSignup",
        "summary": "Create a disabled guest account and mail an activation link",
        "description": "Same code path as the website signup form. Creates the user on this tenant with role `guest` and `disabled=true`, stores a one-time activation token (valid 7 days) and drops an activation e-mail for the given address through the local mail pickup. The account cannot sign in until GET /activate.ashx?token=... is opened.\n\nThe plaintext password never reaches the server: the client sends `ha1 = MD5(user + ':' + realm + ':' + password)` as 32 lower-case hex, where realm is the tenant host the page is served from (window.location.host). Order of checks: field validation, reserved names, spam check (`captcha_token` + `captcha_answer` from GET /captcha.ashx), then the per-IP rate limit of 3 signups per hour (client IP taken from the first X-Forwarded-For entry when present).",
        "security": [],
        "x-codeb-audience": "public",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Login name, lower-cased by the server; ^[a-z0-9_.-]{1,64}$; reserved names (admin, root, system, codeb-admin and the tenant's configured list) are refused",
                    "pattern": "^[a-z0-9_.\\-]{1,64}$"
                  },
                  "name": {
                    "type": "string",
                    "description": "Display name, 1-120 chars; must contain a letter, no control characters, no run of 3+ symbols, balanced () and []",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "email": {
                    "type": "string",
                    "description": "E-mail address for the activation link; 3-200 chars, exactly one @, no spaces or , ; < > \" \\",
                    "maxLength": 200
                  },
                  "ha1": {
                    "type": "string",
                    "description": "MD5(user:realm:password) as 32 hex characters",
                    "pattern": "^[0-9a-f]{32}$"
                  },
                  "captcha_token": {
                    "type": "string",
                    "description": "token from GET /captcha.ashx"
                  },
                  "captcha_answer": {
                    "type": "string",
                    "description": "the user's answer to the captcha question"
                  }
                },
                "required": [
                  "user",
                  "name",
                  "email",
                  "ha1",
                  "captcha_token",
                  "captcha_answer"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Account created (disabled) and activation e-mail queued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "user": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "ok",
                    "user"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation failure (error invalid_request) or failed spam check (error captcha_failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Not a POST (error method_not_allowed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Login name already taken, case-insensitive (error user_exists)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "More than 3 signups from this IP within an hour (error rate_limited)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Storage failure (server_error) or the account was created but the activation e-mail could not be queued (mailer_io)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ]
      }
    },
    "/activate.ashx": {
      "get": {
        "tags": [
          "site-forms"
        ],
        "operationId": "siteActivateAccount",
        "summary": "Consume a one-time activation link and enable the account",
        "description": "Target of the link in the signup e-mail. Looks up the token for this tenant, checks its 7-day expiry, sets the account to enabled, deletes the token (single use) and sends a best-effort welcome e-mail. Returns a small HTML page: on success it links to and auto-redirects (after about 2 seconds) to /login.html?activated=1; on failure it explains why and links back to the signup and contact pages. The handler does not check the HTTP method; responses carry Cache-Control: no-store.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 16
            },
            "description": "Activation token from the e-mail (43 base64url characters as issued; shorter than 16 is rejected)."
          }
        ],
        "responses": {
          "200": {
            "description": "HTML page: account activated",
            "content": {
              "text/html": {}
            }
          },
          "400": {
            "description": "HTML page: token missing/malformed, unknown or already used, expired, or the account record is missing",
            "content": {
              "text/html": {}
            }
          }
        }
      }
    },
    "/contact.ashx": {
      "post": {
        "tags": [
          "site-forms"
        ],
        "operationId": "siteContactSubmit",
        "summary": "Submit the website contact form",
        "description": "Validates the form, verifies the spam check, applies a per-IP limit of 5 submissions per hour (checked after the spam check, so failed challenges do not consume the budget) and queues the message as an e-mail to the tenant's configured contact address through the local mail pickup. The submitter's address becomes Reply-To. CR/LF in the subject are replaced with spaces. Responses carry Cache-Control: no-store.",
        "security": [],
        "x-codeb-audience": "public",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "required, max 120 chars",
                    "maxLength": 120
                  },
                  "email": {
                    "type": "string",
                    "description": "required, max 200 chars, single address (no spaces, quotes, commas, semicolons, colons or angle brackets)",
                    "maxLength": 200
                  },
                  "subject": {
                    "type": "string",
                    "description": "optional, max 200 chars",
                    "maxLength": 200
                  },
                  "message": {
                    "type": "string",
                    "description": "required, max 6000 chars",
                    "maxLength": 6000
                  },
                  "captcha_token": {
                    "type": "string",
                    "description": "token from GET /captcha.ashx"
                  },
                  "captcha_answer": {
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "email",
                  "message",
                  "captcha_token",
                  "captcha_answer"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Message queued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  },
                  "required": [
                    "ok"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Missing or too-long field or invalid e-mail (invalid_request), or failed spam check (captcha_failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Not a POST (method_not_allowed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "More than 5 submissions from this IP within an hour (rate_limited)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Mail pickup or recipient not configured (mailer_misconfigured) or the e-mail could not be written (mailer_io)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ]
      }
    },
    "/dnt-policy.txt": {
      "get": {
        "tags": [
          "well-known"
        ],
        "operationId": "getDntPolicyAlias",
        "summary": "Do Not Track policy (short alias, always the per-tenant version)",
        "description": "Convenience alias of /.well-known/dnt-policy.txt, always answered by dnt-policy.ashx: the request host is written into the policy text and the response carries `Tk: N`. Anonymous.",
        "security": [],
        "x-codeb-audience": "public",
        "responses": {
          "200": {
            "description": "Do Not Track policy text with the request host substituted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "X-Build-Version": {
                "description": "Handler build slug (changes with every behaviour change).",
                "schema": {
                  "type": "string"
                }
              },
              "X-Tenant": {
                "description": "Request host as parsed.",
                "schema": {
                  "type": "string"
                }
              },
              "Tk": {
                "description": "Tracking status: always N (not tracking).",
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "description": "public, max-age=3600",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ]
      }
    },
    "/indexnow.ashx?action=key-file": {
      "get": {
        "tags": [
          "indexnow"
        ],
        "operationId": "indexNowKeyFile",
        "summary": "IndexNow ownership key for this tenant (text/plain)",
        "description": "Public key file that search engines fetch to verify that URL submissions for this host come from its owner; this URL is sent as `keyLocation` with every submission. The key is generated and stored on the first request ([a-zA-Z0-9-], 8-128 chars). Cache-Control: public, max-age=3600. CORS: Access-Control-Allow-Origin *; OPTIONS answers 204.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "key-file"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The key",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "description": "Key could not be created or the stored key is invalid (text body)",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/indexnow.ashx?action=status": {
      "get": {
        "tags": [
          "indexnow"
        ],
        "operationId": "indexNowStatus",
        "summary": "IndexNow state for this tenant (key never returned)",
        "description": "Admin view: whether a key exists (masked to first and last 4 characters), its keyLocation, the last submission record and how many URLs the tenant's /sitemap.xml currently lists for this host. Requires an OIDC bearer whose userinfo role is admin or superuser.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "status"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "build": {
                      "type": "string"
                    },
                    "has_key": {
                      "type": "boolean"
                    },
                    "key_location": {
                      "type": "string",
                      "description": "URL of the key file",
                      "format": "uri"
                    },
                    "key_length": {
                      "type": "integer"
                    },
                    "key_masked": {
                      "type": "string"
                    },
                    "last_ping": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "Last submission: utc, url_count, http_status, ok, message, response_body"
                    },
                    "sitemap_url_count": {
                      "type": "integer"
                    },
                    "sitemap_url_sample": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "maxItems": 5
                    }
                  }
                }
              }
            }
          },
          "405": {
            "description": "Not a GET",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "401": {
            "description": "No Bearer token (bearer_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "403": {
            "description": "Token not valid or role is not admin/superuser (admin_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          }
        }
      }
    },
    "/indexnow.ashx?action=ping-preview": {
      "get": {
        "tags": [
          "indexnow"
        ],
        "operationId": "indexNowPingPreview",
        "summary": "List the URLs a submission would send",
        "description": "Admin dry run: the <loc> URLs from this tenant's /sitemap.xml that point at this host, de-duplicated. Requires an admin or superuser bearer.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "ping-preview"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "URL list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "urls": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "405": {
            "description": "Not a GET",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "401": {
            "description": "No Bearer token (bearer_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "403": {
            "description": "Token not valid or role is not admin/superuser (admin_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          }
        }
      }
    },
    "/indexnow.ashx?action=ping": {
      "post": {
        "tags": [
          "indexnow"
        ],
        "operationId": "indexNowPing",
        "summary": "Submit this tenant's public URLs to IndexNow now",
        "description": "Admin action: posts every same-host URL from /sitemap.xml with the tenant key and keyLocation to the IndexNow endpoint and records the outcome (shown later by action=status). The platform also submits automatically about once a day unless the tenant opts out. Requires an admin or superuser bearer. No request body.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "ping"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Accepted by IndexNow",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "http_status": {
                      "type": "integer"
                    },
                    "url_count": {
                      "type": "integer"
                    },
                    "key_location": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "response_body": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Sitemap has no URLs for this host (no_urls) or unknown action (bad_action)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "405": {
            "description": "Not a POST",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "500": {
            "description": "Key could not be loaded (key_failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "502": {
            "description": "IndexNow rejected or could not be reached; same body shape as 200 with ok=false",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "http_status": {
                      "type": "integer"
                    },
                    "url_count": {
                      "type": "integer"
                    },
                    "key_location": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "response_body": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No Bearer token (bearer_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "403": {
            "description": "Token not valid or role is not admin/superuser (admin_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          }
        }
      }
    },
    "/compliance-config.ashx?action=public-render": {
      "get": {
        "tags": [
          "tenant-admin"
        ],
        "operationId": "complianceConfigPublic",
        "summary": "Operator GDPR documentation fields for public compliance pages",
        "description": "Unauthenticated, read-only. Returns the non-empty documentation fields the tenant operator has filled in (controller identity, DPO, DPIA, sign-off, records of processing, retention) so the public privacy and compliance pages can render them. The handler does not check the HTTP method. Cache-Control: no-store.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "public-render"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Fields",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "fields": {
                      "$ref": "#/components/schemas/SiteComplianceFields"
                    },
                    "last_updated_utc": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "ok",
                    "tenant",
                    "fields"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "No tenant host (tenant_host_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/compliance-config.ashx?action=get": {
      "get": {
        "tags": [
          "tenant-admin"
        ],
        "operationId": "complianceConfigGet",
        "summary": "Read the tenant's compliance documentation state",
        "description": "Admin. Returns the stored state (schema_version, tenant, fields, saved_at_utc, saved_by) plus `allowed_keys`. `action` may also be omitted. Requires an OIDC bearer that the tenant's introspection endpoint reports active with role admin or superuser (or is_admin, or an admin/superuser group).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "get"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "State",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "type": "integer"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "fields": {
                      "$ref": "#/components/schemas/SiteComplianceFields"
                    },
                    "saved_at_utc": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "saved_by": {
                      "type": "string"
                    },
                    "allowed_keys": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Not an admin bearer ({\"error\":\"admin sign-in required\"})",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/compliance-config.ashx?action=set": {
      "post": {
        "tags": [
          "tenant-admin"
        ],
        "operationId": "complianceConfigSet",
        "summary": "Update compliance documentation fields",
        "description": "Admin. Merges the submitted fields into the stored state: only keys from the allowed list are taken (others are counted as rejected), values are trimmed and cut at 8000 characters, and an empty value deletes the field. The body may be the field map itself or `{\"fields\": {...}}` (max 1 MB). The handler reads the body regardless of method; send POST.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "set"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/SiteComplianceFields"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "fields": {
                        "$ref": "#/components/schemas/SiteComplianceFields"
                      }
                    },
                    "required": [
                      "fields"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "accepted": {
                      "type": "integer"
                    },
                    "rejected": {
                      "type": "integer"
                    },
                    "stored": {
                      "type": "integer"
                    },
                    "saved_at_utc": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Empty body (empty_body), unparsable JSON (invalid_json) or unknown action (unknown_action)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Not an admin bearer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Storage failure (server_error)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/secrets.ashx?action=ping": {
      "get": {
        "tags": [
          "tenant-admin"
        ],
        "operationId": "secretsPing",
        "summary": "Liveness probe for the secrets vault handler",
        "description": "Unauthenticated liveness probe used by the superuser secrets page before it asks for a token. Returns no tenant data.",
        "security": [],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "ping"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Alive",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "build": {
                      "type": "string"
                    },
                    "time": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/secrets.ashx?action=list": {
      "post": {
        "tags": [
          "tenant-admin"
        ],
        "operationId": "secretsList",
        "summary": "List the tenant's stored secrets (names and lengths only)",
        "description": "Superuser only. Lists the registered secret files of this tenant and every tenant setting whose name ends in a secret-like word (password, secret, token, bearer, apikey, privatekey, clientsecret, hmackey, signingkey, encryptionkey), with a hint, whether a value is present and its length. Values are never included. The bearer is checked through the tenant's userinfo endpoint and must carry role superuser. CORS *; OPTIONS answers 204.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "list"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Secret inventory",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "build": {
                      "type": "string"
                    },
                    "entries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string",
                            "description": "Reveal key: file:<relative path> or appsettings:<setting name>"
                          },
                          "source": {
                            "type": "string"
                          },
                          "hint": {
                            "type": "string"
                          },
                          "has_value": {
                            "type": "boolean"
                          },
                          "value_length": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Unknown action (bad_action)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "401": {
            "description": "No Bearer token (bearer_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "403": {
            "description": "Bearer not valid or role is not superuser (superuser_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "405": {
            "description": "Method other than POST (method_not_allowed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          }
        }
      }
    },
    "/secrets.ashx?action=reveal": {
      "post": {
        "tags": [
          "tenant-admin"
        ],
        "operationId": "secretsReveal",
        "summary": "Reveal one secret value",
        "description": "Superuser only. Returns the value of exactly one secret named by a `key` from action=list. `file:` keys must be in the fixed registry of secret files; `appsettings:` keys must match the secret-name pattern. Every reveal is logged with the caller's subject. Body max 4096 bytes.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "reveal"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "description": "file:<relative path> or appsettings:<setting name>",
                    "maxLength": 200
                  }
                },
                "required": [
                  "key"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Secret value",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "key": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string"
                    },
                    "hint": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "ok",
                    "key",
                    "value"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Missing, too long or unknown-scheme key (bad_key) or not a secret setting (not_a_secret)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "404": {
            "description": "Key not in registry (unknown_key) or no value stored (missing)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "500": {
            "description": "Value could not be read (read_failed, parse_failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "401": {
            "description": "No Bearer token (bearer_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "403": {
            "description": "Bearer not valid or role is not superuser (superuser_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "405": {
            "description": "Method other than POST (method_not_allowed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          }
        }
      }
    },
    "/backup.ashx?action=ping": {
      "get": {
        "tags": [
          "tenant-admin"
        ],
        "operationId": "backupPing",
        "summary": "Liveness probe for the backup handler",
        "description": "Unauthenticated liveness probe used by the backup admin page. Returns no tenant data.",
        "security": [],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "ping"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Alive",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "build": {
                      "type": "string"
                    },
                    "time": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/backup.ashx?action=test": {
      "post": {
        "tags": [
          "tenant-admin"
        ],
        "operationId": "backupTest",
        "summary": "Test the tenant's WebDAV backup target",
        "description": "Superuser only. Checks that the configured WebDAV backup target (URL, user, app password, folder in the tenant settings) is reachable with the stored credentials. The bearer is checked through the tenant's userinfo endpoint and must carry role superuser; admin is not enough. CORS *; OPTIONS answers 204. GET is also accepted by the handler; POST is the documented method.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "test"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Target reachable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "folder": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Backup target settings incomplete (config_incomplete) or unknown action (bad_action)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "502": {
            "description": "Target not reachable; same shape with ok=false",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "folder": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No Bearer token (bearer_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "403": {
            "description": "Bearer not valid or role is not superuser (superuser_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          }
        }
      }
    },
    "/backup.ashx?action=backup": {
      "post": {
        "tags": [
          "tenant-admin"
        ],
        "operationId": "backupRun",
        "summary": "Zip the tenant's data folder and upload it to the backup target",
        "description": "Superuser only. Creates a zip of the tenant's data folder (excluding logs, call-recording audio, staging, local backup copies and temporary files) and uploads it to the configured WebDAV folder. When a retention period is configured, older backups created by this handler are deleted afterwards. Long-running; no request body.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "backup"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Backup uploaded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "zip": {
                      "type": "string",
                      "description": "Remote file name (codeb-backup-...zip)"
                    },
                    "files": {
                      "type": "integer"
                    },
                    "raw_bytes": {
                      "type": "integer"
                    },
                    "zip_bytes": {
                      "type": "integer"
                    },
                    "folder": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Backup target settings incomplete (config_incomplete) or unknown action (bad_action)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "404": {
            "description": "Tenant has no data folder (no_appdata)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "500": {
            "description": "Local staging or zip failure (staging_mkdir_failed, zip_failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "502": {
            "description": "Remote folder could not be created (mkcol_failed) or upload failed (upload_failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "401": {
            "description": "No Bearer token (bearer_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "403": {
            "description": "Bearer not valid or role is not superuser (superuser_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          }
        }
      }
    },
    "/backup.ashx?action=list": {
      "post": {
        "tags": [
          "tenant-admin"
        ],
        "operationId": "backupList",
        "summary": "List backups in the remote folder",
        "description": "Superuser only. Lists the files in the configured remote backup folder (sub-folders skipped).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "list"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Remote files",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "folder": {
                      "type": "string"
                    },
                    "entries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "size": {
                            "type": "integer"
                          },
                          "last_modified": {
                            "type": "string"
                          },
                          "is_our_zip": {
                            "type": "boolean",
                            "description": "true for files named codeb-backup-*.zip"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Backup target settings incomplete (config_incomplete) or unknown action (bad_action)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "401": {
            "description": "No Bearer token (bearer_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "403": {
            "description": "Bearer not valid or role is not superuser (superuser_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          }
        }
      }
    },
    "/backup.ashx?action=restore-download": {
      "post": {
        "tags": [
          "tenant-admin"
        ],
        "operationId": "backupRestoreDownload",
        "summary": "Restore step 1: fetch a backup into local staging",
        "description": "Superuser only. Downloads the named backup into the tenant's staging folder so it can be inspected. Nothing live is changed. Body max 4096 bytes.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "restore-download"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Backup file name from action=list; letters, digits, '-', '_' and '.' only, max 200, no '..'",
                    "pattern": "^[A-Za-z0-9._-]{1,200}$"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Staged",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "zip": {
                      "type": "string"
                    },
                    "staged_bytes": {
                      "type": "integer"
                    },
                    "staged_path": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Settings incomplete (config_incomplete) or missing/unsafe name (bad_name)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "500": {
            "description": "Staging folder could not be created (staging_mkdir_failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "502": {
            "description": "Download failed; same shape with ok=false",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "zip": {
                      "type": "string"
                    },
                    "staged_bytes": {
                      "type": "integer"
                    },
                    "staged_path": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No Bearer token (bearer_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "403": {
            "description": "Bearer not valid or role is not superuser (superuser_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          }
        }
      }
    },
    "/backup.ashx?action=restore-apply": {
      "post": {
        "tags": [
          "tenant-admin"
        ],
        "operationId": "backupRestoreApply",
        "summary": "Restore step 2: replace live tenant data with the staged backup",
        "description": "Superuser only, destructive. Requires a prior restore-download of the same name and `confirm: true`. Extracts the staged zip, renames the live tenant data folder to a timestamped pre-restore folder and moves the extracted data into place, so the previous state is always one rename away (the pre-restore folder is kept until an operator deletes it). Body max 4096 bytes.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "restore-apply"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Backup file name from action=list; letters, digits, '-', '_' and '.' only, max 200, no '..'",
                    "pattern": "^[A-Za-z0-9._-]{1,200}$"
                  },
                  "confirm": {
                    "const": true
                  }
                },
                "required": [
                  "name",
                  "confirm"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Restored",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "zip": {
                      "type": "string"
                    },
                    "files_restored": {
                      "type": "integer"
                    },
                    "pre_restore_dir": {
                      "type": "string"
                    },
                    "hint": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing/unsafe name (bad_name) or confirm not true (confirm_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "404": {
            "description": "Nothing staged under that name (not_staged)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "500": {
            "description": "Extraction or folder swap failed (extract_mkdir_failed, extract_failed, preserve_failed, promote_failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "401": {
            "description": "No Bearer token (bearer_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          },
          "403": {
            "description": "Bearer not valid or role is not superuser (superuser_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteOkError"
                }
              }
            }
          }
        }
      }
    },
    "/diag.ashx": {
      "post": {
        "tags": [
          "diagnostics"
        ],
        "operationId": "diagAppend",
        "summary": "Append client-side diagnostic log lines",
        "description": "Used by the conference and office pages (often via navigator.sendBeacon) to record WebRTC observability lines such as ICE and connection-state transitions. Anonymous. At most 100 entries per request are stored; each stored line is `<t> [<client ip>] [<s>] [<u>] <m>` cut at 600 characters. Lines go to an in-memory ring buffer (last 5000) and the tenant's client-diagnostics log file. Malformed JSON or bodies over 256 KB are silently ignored and answered with `{\"appended\":0}`.",
        "security": [],
        "x-codeb-audience": "public",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entries": {
                    "type": "array",
                    "maxItems": 100,
                    "items": {
                      "type": "object",
                      "properties": {
                        "t": {
                          "type": "string",
                          "description": "ISO 8601 time; server time is used when empty"
                        },
                        "s": {
                          "type": "string",
                          "description": "session or room context"
                        },
                        "u": {
                          "type": "string",
                          "description": "user context"
                        },
                        "m": {
                          "type": "string",
                          "description": "message"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Number of lines stored",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "appended": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "appended"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Unexpected failure (text/plain body)",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ]
      },
      "get": {
        "tags": [
          "diagnostics"
        ],
        "operationId": "diagTail",
        "summary": "Read the diagnostic ring buffer (admin)",
        "description": "Admin only, because the lines contain client IPs, session ids and user names. Returns the newest entries (oldest first within the window) as text with a short `#` header. Accepts an OIDC bearer that the tenant's admin check accepts, or X-CodeB-Admin-Signature with HMAC bucket `diag` (hex HMAC-SHA256 of `diag|<host>`). Any method other than POST is treated as this read. Cache-Control: no-store.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "n",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 5000
            },
            "description": "Return at most the newest n matching entries (default all)."
          },
          {
            "name": "grep",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Case-insensitive substring filter."
          }
        ],
        "responses": {
          "200": {
            "description": "Log tail",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "No valid admin bearer or signature ({\"error\":\"admin auth required\"}; WWW-Authenticate: Bearer realm=\"codeb-diag\")",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sipprov.ashx?action=create-token": {
      "post": {
        "tags": [
          "sip-provisioning"
        ],
        "operationId": "sipProvCreateToken",
        "summary": "Mint a single-use softphone provisioning link",
        "description": "Admin. Stores the SIP account details server-side and returns a short-lived, single-use URL to put in a QR code instead of the SIP password. The token is `<id>.<exp>.<sig>` where sig is an HMAC over id, expiry, tenant and a hash of AOR, password and format, so it cannot be re-bound to another account. TTL defaults to 900 s (configurable), minimum 30 s, capped at the configured maximum (default 86400 s). The bearer is checked through the tenant's token introspection (active and admin, or role admin/superuser, or listed as a tenant admin). Authentication is checked before the method, so a non-admin GET gets 401. The address, password and label must not contain control characters or line breaks and are limited to 256/256/128 characters; format must be zoiper, linphone or json (else 400).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "create-token"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "aor": {
                    "type": "string",
                    "description": "user@domain, or a bare user (domain = request host)"
                  },
                  "password": {
                    "type": "string"
                  },
                  "ttl": {
                    "type": "integer",
                    "description": "seconds"
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "zoiper",
                      "linphone",
                      "json"
                    ],
                    "default": "zoiper",
                    "description": "Default payload format: softphone XML account file, softphone .rc config file, or JSON envelope."
                  },
                  "label": {
                    "type": "string",
                    "description": "Account label shown in the softphone",
                    "default": "CodeB Softphone"
                  }
                },
                "required": [
                  "aor",
                  "password"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Link created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "description": "https://<host>/sipprov.ashx?t=<token>[&format=...]",
                      "format": "uri"
                    },
                    "exp": {
                      "type": "integer",
                      "description": "expiry, unix seconds"
                    },
                    "ttl": {
                      "type": "integer"
                    },
                    "format": {
                      "type": "string"
                    },
                    "aor": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Unparsable body (invalid_json), missing aor (aor_required) or password (password_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Not an admin bearer (admin_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Not a POST (method_not_allowed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sipprov.ashx?t=<token>": {
      "get": {
        "tags": [
          "sip-provisioning"
        ],
        "operationId": "sipProvRedeem",
        "summary": "Redeem a provisioning link (softphone side, single use)",
        "description": "Called by the softphone (or a device the user opens the link on). The token is the credential: it is checked for expiry, signature and tenant, then deleted before the body is written, so a second redemption gets 404. The payload contains the SIP password and is sent with Cache-Control: no-store, Referrer-Policy: no-referrer and X-Frame-Options: DENY. All formats point at SIP over TLS on port 5061. Control characters are removed from every field before it is written into the zoiper (XML), linphone or json format; an unknown format falls back to the one chosen when the link was made.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "t",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token from create-token."
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "zoiper",
                "linphone",
                "json"
              ]
            },
            "description": "Overrides the format stored with the token."
          }
        ],
        "responses": {
          "200": {
            "description": "Provisioning payload. format=zoiper: XML account file (attachment codeb-zoiper.xml); format=linphone: .rc file (attachment codeb.linphonerc); format=json: JSON envelope.",
            "content": {
              "application/xml": {
                "schema": {
                  "type": "string"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteSipProvEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Malformed token (malformed_token)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Signature, expiry or tenant mismatch (signature_mismatch, exp_mismatch, tenant_mismatch)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown or already redeemed (token_unknown_or_redeemed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Expired (token_expired)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sipprov.ashx?action=revoke": {
      "post": {
        "tags": [
          "sip-provisioning"
        ],
        "operationId": "sipProvRevoke",
        "summary": "Revoke an outstanding provisioning link",
        "description": "Admin. Deletes the stored record for `tid` so the link can no longer be redeemed. Answers 200 whether or not the record existed. The handler does not check the HTTP method.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "revoke"
              ]
            }
          },
          {
            "name": "tid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token id (first part of the token; see action=list)."
          }
        ],
        "responses": {
          "200": {
            "description": "Revoked",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "revoked": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "tid missing (tid_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Not an admin bearer (admin_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sipprov.ashx?action=list": {
      "get": {
        "tags": [
          "sip-provisioning"
        ],
        "operationId": "sipProvList",
        "summary": "List outstanding provisioning links (no passwords)",
        "description": "Admin. Lists links that have not been redeemed or revoked; expired records may still appear until redeemed or revoked.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "list"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Outstanding links",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "outstanding": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tid": {
                            "type": "string"
                          },
                          "aor": {
                            "type": "string"
                          },
                          "format": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "exp": {
                            "type": "integer"
                          },
                          "issued": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Not an admin bearer (admin_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/eudi-relying-party.json": {
      "get": {
        "tags": [
          "wallet-registration",
          "well-known"
        ],
        "operationId": "eudiRelyingPartyMetadata",
        "summary": "Public relying-party metadata for this tenant",
        "description": "Unauthenticated discovery document describing this tenant as a wallet relying party: did:web identifier, whether request objects are signed with a registry-issued or a self-signed certificate, the operator's public identity and supervisory-authority contact, entitlements, the credential types it requests, certificate fingerprints, registry record ids and links to the tenant's other discovery documents. Contains no private keys, passwords or contact details marked private. Cache-Control: public, max-age=300. Also answered at /eudiw-register.ashx?action=public-metadata.",
        "security": [],
        "x-codeb-audience": "public",
        "responses": {
          "200": {
            "description": "Metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteEudiRelyingPartyMetadata"
                }
              }
            }
          },
          "400": {
            "description": "No tenant host (tenant_host_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ]
      }
    },
    "/eudiw-register.ashx?action=cert-info": {
      "get": {
        "tags": [
          "wallet-registration"
        ],
        "operationId": "eudiwCertInfo",
        "summary": "Summary of the installed registry-issued relying-party certificate",
        "description": "Unauthenticated, read-only; feeds the public registration page. Reports whether a registry-issued relying-party certificate is installed and, if so, its public fields. Never returns key material, and never substitutes the self-signed fallback certificate. Includes load diagnostics (native_load, bc_load, cert_error) when the certificate cannot be read. Cache-Control: public, max-age=60.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "cert-info"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Certificate summary",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "cert_present": {
                      "type": "boolean"
                    },
                    "registry_base": {
                      "type": "string"
                    },
                    "generated_utc": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "cert_source": {
                      "type": "string",
                      "description": "Which loader read the file, or none"
                    },
                    "cert": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/SiteCertSummary"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "public_key_alg": {
                              "type": "string"
                            },
                            "public_key_alg_oid": {
                              "type": "string"
                            },
                            "public_key_bits": {
                              "type": "integer"
                            },
                            "signature_alg": {
                              "type": "string"
                            },
                            "version": {
                              "type": "integer"
                            },
                            "file_bytes": {
                              "type": "integer"
                            }
                          }
                        }
                      ]
                    },
                    "cert_error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "tenant",
                    "cert_present"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/eudiw-register.ashx?action=cert-download": {
      "get": {
        "tags": [
          "wallet-registration"
        ],
        "operationId": "eudiwCertDownload",
        "summary": "Download the relying-party certificate (public part, DER)",
        "description": "Unauthenticated. DER-encoded public certificate only, as attachment `<tenant>-wrp.cer`. Cache-Control: public, max-age=300.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "cert-download"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "DER certificate",
            "content": {
              "application/x-x509-ca-cert": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "No registry-issued certificate installed (wrp_p12_not_installed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Export failed (cert_export_failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Certificate file unreadable (wrp_p12_unreadable)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/eudiw-register.ashx?action=jar-signing-cert": {
      "get": {
        "tags": [
          "wallet-registration"
        ],
        "operationId": "eudiwJarSigningCert",
        "summary": "The certificate that currently signs OpenID4VP request objects",
        "description": "Unauthenticated. Shows exactly the certificate the verifier's request-object signer uses right now (registry-issued when installed and readable, otherwise the tenant's self-signed one), including the `x509_hash` client_id value (base64url SHA-256 of the DER) a wallet will compute. Cache-Control: public, max-age=30.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "jar-signing-cert"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Signer certificate",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SiteCertSummary"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "tenant": {
                          "type": "string"
                        },
                        "generated_utc": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "wrp_p12_on_disk": {
                          "type": "boolean"
                        },
                        "issuer_pfx_on_disk": {
                          "type": "boolean"
                        },
                        "cert_present": {
                          "type": "boolean"
                        },
                        "x509_hash_client_id_prefix": {
                          "type": "string",
                          "description": "base64url (no padding) SHA-256 of the certificate DER"
                        },
                        "is_self_signed": {
                          "type": "boolean"
                        },
                        "is_registry_issued": {
                          "type": "boolean",
                          "description": "heuristic based on the issuer name"
                        },
                        "source_hint": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        },
                        "load_error": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/eudiw-register.ashx?action=registry-lookup": {
      "get": {
        "tags": [
          "wallet-registration"
        ],
        "operationId": "eudiwRegistryLookup",
        "summary": "Look up this tenant's entry in the public relying-party registry",
        "description": "Unauthenticated, read-only proxy: fetches the registry's public relying-party list server-side, drops entries that look like placeholders or test records, and returns the entries matching this tenant's trade name or host. Upstream errors are reported in `error` with HTTP 200. Cache-Control: public, max-age=300.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "registry-lookup"
              ]
            }
          },
          {
            "name": "include_all",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "1 also returns the filtered full list as clean_list."
          }
        ],
        "responses": {
          "200": {
            "description": "Lookup result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "registry_url": {
                      "type": "string"
                    },
                    "trade_name_filter": {
                      "type": "string"
                    },
                    "generated_utc": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "upstream_bytes": {
                      "type": "integer"
                    },
                    "registry_total_wrps": {
                      "type": "integer"
                    },
                    "registry_clean_wrps": {
                      "type": "integer"
                    },
                    "registry_junk_wrps": {
                      "type": "integer"
                    },
                    "matches": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "match_count": {
                      "type": "integer"
                    },
                    "clean_list": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/eudiw-register.ashx?action=eu-issuer-status": {
      "get": {
        "tags": [
          "wallet-registration"
        ],
        "operationId": "eudiwReferenceIssuerStatus",
        "summary": "Reachability of the public reference test PID issuer",
        "description": "Unauthenticated. Server-side probe of the public reference issuer's credential-issuer metadata, used by the registration page (browsers cannot call it directly because of CORS). PID is a test credential. Cache-Control: public, max-age=60.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "eu-issuer-status"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Probe result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "issuer_url": {
                      "type": "string"
                    },
                    "checked_utc": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "up": {
                      "type": "boolean"
                    },
                    "http": {
                      "type": "integer"
                    },
                    "latency_ms": {
                      "type": "integer"
                    },
                    "body_bytes": {
                      "type": "integer"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/eudiw-register.ashx?action=de-registration": {
      "get": {
        "tags": [
          "wallet-registration"
        ],
        "operationId": "eudiwDeRegistration",
        "summary": "Registration state with the German sandbox registrar",
        "description": "Unauthenticated, read-only. Public half of the access certificate issued by the German sandbox registrar (subject, issuer, validity, SHA-256, `x509_hash` client_id, PEM) and the decoded registration certificate JWT that wallets also receive in `verifier_info`, with signature and binding checks. `vp_start_param` names the query parameter that makes a VP session use this registration.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "de-registration"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Registration state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "generated_utc": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "registrar": {
                      "type": "string"
                    },
                    "registrar_ca": {
                      "type": "string"
                    },
                    "vp_start_param": {
                      "type": "string"
                    },
                    "access_cert_present": {
                      "type": "boolean"
                    },
                    "access_certificate": {
                      "type": "object",
                      "properties": {
                        "subject": {
                          "type": "string"
                        },
                        "issuer": {
                          "type": "string"
                        },
                        "serial": {
                          "type": "string"
                        },
                        "not_before_utc": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "not_after_utc": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "valid_now": {
                          "type": "boolean"
                        },
                        "sha256": {
                          "type": "string"
                        },
                        "x509_hash_client_id": {
                          "type": "string"
                        },
                        "key_algorithm": {
                          "type": "string"
                        },
                        "pem": {
                          "type": "string"
                        },
                        "organization_identifier": {
                          "type": "string"
                        },
                        "organization": {
                          "type": "string"
                        }
                      }
                    },
                    "registration_cert_present": {
                      "type": "boolean"
                    },
                    "registration_certificate": {
                      "type": "object",
                      "properties": {
                        "typ": {
                          "type": "string"
                        },
                        "alg": {
                          "type": "string"
                        },
                        "payload": {
                          "type": "object"
                        },
                        "jwt": {
                          "type": "string"
                        },
                        "sha256": {
                          "type": "string"
                        },
                        "signer_subject": {
                          "type": "string"
                        },
                        "signer_issuer": {
                          "type": "string"
                        },
                        "signer_sha256": {
                          "type": "string"
                        },
                        "signature_valid": {
                          "type": "boolean"
                        },
                        "signer_issued_access_cert": {
                          "type": "boolean"
                        },
                        "sub_matches_access_cert": {
                          "type": "boolean"
                        },
                        "error": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/eudiw-register.ashx?action=de-cert-download": {
      "get": {
        "tags": [
          "wallet-registration"
        ],
        "operationId": "eudiwDeCertDownload",
        "summary": "Download the German sandbox access certificate (public part, DER)",
        "description": "Unauthenticated. DER of the access certificate only, as attachment `<tenant>-de-access-cert.cer`.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "de-cert-download"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "DER certificate",
            "content": {
              "application/pkix-cert": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "No access certificate installed (de_access_cert_not_installed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/eudiw-register.ashx?action=status": {
      "get": {
        "tags": [
          "wallet-registration"
        ],
        "operationId": "eudiwRegisterStatus",
        "summary": "Registration progress, config and certificate install state",
        "description": "Registration config, progress (registry record ids, certificate hashes), last run times, diagnostics of the last failed step and which certificate files are installed. `action` may also be omitted. Admin: OIDC bearer that the tenant's token introspection reports active with role admin or superuser (or is_admin, or an admin/superuser group). The handler does not check the HTTP method.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "status"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "type": "integer"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "registry_base": {
                      "type": "string"
                    },
                    "config": {
                      "type": [
                        "object",
                        "null"
                      ]
                    },
                    "progress": {
                      "type": "object"
                    },
                    "last_kickoff_utc": {
                      "type": "string"
                    },
                    "last_finalize_utc": {
                      "type": "string"
                    },
                    "hash_pid_present": {
                      "type": "boolean"
                    },
                    "last_error": {
                      "type": "string"
                    },
                    "last_failed_step": {
                      "type": "string"
                    },
                    "last_failed_url": {
                      "type": "string"
                    },
                    "last_failed_http_status": {
                      "type": "integer"
                    },
                    "last_failed_req_preview": {
                      "type": "string"
                    },
                    "last_failed_resp_preview": {
                      "type": "string"
                    },
                    "last_failed_at_utc": {
                      "type": "string"
                    },
                    "last_correlation_id": {
                      "type": "string"
                    },
                    "last_failed_resp_headers": {
                      "type": "string"
                    },
                    "last_failed_elapsed_ms": {
                      "type": "integer"
                    },
                    "last_finalize_started_utc": {
                      "type": "string"
                    },
                    "last_bug_report_markdown": {
                      "type": "string"
                    },
                    "install": {
                      "type": "object",
                      "description": "File presence and fingerprints of the installed certificates and which one the signer will prefer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Not an admin bearer ({\"error\":\"admin sign-in required\"})",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/eudiw-register.ashx?action=save-config": {
      "post": {
        "tags": [
          "wallet-registration"
        ],
        "operationId": "eudiwRegisterSaveConfig",
        "summary": "Save the relying-party registration details",
        "description": "Merges the submitted fields into the stored registration config (unknown keys are dropped) and returns the merged config with non-blocking warnings (identifier type outside the allowed list, placeholder identifier, country not two letters). Admin: OIDC bearer that the tenant's token introspection reports active with role admin or superuser (or is_admin, or an admin/superuser group). The handler does not check the HTTP method.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "save-config"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "law_identifier": {
                    "type": "string"
                  },
                  "identifier_value": {
                    "type": "string"
                  },
                  "identifier_type": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string"
                  },
                  "wrp_policy_uri": {
                    "type": "string"
                  },
                  "intended_use_policy_uri": {
                    "type": "string"
                  },
                  "provider_type": {
                    "type": "string"
                  },
                  "intended_use_identifier": {
                    "type": "string"
                  },
                  "intended_use_purpose_en": {
                    "type": "string"
                  },
                  "sa_name": {
                    "type": "string"
                  },
                  "sa_country": {
                    "type": "string"
                  },
                  "trade_name": {
                    "type": "string"
                  },
                  "registry_uri": {
                    "type": "string"
                  },
                  "description_en": {
                    "type": "string"
                  },
                  "legal_basis": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "legal_names": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "email": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "phone": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "postal_address": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "info_uri": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "sa_email": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "sa_form_uri": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "sa_phone": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "support_uri": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "entitlements": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "formats_provided": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "isPSB": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "config": {
                      "type": "object"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Unparsable (bad_json_body) or empty body (empty_body)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Not an admin bearer ({\"error\":\"admin sign-in required\"})",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/eudiw-register.ashx?action=begin": {
      "post": {
        "tags": [
          "wallet-registration"
        ],
        "operationId": "eudiwRegisterBegin",
        "summary": "Start registration: wallet authorisation QR from the registry",
        "description": "Asks the registry for a wallet presentation that authorises the operator, stores the presentation id and clears any earlier authorisation. The operator scans `qr_url` with a wallet, then polls. Admin: OIDC bearer that the tenant's token introspection reports active with role admin or superuser (or is_admin, or an admin/superuser group). The handler does not check the HTTP method.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "begin"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Started",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "qr_url": {
                      "type": "string"
                    },
                    "presentation_id": {
                      "type": "string"
                    },
                    "next": {
                      "const": "poll_or_scan"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Not an admin bearer ({\"error\":\"admin sign-in required\"})",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Registry unreachable or malformed answer (registry_unreachable, registry_kickoff_malformed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/eudiw-register.ashx?action=poll": {
      "get": {
        "tags": [
          "wallet-registration"
        ],
        "operationId": "eudiwRegisterPoll",
        "summary": "Check whether the wallet has authorised the registration",
        "description": "One poll round for the presentation started with action=begin; `pid` must be the one in progress. `upstream_probe` carries the registry's raw answer (status and up to 500 characters) for troubleshooting. Admin: OIDC bearer that the tenant's token introspection reports active with role admin or superuser (or is_admin, or an admin/superuser group). The handler does not check the HTTP method.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "poll"
              ]
            }
          },
          {
            "name": "pid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "presentation_id from begin"
          }
        ],
        "responses": {
          "200": {
            "description": "Poll result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "ready": {
                      "type": "boolean"
                    },
                    "pid": {
                      "type": "string"
                    },
                    "upstream_probe": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "pid missing (pid_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Not an admin bearer ({\"error\":\"admin sign-in required\"})",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Not the presentation in progress (pid_mismatch)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/eudiw-register.ashx?action=finalize": {
      "post": {
        "tags": [
          "wallet-registration"
        ],
        "operationId": "eudiwRegisterFinalize",
        "summary": "Complete registration and install the issued certificates",
        "description": "After the wallet has authorised, walks the registry's creation steps (identifier, legal entity, relying party, intended use) with the saved config, downloads the relying-party certificate (stored as a PKCS#12 protected with the given password) and the intended-use registration certificate, and installs both for this tenant. On a failed step the answer is 502 `registration_step_failed` with the step, the upstream request/response previews and a correlation id. Admin: OIDC bearer that the tenant's token introspection reports active with role admin or superuser (or is_admin, or an admin/superuser group). The handler does not check the HTTP method.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "finalize"
              ]
            }
          },
          {
            "name": "pid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "presentation_id from begin"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pwd": {
                    "type": "string",
                    "description": "Password for the stored PKCS#12 (min 12 characters). Sent in the body, never in the URL.",
                    "minLength": 12
                  }
                },
                "required": [
                  "pwd"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Registered",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "wrp_id": {
                      "type": "string"
                    },
                    "intended_use_id": {
                      "type": "string"
                    },
                    "wrp_p12_sha256": {
                      "type": "string"
                    },
                    "intended_use_jades_sha256": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "pid missing (pid_required) or password too short (pwd_min_12_chars_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Not an admin bearer ({\"error\":\"admin sign-in required\"})",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Not the presentation in progress (pid_mismatch)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Tenant issuer certificate missing (x5c_chain_empty)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Authorisation could not be fetched (fetch_hash_pid_failed) or a registry step failed (registration_step_failed, with failed_step, failed_url, failed_http_status, failed_req_preview, failed_resp_preview, correlation_id, progress)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/eudiw-register.ashx?action=redownload-certs": {
      "post": {
        "tags": [
          "wallet-registration"
        ],
        "operationId": "eudiwRegisterRedownloadCerts",
        "summary": "Fetch the issued certificates again without re-registering",
        "description": "Re-downloads both certificates for the existing registry records and replaces the installed files atomically, reusing the stored PKCS#12 password. Needs a fresh wallet authorisation: run begin, let the wallet authorise, then call this with that `pid`. Admin: OIDC bearer that the tenant's token introspection reports active with role admin or superuser (or is_admin, or an admin/superuser group). The handler does not check the HTTP method.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "redownload-certs"
              ]
            }
          },
          {
            "name": "pid",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "presentation_id from begin (needed when no authorisation is on record)"
          }
        ],
        "responses": {
          "200": {
            "description": "Replaced",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "wrp_p12_bytes": {
                      "type": "integer"
                    },
                    "jades_bytes": {
                      "type": "integer"
                    },
                    "wrp_p12_sha256": {
                      "type": "string"
                    },
                    "jades_sha256": {
                      "type": "string"
                    },
                    "next": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Not an admin bearer ({\"error\":\"admin sign-in required\"})",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "No authorisation, wrong pid, registry ids or stored password missing (no_hash_pid_on_record, pid_mismatch, missing_wallet_rp_or_intended_use_id, no_pwd_sidecar)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Files could not be written (atomic_write_failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Registry download failed (fetch_hash_pid_failed, intended_use_cert_download_failed, wrp_p12_download_failed, empty_cert_bytes)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/eudiw-register.ashx?action=revert": {
      "post": {
        "tags": [
          "wallet-registration"
        ],
        "operationId": "eudiwRegisterRevert",
        "summary": "Disable the registry-issued certificate (fall back to self-signed)",
        "description": "Operational recovery: renames the installed relying-party certificate so request objects are signed with the tenant's self-signed certificate again. Reversible by renaming the file back. Admin: OIDC bearer that the tenant's token introspection reports active with role admin or superuser (or is_admin, or an admin/superuser group). The handler does not check the HTTP method.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "revert"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Reverted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "reverted_to": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Not an admin bearer ({\"error\":\"admin sign-in required\"})",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing installed (wrp_p12_not_installed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Rename failed (revert_failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp-webhook": {
      "get": {
        "tags": [
          "chat-whatsapp"
        ],
        "operationId": "waWebhookVerify",
        "summary": "Webhook subscription verify handshake (messaging provider)",
        "description": "Called by the messaging provider when the webhook URL is registered. Echoes `hub.challenge` as text/plain when `hub.mode=subscribe` and `hub.verify_token` matches the tenant's verify token; any other GET gets 403 with a short explanatory text. Same handler as /whatsapp.ashx?action=webhook; this clean path exists because some provider builds append their parameters with a second `?`.",
        "security": [],
        "x-codeb-audience": "operator",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "hub.mode",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "subscribe"
              ]
            }
          },
          {
            "name": "hub.verify_token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Tenant verify token (see config-get)."
          },
          {
            "name": "hub.challenge",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The challenge, echoed",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Not a valid handshake",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Channel not configured or disabled for this tenant (not-configured)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "chat-whatsapp"
        ],
        "operationId": "waWebhookEvent",
        "summary": "Inbound message events from the messaging provider",
        "description": "Message and status events. The raw body must be signed by the provider: `X-Hub-Signature-256: sha256=<hex HMAC-SHA256 of the body with the tenant's app secret>`. Verified events are written to the channel audit trail and inbound messages are delivered to the tenant's shared WhatsApp inbox chat (and to the configured routing users and forward addresses). Body max 512 KB. Answers 200 `OK` quickly once the signature verifies, even if individual messages could not be ingested.",
        "security": [],
        "x-codeb-audience": "operator",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "X-Hub-Signature-256",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "sha256=<hex HMAC-SHA256(raw body, app secret)>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Provider webhook envelope (object, entry[].changes[].value with messages, contacts, statuses)."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "const": "OK"
                }
              }
            }
          },
          "400": {
            "description": "Empty or oversized body (empty-body)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "401": {
            "description": "Signature did not verify (bad-signature)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "404": {
            "description": "Channel not configured or disabled (not-configured)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "405": {
            "description": "Method other than GET/POST",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "500": {
            "description": "App secret missing in tenant config (no-secret)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp.ashx?action=send-external": {
      "post": {
        "tags": [
          "chat-whatsapp"
        ],
        "operationId": "waSendExternal",
        "summary": "Send a WhatsApp message with a channel API key (integrators)",
        "description": "For back-office systems: send a free-form text (only reaches users inside the provider's 24-hour customer-service window) or an approved template (`template`), authenticated with an API key minted by a tenant admin (header X-CodeB-WhatsApp-API-Key). A key can be bound to one template (and optionally one language); such a key cannot send free text or other templates (403). Every authentication failure gets the same 401 so callers cannot probe which tenants use the channel. The tenant's daily limit of new recipients applies (refusal reported in `localError`). Provider-side rejections are returned with HTTP 200 and ok=false. Recipient numbers in examples use the fictional +1555 range.",
        "security": [
          {
            "whatsappApiKey": []
          }
        ],
        "x-codeb-audience": "operator",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "send-external"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "type": "string",
                    "description": "Recipient number in international format, digits only",
                    "example": "15551234567"
                  },
                  "body": {
                    "type": "string",
                    "description": "Text message (when no template is given)"
                  },
                  "template": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "Approved template name"
                      },
                      "language": {
                        "description": "Language code, as a string (e.g. en_US) or {\"code\": \"en_US\"}; default en_US",
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "object",
                            "properties": {
                              "code": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "code"
                            ]
                          }
                        ]
                      },
                      "components": {
                        "type": "array",
                        "items": {
                          "type": "object"
                        },
                        "description": "Template components with parameter values; at most 3 parameters"
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "to"
                ]
              },
              "examples": {
                "text": {
                  "value": {
                    "to": "15551234567",
                    "body": "Your order has shipped."
                  }
                },
                "template": {
                  "value": {
                    "to": "15551234567",
                    "template": {
                      "name": "order_update",
                      "language": "en_US",
                      "components": [
                        {
                          "type": "body",
                          "parameters": [
                            {
                              "type": "text",
                              "text": "A-1001"
                            }
                          ]
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Send attempted; ok tells whether the provider accepted it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteWaSendResult"
                }
              }
            }
          },
          "400": {
            "description": "Bad JSON (bad-json), missing to/body/template.name (invalid_request) or more than 3 template parameters (too-many-parameters)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed (WWW-Authenticate: APIKey realm=\"codeb-whatsapp\")",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "403": {
            "description": "Key bound to a template: free text, another template or another language refused (template-required, template-mismatch, template-language-mismatch)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "405": {
            "description": "Not a POST",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp.ashx?action=templates-list-external": {
      "get": {
        "tags": [
          "chat-whatsapp"
        ],
        "operationId": "waTemplatesListExternal",
        "summary": "List approved templates usable with a channel API key",
        "description": "For integrators: the APPROVED templates this API key may send (only its bound template when the key is restricted), with placeholder metadata. Results are cached for 60 seconds. Same uniform 401 as send-external.",
        "security": [
          {
            "whatsappApiKey": []
          }
        ],
        "x-codeb-audience": "operator",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "templates-list-external"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Templates",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "templates": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SiteWaTemplate"
                      }
                    },
                    "maxPlaceholders": {
                      "type": "integer",
                      "const": 3
                    },
                    "keyId": {
                      "type": "string"
                    },
                    "boundTemplate": {
                      "type": "string"
                    },
                    "boundLanguage": {
                      "type": "string"
                    },
                    "unrestricted": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp.ashx?action=media": {
      "get": {
        "tags": [
          "chat-whatsapp"
        ],
        "operationId": "waMedia",
        "summary": "Fetch an inbound media attachment",
        "description": "Streams an image, audio, video, sticker or document that arrived on the channel, as referenced by messages in the WhatsApp inbox chat. Served from the tenant cache, or fetched from the provider and cached on first use. Content-Type and filename come from the cached metadata; Cache-Control: private, max-age=3600. Admin: OIDC bearer whose userinfo role is admin, superadmin or superuser, or X-CodeB-Admin-Signature with HMAC bucket `whatsapp` (hex HMAC-SHA256 of `whatsapp|<host>`). Errors are problem objects.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "media"
              ]
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            },
            "description": "Provider media id"
          }
        ],
        "responses": {
          "200": {
            "description": "Media bytes (Content-Disposition: inline)",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "id missing or invalid (invalid_request)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "404": {
            "description": "Channel not configured (not-configured) or media could not be fetched (media-not-cached)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "401": {
            "description": "No admin bearer or signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "403": {
            "description": "Bearer valid but not an admin (detail explains which check failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp.ashx?action=config-get": {
      "get": {
        "tags": [
          "chat-whatsapp"
        ],
        "operationId": "waConfigGet",
        "summary": "Read the tenant's WhatsApp channel configuration (secrets masked)",
        "description": "App secret and access token are masked; API keys are returned as metadata with a masked key. The verify token is returned in clear so it can be pasted into the provider dashboard. Admin: OIDC bearer whose userinfo role is admin, superadmin or superuser, or X-CodeB-Admin-Signature with HMAC bucket `whatsapp` (hex HMAC-SHA256 of `whatsapp|<host>`). Errors are problem objects.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "config-get"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteWaConfig"
                }
              }
            }
          },
          "401": {
            "description": "No admin bearer or signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "403": {
            "description": "Bearer valid but not an admin (detail explains which check failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp.ashx?action=config-set": {
      "post": {
        "tags": [
          "chat-whatsapp"
        ],
        "operationId": "waConfigSet",
        "summary": "Update the tenant's WhatsApp channel configuration",
        "description": "Writes only the listed fields (others are ignored); routingUsers, forwardEmails and newChatsPerDayLimit are normalised. A verify token is generated when none is set. Returns the new configuration exactly as config-get does. Body max 512 KB. Admin: OIDC bearer whose userinfo role is admin, superadmin or superuser, or X-CodeB-Admin-Signature with HMAC bucket `whatsapp` (hex HMAC-SHA256 of `whatsapp|<host>`). Errors are problem objects.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "config-set"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "appId": {
                    "type": "string"
                  },
                  "appSecret": {
                    "type": "string"
                  },
                  "wabaId": {
                    "type": "string"
                  },
                  "phoneNumberId": {
                    "type": "string"
                  },
                  "accessToken": {
                    "type": "string"
                  },
                  "verifyToken": {
                    "type": "string"
                  },
                  "senderPhone": {
                    "type": "string"
                  },
                  "senderDisplayName": {
                    "type": "string"
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "routingUsers": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "forwardEmails": {
                    "type": "string",
                    "description": "comma-separated"
                  },
                  "newChatsPerDayLimit": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved; masked configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteWaConfig"
                }
              }
            }
          },
          "400": {
            "description": "Empty body (empty-body) or not a JSON object (bad-json)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "401": {
            "description": "No admin bearer or signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "403": {
            "description": "Bearer valid but not an admin (detail explains which check failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp.ashx?action=send": {
      "post": {
        "tags": [
          "chat-whatsapp"
        ],
        "operationId": "waSendAdmin",
        "summary": "Send a test text message (admin console)",
        "description": "Sends a plain text (cut at 4096 characters) from the tenant's number. Always answers 200 when the request reached the provider; the provider's verdict is in the body. Admin: OIDC bearer whose userinfo role is admin, superadmin or superuser, or X-CodeB-Admin-Signature with HMAC bucket `whatsapp` (hex HMAC-SHA256 of `whatsapp|<host>`). Errors are problem objects.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "send"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "type": "string",
                    "description": "Recipient number, digits only",
                    "example": "15551234567"
                  },
                  "body": {
                    "type": "string",
                    "description": "Text, max 4096 characters"
                  }
                },
                "required": [
                  "to",
                  "body"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Provider answer",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "metaStatus": {
                      "type": "integer"
                    },
                    "resp": {
                      "description": "Provider response body"
                    },
                    "metaError": {
                      "type": "string"
                    },
                    "metaErrorCode": {
                      "type": "string"
                    },
                    "metaErrorSubcode": {
                      "type": "string"
                    },
                    "metaErrorDetails": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad JSON (bad-json), missing to/body (invalid_request) or number id/token not configured (not-fully-configured)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "404": {
            "description": "Channel not configured or disabled (not-configured)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "401": {
            "description": "No admin bearer or signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "403": {
            "description": "Bearer valid but not an admin (detail explains which check failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp.ashx?action=apikey-add": {
      "post": {
        "tags": [
          "chat-whatsapp"
        ],
        "operationId": "waApiKeyAdd",
        "summary": "Mint a channel API key for send-external",
        "description": "Creates a `wa_live_` key (shown once in this response, masked afterwards). Optionally binds it to one template name ([a-z0-9_]) and language, which limits what a leaked key can send. Max 32 keys per tenant. Admin: OIDC bearer whose userinfo role is admin, superadmin or superuser, or X-CodeB-Admin-Signature with HMAC bucket `whatsapp` (hex HMAC-SHA256 of `whatsapp|<host>`). Errors are problem objects.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "apikey-add"
              ]
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string",
                    "description": "max 64 chars, default unlabelled",
                    "maxLength": 64
                  },
                  "template": {
                    "type": "string",
                    "description": "bind to this template name",
                    "pattern": "^[a-z0-9_]{1,512}$"
                  },
                  "templateLanguage": {
                    "type": "string",
                    "description": "bind to this language code"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Key created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "id": {
                      "type": "string"
                    },
                    "key": {
                      "type": "string",
                      "description": "Full key; not retrievable later"
                    },
                    "label": {
                      "type": "string"
                    },
                    "createdUtc": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "warning": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid template name (invalid-template) or 32 keys already exist (too-many-keys)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "405": {
            "description": "Not a POST",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "401": {
            "description": "No admin bearer or signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "403": {
            "description": "Bearer valid but not an admin (detail explains which check failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp.ashx?action=apikey-revoke": {
      "post": {
        "tags": [
          "chat-whatsapp"
        ],
        "operationId": "waApiKeyRevoke",
        "summary": "Revoke a channel API key",
        "description": "Removes the key with the given id; it stops working immediately. Admin: OIDC bearer whose userinfo role is admin, superadmin or superuser, or X-CodeB-Admin-Signature with HMAC bucket `whatsapp` (hex HMAC-SHA256 of `whatsapp|<host>`). Errors are problem objects.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "apikey-revoke"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Revoked",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "id missing (invalid_request)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "404": {
            "description": "No config (not-configured), no keys (no-keys) or unknown id (not-found)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "405": {
            "description": "Not a POST",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "401": {
            "description": "No admin bearer or signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "403": {
            "description": "Bearer valid but not an admin (detail explains which check failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp.ashx?action=templates-list": {
      "get": {
        "tags": [
          "chat-whatsapp"
        ],
        "operationId": "waTemplatesList",
        "summary": "List message templates (admin)",
        "description": "Templates with status APPROVED, PENDING, IN_APPEAL or PAUSED (rejected and disabled ones are hidden), with placeholder metadata. Cached for 60 seconds. Provider errors are returned with HTTP 200 and an empty list (metaStatus/metaError or localError). Admin: OIDC bearer whose userinfo role is admin, superadmin or superuser, or X-CodeB-Admin-Signature with HMAC bucket `whatsapp` (hex HMAC-SHA256 of `whatsapp|<host>`). Errors are problem objects.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "templates-list"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Templates",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "configured": {
                      "type": "boolean"
                    },
                    "templates": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SiteWaTemplate"
                      }
                    },
                    "wabaId": {
                      "type": "string"
                    },
                    "maxPlaceholders": {
                      "type": "integer"
                    },
                    "metaStatus": {
                      "type": "integer"
                    },
                    "metaError": {
                      "type": "string"
                    },
                    "localError": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No admin bearer or signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "403": {
            "description": "Bearer valid but not an admin (detail explains which check failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp.ashx?action=templates-create": {
      "post": {
        "tags": [
          "chat-whatsapp"
        ],
        "operationId": "waTemplatesCreate",
        "summary": "Submit a new message template for provider review",
        "description": "Builds a BODY (and optional FOOTER) template and submits it. Placeholders {{1}}..{{n}} must be sequential, at most 3, with exactly n `exampleValues` (used only for the review). The provider's HTTP status is passed through. Admin: OIDC bearer whose userinfo role is admin, superadmin or superuser, or X-CodeB-Admin-Signature with HMAC bucket `whatsapp` (hex HMAC-SHA256 of `whatsapp|<host>`). Errors are problem objects.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "templates-create"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "lower-cased; [a-z0-9_]",
                    "pattern": "^[a-z0-9_]{1,512}$"
                  },
                  "category": {
                    "type": "string",
                    "enum": [
                      "UTILITY",
                      "AUTHENTICATION",
                      "MARKETING"
                    ],
                    "default": "UTILITY"
                  },
                  "language": {
                    "type": "string",
                    "default": "en_US"
                  },
                  "bodyText": {
                    "type": "string",
                    "description": "1-1024 characters",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "footerText": {
                    "type": "string"
                  },
                  "exampleValues": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 3
                  }
                },
                "required": [
                  "name",
                  "bodyText"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Submitted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "metaStatus": {
                      "type": "integer"
                    },
                    "response": {
                      "description": "Provider response"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failure (bad-json, invalid-name, invalid-body, invalid-category, too-many-placeholders, placeholder-gap, example-count-mismatch)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "404": {
            "description": "Channel not configured (not-configured)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "405": {
            "description": "Not a POST",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "401": {
            "description": "No admin bearer or signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "403": {
            "description": "Bearer valid but not an admin (detail explains which check failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp.ashx?action=templates-delete": {
      "post": {
        "tags": [
          "chat-whatsapp"
        ],
        "operationId": "waTemplatesDelete",
        "summary": "Delete a message template",
        "description": "Deletes all languages of the named template, or only one when `templateId` is given. The provider's HTTP status is passed through. Admin: OIDC bearer whose userinfo role is admin, superadmin or superuser, or X-CodeB-Admin-Signature with HMAC bucket `whatsapp` (hex HMAC-SHA256 of `whatsapp|<host>`). Errors are problem objects.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "templates-delete"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "templateId": {
                    "type": "string",
                    "description": "optional; deletes only this language variant"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "metaStatus": {
                      "type": "integer"
                    },
                    "response": {
                      "description": "Provider response"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad JSON (bad-json) or name missing (invalid-name)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "404": {
            "description": "Channel not configured (not-configured)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "405": {
            "description": "Not a POST",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "401": {
            "description": "No admin bearer or signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "403": {
            "description": "Bearer valid but not an admin (detail explains which check failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp.ashx?action=quota-status": {
      "get": {
        "tags": [
          "chat-whatsapp"
        ],
        "operationId": "waQuotaStatus",
        "summary": "Today's use of the new-recipient limit",
        "description": "Distinct outbound recipients today (UTC) against the tenant's newChatsPerDayLimit. Admin: OIDC bearer whose userinfo role is admin, superadmin or superuser, or X-CodeB-Admin-Signature with HMAC bucket `whatsapp` (hex HMAC-SHA256 of `whatsapp|<host>`). Errors are problem objects.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "quota-status"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Quota",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "day": {
                      "type": "string",
                      "description": "yyyy-MM-dd"
                    },
                    "used": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "remaining": {
                      "type": "integer",
                      "description": "-1 when unlimited"
                    },
                    "unlimited": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No admin bearer or signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "403": {
            "description": "Bearer valid but not an admin (detail explains which check failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp.ashx?action=diag": {
      "get": {
        "tags": [
          "chat-whatsapp"
        ],
        "operationId": "waDiag",
        "summary": "Recent channel audit events",
        "description": "Up to the last 30 events from each of the two newest monthly audit files (inbound webhook payloads and outbound send results). Admin: OIDC bearer whose userinfo role is admin, superadmin or superuser, or X-CodeB-Admin-Signature with HMAC bucket `whatsapp` (hex HMAC-SHA256 of `whatsapp|<host>`). Errors are problem objects.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "diag"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Events",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "events": {
                      "type": "array",
                      "items": {}
                    },
                    "build": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No admin bearer or signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          },
          "403": {
            "description": "Bearer valid but not an admin (detail explains which check failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteProblem"
                }
              }
            }
          }
        }
      }
    },
    "/wallet-attestation.ashx": {
      "post": {
        "tags": [
          "wallet-backend"
        ],
        "operationId": "walletMintAttestation",
        "summary": "Mint a Wallet Attestation JWT bound to the wallet's public key",
        "description": "Called by the Web Wallet (and OEM apps embedding it) to obtain a Wallet Attestation that binds the wallet instance key (cnf.jwk) to the signed-in user. Auth: an OIDC access token (introspected) or a narrow token from /wallet-session-token.ashx. The attestation is HS256-signed with a per-tenant key, so it can be checked by this tenant only. Lifetime 24 h. Limits: request body 8 KB; 20 mints per user per hour (429, Retry-After 3600). Only POST.",
        "security": [
          {
            "walletSessionToken": []
          },
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "walletPublicJwk"
                ],
                "properties": {
                  "walletPublicJwk": {
                    "$ref": "#/components/schemas/WalletJwkP256Public"
                  },
                  "nonce": {
                    "type": "string",
                    "maxLength": 256,
                    "description": "Optional challenge, echoed in the attestation"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Attestation minted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletAttestationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. error: empty_body, invalid_json, invalid_request, invalid_jwk, invalid_nonce.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Bearer missing, invalid or expired (WWW-Authenticate: Bearer realm=\"codeb-wallet-attestation\"). error: invalid_token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Not POST. error: method_not_allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Body over 8 KB. error: body_too_large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many attestation mints. error: rate_limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds (3600)"
              }
            }
          },
          "500": {
            "description": "Server error. error: internal_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/wallet-session-token.ashx": {
      "post": {
        "tags": [
          "wallet-backend"
        ],
        "operationId": "walletMintSessionToken",
        "summary": "Exchange an OIDC access token for a 10-minute token scoped to the vault backup",
        "description": "The Web Wallet trades the user's OIDC access token for a short-lived HS256 token (aud=wallet-backup, 600 s) that /wallet-backup.ashx and /wallet-attestation.ashx accept. The token carries the OIDC client (azp) so vault storage stays separate per integrating client. No body. Limit: 30 mints per user per hour (429, Retry-After 3600). Only POST.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "responses": {
          "200": {
            "description": "Token minted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletSessionTokenResponse"
                }
              }
            }
          },
          "400": {
            "description": "sub or tenant not usable. error: invalid_request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Bearer missing, invalid or expired (WWW-Authenticate: Bearer realm=\"codeb-wallet-session\"). error: invalid_token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Not POST. error: method_not_allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many mints. error: rate_limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds (3600)"
              }
            }
          },
          "500": {
            "description": "Server error. error: internal_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/wallet-backup.ashx?action=save": {
      "post": {
        "tags": [
          "wallet-backend"
        ],
        "operationId": "walletVaultSave",
        "summary": "Store (replace) the user's encrypted wallet vault",
        "description": "Uploads the client-encrypted vault blob and replaces the previous one (the previous copy is kept as a server-side backup file). Body cap 1 MB. Auth: OIDC access token or the narrow token from /wallet-session-token.ashx. Storage is keyed by a hash of user, tenant and OIDC client, so each integrating client sees only its own vault. The server stores ciphertext only. Limit: 60 requests per user per hour across all vault actions.",
        "security": [
          {
            "walletSessionToken": []
          },
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WalletVaultBlob"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stored",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "sync_id": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "bytes": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad body. error: empty_body, invalid_json, invalid_vault_shape, invalid_subject, invalid_tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Vault over 1 MB. error: blob_too_large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Write failed. error: write_failed, internal_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Bearer missing, invalid or expired (WWW-Authenticate: Bearer realm=\"codeb-wallet-backup\"). error: invalid_token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Wrong method for the action, or unknown action. error: method_not_allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "More than 60 requests per user per hour. error: rate_limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds (3600)"
              }
            }
          }
        }
      }
    },
    "/wallet-backup.ashx?action=load": {
      "get": {
        "tags": [
          "wallet-backend"
        ],
        "operationId": "walletVaultLoad",
        "summary": "Fetch the user's encrypted wallet vault",
        "description": "Returns the stored vault exactly as it was saved. Auth: OIDC access token or the narrow token from /wallet-session-token.ashx. Storage is keyed by a hash of user, tenant and OIDC client, so each integrating client sees only its own vault. The server stores ciphertext only. Limit: 60 requests per user per hour across all vault actions.",
        "security": [
          {
            "walletSessionToken": []
          },
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "responses": {
          "200": {
            "description": "The stored vault",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletVaultBlob"
                }
              }
            }
          },
          "404": {
            "description": "No vault stored for this user and client. error: not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Bearer missing, invalid or expired (WWW-Authenticate: Bearer realm=\"codeb-wallet-backup\"). error: invalid_token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Wrong method for the action, or unknown action. error: method_not_allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "More than 60 requests per user per hour. error: rate_limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds (3600)"
              }
            }
          },
          "500": {
            "description": "Server error. error: internal_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/wallet-backup.ashx?action=delete": {
      "post": {
        "tags": [
          "wallet-backend"
        ],
        "operationId": "walletVaultDelete",
        "summary": "Delete the user's encrypted wallet vault",
        "description": "Deletes the stored vault and its server-side backup copy. The body must confirm the deletion. Auth: OIDC access token or the narrow token from /wallet-session-token.ashx. Storage is keyed by a hash of user, tenant and OIDC client, so each integrating client sees only its own vault. The server stores ciphertext only. Limit: 60 requests per user per hour across all vault actions.",
        "security": [
          {
            "walletSessionToken": []
          },
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "confirm"
                ],
                "properties": {
                  "confirm": {
                    "type": "string",
                    "enum": [
                      "delete"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deleted (existed=false when there was nothing to delete)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "existed": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing confirmation. error: confirm_required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Delete failed; the vault may still exist. error: delete_failed, internal_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Bearer missing, invalid or expired (WWW-Authenticate: Bearer realm=\"codeb-wallet-backup\"). error: invalid_token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Wrong method for the action, or unknown action. error: method_not_allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "More than 60 requests per user per hour. error: rate_limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds (3600)"
              }
            }
          }
        }
      }
    },
    "/.well-known/wallet-provider.jwt": {
      "get": {
        "tags": [
          "wallet-provider",
          "well-known"
        ],
        "operationId": "walletProviderMetadata",
        "summary": "Signed Wallet Provider metadata",
        "description": "Public metadata of this tenant as provider of the CodeB Web Wallet: provider DID, WUA and WIA endpoints, wallet solution id and version, supported attestation formats and lifetimes. Signed ES256 (typ=wallet-provider+jwt, kid=did:web:<host>#issuer), valid 30 days; verify with the key in /.well-known/did.json. Also answered at /wallet-provider.ashx?metadata=1. Cache-Control: public, max-age=300. CORS: *.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "responses": {
          "200": {
            "description": "Signed metadata (compact JWS)",
            "content": {
              "application/wallet-provider+jwt": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "description": "Tenant issuer key could not sign. Body (text/plain): sign_failed, no_tenant.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/wallet-provider.ashx?action=wua": {
      "post": {
        "tags": [
          "wallet-provider"
        ],
        "operationId": "walletProviderMintWua",
        "summary": "Mint a Wallet Unit Attestation (WUA) for a wallet instance key",
        "description": "Called once per wallet instance by the signed-in user's wallet. Returns an ES256 WUA (12 months) over the supplied public key; a copy is kept on the server for lookup. Auth: OIDC access token, checked live against userinfo. Limit: one WUA per key per 60 s (429, Retry-After 60). Body cap 16 KB. CORS: *.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "walletPublicJwk"
                ],
                "properties": {
                  "walletPublicJwk": {
                    "type": "object",
                    "description": "Public JWK of the wallet instance (EC or OKP; RFC 7638 thumbprint is used for EC/OKP)"
                  },
                  "walletName": {
                    "type": "string",
                    "default": "codeb-web-wallet"
                  },
                  "walletVersion": {
                    "type": "string",
                    "default": "unknown"
                  },
                  "keyAttestation": {
                    "description": "Optional key attestation; embedded as key_attestation exactly as supplied (not verified by the server)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "WUA minted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletWuaResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Body (text/plain): read_failed, bad_body, invalid_json, null_body, walletPublicJwk_required, walletPublicJwk_must_be_object, unknown_action.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No bearer, or the bearer is not a live token. Body (text/plain): bearer_required, invalid_token.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "429": {
            "description": "One mint per key per minute. Body (text/plain): rate_limited.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds (60)"
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Signing failed. Body (text/plain): sign_failed.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "405": {
            "description": "Not POST. Body (text/plain): method_not_allowed.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "413": {
            "description": "Body over 16 KB. Body (text/plain): body_too_large.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/wallet-provider.ashx?action=wia": {
      "post": {
        "tags": [
          "wallet-provider"
        ],
        "operationId": "walletProviderMintWia",
        "summary": "Derive a 24-hour Wallet Instance Attestation (WIA) from a WUA",
        "description": "Exchanges a WUA minted by this tenant for a short-lived WIA (24 h) carrying the same cnf key and an optional verifier nonce. No bearer needed: possession of a valid, unexpired WUA of this tenant is the credential. Only WUAs signed by this tenant (typ=wallet-unit-attestation+jwt) are accepted. Body cap 16 KB. CORS: *.",
        "security": [],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "wua"
                ],
                "properties": {
                  "wua": {
                    "type": "string",
                    "description": "WUA from ?action=wua"
                  },
                  "nonce": {
                    "type": "string",
                    "description": "Optional verifier nonce"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "WIA minted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletWiaResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request or WUA not acceptable. Body (text/plain): read_failed, bad_body, invalid_json, null_body, wua_required, wua_not_jws, wua_parse_failed, wua_signature_invalid, wua_wrong_typ, wua_expired, unknown_action.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Signing failed. Body (text/plain): sign_failed.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "405": {
            "description": "Not POST. Body (text/plain): method_not_allowed.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "413": {
            "description": "Body over 16 KB. Body (text/plain): body_too_large.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/wallet/trust/csca-masterlist.ml": {
      "get": {
        "tags": [
          "trust"
        ],
        "operationId": "walletTrustCscaMasterList",
        "summary": "CSCA master list for passport and ID card chip checks",
        "description": "Public download of the signed CSCA master list the CodeB Wallet uses for Passive Authentication of passports and ID cards. It is served byte for byte as published by its issuing authority; the server never re-signs or edits it and the wallet verifies the signature itself. No login, no redirect. Refreshed in the background (master list weekly, CRLs daily; the last good copy is kept). Supports ETag / Last-Modified with conditional requests; Cache-Control: public, max-age=3600; Content-Disposition: attachment; filename=csca-masterlist.ml. Only GET and HEAD. Rate limit 30 requests per IP per minute. Internally served by wallet-trust.ashx.",
        "security": [],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "responses": {
          "200": {
            "description": "The file",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Last-Modified": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "304": {
            "description": "Not modified (If-None-Match / If-Modified-Since)"
          },
          "400": {
            "description": "Unexpected query parameter. Body (text/plain): bad request.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "405": {
            "description": "Only GET and HEAD (Allow: GET, HEAD)"
          },
          "429": {
            "description": "More than 30 requests per IP per minute. Body (text/plain): too many requests.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds (60)"
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "503": {
            "description": "File not downloaded yet (Retry-After 120) or the stored file failed its integrity self-check (Retry-After 600).",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/wallet/trust/csca-crls.zip": {
      "get": {
        "tags": [
          "trust"
        ],
        "operationId": "walletTrustCscaCrls",
        "summary": "Certificate revocation lists of the CSCAs in the master list (ZIP)",
        "description": "Public download of a ZIP of the certificate revocation lists published by the CSCAs in the master list, as downloaded from their publishers (unaltered). No login, no redirect. Refreshed in the background (master list weekly, CRLs daily; the last good copy is kept). Supports ETag / Last-Modified with conditional requests; Cache-Control: public, max-age=3600; Content-Disposition: attachment; filename=csca-crls.zip. Only GET and HEAD. Rate limit 30 requests per IP per minute. Internally served by wallet-trust.ashx.",
        "security": [],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "responses": {
          "200": {
            "description": "The file",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Last-Modified": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "304": {
            "description": "Not modified (If-None-Match / If-Modified-Since)"
          },
          "400": {
            "description": "Unexpected query parameter. Body (text/plain): bad request.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "405": {
            "description": "Only GET and HEAD (Allow: GET, HEAD)"
          },
          "429": {
            "description": "More than 30 requests per IP per minute. Body (text/plain): too many requests.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds (60)"
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "503": {
            "description": "File not downloaded yet (Retry-After 120) or the stored file failed its integrity self-check (Retry-After 600).",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/wallet-trust.ashx?status": {
      "get": {
        "tags": [
          "trust"
        ],
        "operationId": "walletTrustCscaStatus",
        "summary": "Summary of the CSCA trust material (dates, hashes, counts)",
        "description": "Public JSON summary of the stored master list and CRL bundle: change and check times, SHA-256 hashes, CSCA and CRL counts, and whether a refresh is running. Rate limit 30 requests per IP per minute. Only GET/HEAD.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "responses": {
          "200": {
            "description": "Status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletCscaStatus"
                }
              }
            }
          },
          "400": {
            "description": "Unexpected query parameter. Body (text/plain): bad request.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "405": {
            "description": "Only GET and HEAD (Allow: GET, HEAD)"
          },
          "429": {
            "description": "More than 30 requests per IP per minute. Body (text/plain): too many requests.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds (60)"
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/wallet-trust.ashx?admin-overview": {
      "get": {
        "tags": [
          "trust"
        ],
        "operationId": "walletTrustCscaAdminOverview",
        "summary": "Admin overview of the CSCA master list, certificates, CRLs and fetch log",
        "description": "Admin only: an access token from this site's admin sign-in (audience codeb-admin, role admin or superuser), checked by token introspection; ID tokens and refresh tokens are refused. Returns the manifest, the parsed CSCA certificates (country, subject, validity), the CRLs (issuer, this/next update, overdue, revoked count, signature check), the schedule and the recent fetch log. Used by csca-admin.html. Rate limit 30 per IP per minute.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "responses": {
          "200": {
            "description": "Overview",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "manifest": {
                      "type": "object"
                    },
                    "running": {
                      "type": "boolean"
                    },
                    "log": {
                      "type": "array",
                      "items": {}
                    },
                    "masterlist_due": {
                      "type": "boolean"
                    },
                    "crls_due": {
                      "type": "boolean"
                    },
                    "schedule": {},
                    "masterlist": {
                      "type": "object"
                    },
                    "cscas": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "countries": {},
                    "crls": {},
                    "manual": {},
                    "public_urls": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Not an admin access token (WWW-Authenticate: Bearer realm=\"codeb-admin\"). Body: {\"error\":\"admin sign-in required\"}",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "400": {
            "description": "Unexpected query parameter. Body (text/plain): bad request.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "429": {
            "description": "More than 30 requests per IP per minute. Body (text/plain): too many requests.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds (60)"
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/wallet-trust.ashx?admin-refresh": {
      "post": {
        "tags": [
          "trust"
        ],
        "operationId": "walletTrustCscaAdminRefresh",
        "summary": "Admin: download the CSCA master list and/or CRLs now",
        "description": "Admin only: an access token from this site's admin sign-in (audience codeb-admin, role admin or superuser), checked by token introspection; ID tokens and refresh tokens are refused. Starts one background download run. Body cap 1 KB. One manual run per 60 s; refused while a run is in progress.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "what": {
                    "type": "string",
                    "enum": [
                      "ml",
                      "crls",
                      "all"
                    ],
                    "default": "all"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Run started",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "started": {
                      "type": "boolean"
                    },
                    "what": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON or bad 'what' (or unexpected query parameter, text/plain).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Not an admin access token. Body: {\"error\":\"admin sign-in required\"}",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "A download is already running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Body over 1 KB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Manual runs are limited to one per minute (also the per-IP limit of 30 requests per minute).",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds (60)"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Could not start the run.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/did.json": {
      "get": {
        "tags": [
          "did",
          "well-known"
        ],
        "operationId": "didWebDocument",
        "summary": "This tenant's did:web DID Document",
        "description": "Publishes did:web:<host> with the tenant issuer key (verificationMethod #issuer, also listed under authentication and assertionMethod). Credentials, status lists, trust statements and wallet-provider metadata signed by this tenant are verified against this key. If the tenant has no issuer key yet, one is created on first request. Also answered at /did.ashx?publish=1. Cache-Control: public, max-age=300. CORS: *.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "responses": {
          "200": {
            "description": "DID Document",
            "content": {
              "application/did+ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletDidDocument"
                }
              }
            }
          },
          "405": {
            "description": "Only GET (and OPTIONS). Body (text/plain): method_not_allowed.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Host not resolvable. Body (text/plain): no_tenant.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/did.ashx?did=<did>": {
      "get": {
        "tags": [
          "did"
        ],
        "operationId": "didResolve",
        "summary": "Resolve a DID (did:key, did:jwk, did:web, did:webvh) to its DID Document",
        "description": "DID Resolution-style envelope {didDocument, resolutionMetadata, documentMetadata}. did:jwk is decoded locally; did:key supports Ed25519 keys only (P-256 did:key returns notFound); did:web fetches https://<domain>/.well-known/did.json (or the path form), did:webvh reads the latest entry of the did.jsonl log without checking its hash chain. Remote fetches: HTTPS only, private and loopback addresses refused, 5 s timeout, 128 KB cap. did:web of this tenant itself is answered from local keys. Public, no auth. Cache-Control: public, max-age=60. CORS: *. Rate-limited per IP (120 lookups per minute, 20 per minute for did:web / did:webvh, which fetch remotely); remote answers are cached for 60 s, redirects are refused, at most 128 KB and 10 s per fetch.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "did",
            "in": "query",
            "required": true,
            "description": "DID URL. Must match ^did:(key|jwk|web|webvh):[A-Za-z0-9._:%/~=?#-]+$",
            "schema": {
              "type": "string"
            },
            "example": "did:web:phone.aloaha.com"
          }
        ],
        "responses": {
          "200": {
            "description": "Resolved",
            "content": {
              "application/did+ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletDidResolution"
                }
              }
            }
          },
          "400": {
            "description": "Missing or malformed DID. Body (text/plain): did_required, bad_did_syntax.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "404": {
            "description": "Not resolvable. Body: {\"resolutionMetadata\":{\"error\":\"notFound\"}}",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletDidResolution"
                }
              }
            }
          },
          "405": {
            "description": "Only GET. Body (text/plain): method_not_allowed.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Resolver error. Body: resolutionMetadata.error=internalError",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletDidResolution"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/vcdm.ashx?action=issue": {
      "post": {
        "tags": [
          "vc-tools"
        ],
        "operationId": "vcdmIssue",
        "summary": "Admin: issue a W3C VCDM 2.0 credential as a VC-JWT",
        "description": "Issues a VCDM 2.0 credential (type [VerifiableCredential, <type>]) signed ES256 with the tenant issuer key, issuer did:web:<host>, valid 365 days. credentialSubject = claims (+ id = subject when given). Auth: OIDC bearer of a tenant admin or superuser (checked live against userinfo). Body cap 32 KB.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "default": "VerifiableCredential",
                    "example": "EmployeeCredential"
                  },
                  "claims": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "subject": {
                    "type": "string",
                    "description": "Holder identifier, for example a DID"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Issued (Cache-Control: no-store)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletVcdmIssueResponse"
                }
              }
            }
          },
          "401": {
            "description": "No bearer. Body (text/plain): bearer_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Bearer is not a tenant admin. Body (text/plain): admin_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Signing failed (for example no issuer key yet). Body (text/plain): sign_failed, no_tenant.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "400": {
            "description": "Bad body or action. Body (text/plain): read_failed, bad_body, invalid_json, null_body, unknown_action.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "405": {
            "description": "Only POST (and OPTIONS). Body (text/plain): method_not_allowed.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "413": {
            "description": "Body over 32 KB. Body (text/plain): body_too_large.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/vcdm.ashx?action=verify": {
      "post": {
        "tags": [
          "vc-tools"
        ],
        "operationId": "vcdmVerify",
        "summary": "Verify the issuer signature of a VCDM 2.0 VC-JWT",
        "description": "Checks a VC-JWT (typ must be vc+jwt, alg ES256): expiry, then the ES256 signature, either with this tenant's own issuer key (iss = did:web:<host>) or with keys of issuers this tenant trusts (see trust-tenants). Also checks that the JWT iss matches vc.issuer. Does not check holder key binding (holder_binding_verified is always false). Always HTTP 200 for a well-formed request; read valid and signature_verified. Public, no auth. Body cap 32 KB. CORS: *.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "credential"
                ],
                "properties": {
                  "credential": {
                    "type": "string",
                    "description": "VC-JWT"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletVcdmVerifyResult"
                }
              }
            }
          },
          "400": {
            "description": "Bad body. Body (text/plain): read_failed, bad_body, invalid_json, null_body, credential_required, unknown_action.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "405": {
            "description": "Only POST (and OPTIONS). Body (text/plain): method_not_allowed.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "413": {
            "description": "Body over 32 KB. Body (text/plain): body_too_large.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/bitstring-status.ashx": {
      "get": {
        "tags": [
          "status-list"
        ],
        "operationId": "statusListGet",
        "summary": "Signed credential status list (W3C Bitstring or IETF Token Status List)",
        "description": "Public revocation/suspension list for credentials issued by this tenant. Default: W3C Bitstring Status List v1.0 as a VC-JWT (application/vc+jwt, typ=vc+jwt, ES256, credentialSubject.encodedList = gzip + base64url with multibase 'u'). With format=oauth-token: IETF Token Status List JWT (application/statuslist+jwt, typ=statuslist+jwt, ES256 with x5c, status_list.bits=1, status_list.lst = zlib + base64url, ttl 86400) - the URI SD-JWT credentials from /vci.ashx point to. With format=cwt: the same list as a Token Status List CWT (application/statuslist+cwt; COSE_Sign1 tag 18, protected {alg ES256, typ application/statuslist+cwt}, unprotected x5chain = tenant Document Signer; claims sub, iat, exp, ttl, status_list {bits 1, lst zlib bytes}) - the URI mdoc credentials point to; 503 document_signer_unavailable without a Document Signer. The format=oauth-token URL also answers the CWT form when Accept asks for application/statuslist+cwt (Vary: Accept; that answer is Cache-Control private). iat is one minute in the past. Both carry the same bits; tokens are valid 7 days. Cache-Control: public, max-age=300. CORS: *.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "purpose",
            "in": "query",
            "required": false,
            "description": "List purpose",
            "schema": {
              "type": "string",
              "enum": [
                "revocation",
                "suspension"
              ],
              "default": "revocation"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "Envelope; omit for the W3C VC-JWT",
            "schema": {
              "type": "string",
              "enum": [
                "oauth-token",
                "oauth",
                "cwt"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Signed status list (compact JWS)",
            "content": {
              "application/vc+jwt": {
                "schema": {
                  "type": "string"
                }
              },
              "application/statuslist+jwt": {
                "schema": {
                  "type": "string"
                }
              },
              "application/statuslist+cwt": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Unknown purpose. Body (text/plain): bad_purpose.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "405": {
            "description": "Method not GET/POST/OPTIONS. Body (text/plain): method_not_allowed.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): no_tenant, no_appdata, mkdir_failed, read_failed, zlib_failed, sign_failed.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "503": {
            "description": "CWT form only: the tenant Document Signer is not available. Body (text/plain): document_signer_unavailable.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/bitstring-status.ashx?action=set": {
      "post": {
        "tags": [
          "status-list"
        ],
        "operationId": "statusListSet",
        "summary": "Admin: set or clear one bit in the tenant's status list",
        "description": "Sets (revoked=true) or clears the bit at index in the revocation or suspension list. Takes effect for new fetches of the list (lists are cacheable for 5 minutes). Auth: OIDC bearer of a tenant admin or superuser (checked live against userinfo). Body cap 1 KB. Note: any POST to this handler is treated as this action.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "index",
            "in": "query",
            "required": true,
            "description": "Bit index, 0 to 8388607",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 8388607
            }
          },
          {
            "name": "purpose",
            "in": "query",
            "required": false,
            "description": "List purpose",
            "schema": {
              "type": "string",
              "enum": [
                "revocation",
                "suspension"
              ],
              "default": "revocation"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "revoked": {
                    "type": "boolean",
                    "default": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "index": {
                      "type": "integer"
                    },
                    "revoked": {
                      "type": "boolean"
                    },
                    "purpose": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad index or purpose, or list full. Body (text/plain): bad_index, bad_purpose, read_failed, list_full.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No bearer. Body (text/plain): bearer_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Bearer is not a tenant admin. Body (text/plain): admin_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "413": {
            "description": "Body over 1 KB. Body (text/plain): body_too_large.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Write failed. Body (text/plain): write_failed.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/vshare.ashx": {
      "post": {
        "tags": [
          "vc-tools"
        ],
        "operationId": "vshareCreate",
        "summary": "Park an SD-JWT VC for a short share QR and get its link",
        "description": "The wallet's Verify (QR) feature posts the SD-JWT VC it wants to show and puts only the returned short link in the QR. The holder chooses to share the credential; anyone with the link can read it until it expires. Needs the signed-in user's OIDC access token. Body: the SD-JWT (<jwt>~<disclosure>~...), up to 256 KB. ttl is clamped to 60 s .. 30 days (default 15 min). Limits: 30 per hour per IP, 20 per hour and 20 links / 2 MB per UTC day per user, and a storage cap per site. CORS: *.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "ttl",
            "in": "query",
            "required": false,
            "description": "Lifetime in seconds (60 .. 2592000, default 900)",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/sd-jwt-vc+jwt": {
              "schema": {
                "type": "string"
              }
            },
            "text/plain": {
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stored (Cache-Control: no-store)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletShareCreated"
                }
              }
            }
          },
          "400": {
            "description": "Empty body, not an SD-JWT, or unreadable. Body (text/plain): empty_body, not_sd_jwt, read_failed.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "405": {
            "description": "Method not GET/POST/OPTIONS. Body (text/plain): method_not_allowed.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "413": {
            "description": "Over 256 KB. Body (text/plain): body_too_large.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): no_tenant, no_appdata, mkdir_failed, write_failed.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid sign-in token (WWW-Authenticate: Bearer).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "description": "Quota or storage could not be read (fails closed).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "507": {
            "description": "Storage cap for this site reached.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "vc-tools"
        ],
        "operationId": "vshareGet",
        "summary": "Fetch a shared SD-JWT VC by its id",
        "description": "Used by vc-verify.html (or any verifier) after scanning a share QR. Returns the SD-JWT VC as stored; several reads are allowed until it expires. No auth. Cache-Control: no-store. CORS: *. 120 reads per minute per IP.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "32 hex chars from the share link",
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{32}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The SD-JWT VC",
            "content": {
              "application/sd-jwt-vc+jwt": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad id. Body (text/plain): bad_id.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "404": {
            "description": "Unknown or expired. Body (text/plain): not_found_or_expired, expired.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): read_dir_failed, read_failed.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/portrait.ashx?id=<id>": {
      "get": {
        "tags": [
          "vc-tools"
        ],
        "operationId": "portraitGet",
        "summary": "Portrait image referenced by an issued credential (portrait_url)",
        "description": "Credentials from this tenant may carry portrait_url instead of an inline image; the wallet or verifier page loads the image from here. The id is a random opaque value; the image is readable by anyone who has the URL. Content type is detected from the file bytes (JPEG, PNG, WebP). Cache-Control: public, max-age=31536000, immutable. CORS: *.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Opaque id, 24-32 lowercase letters/digits",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9]{24,32}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Image",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Unknown id. Body (text/plain): not_found, no_tenant.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "415": {
            "description": "Stored file is not a supported image. Body (text/plain): unknown_image.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): no_appdata.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/offer": {
      "get": {
        "tags": [
          "eu-wallet-issuer"
        ],
        "operationId": "credentialOfferLanding",
        "summary": "https link form of an OpenID4VCI credential offer (App Link landing page)",
        "description": "https://<host>/offer?credential_offer_uri=... (or ?credential_offer=<json>) is the https form of an OpenID4VCI offer. On Android with the CodeB Wallet installed the link opens the wallet directly; otherwise this HTML page shows an 'Open in wallet' button with the openid-credential-offer:// link and a QR code of it. Exactly one of the two parameters; the offer URI (or the inline offer's credential_issuer) must be https on this same host, default port, no user info. Caps: URI 1024 chars, JSON 4096 chars; inline JSON needs credential_configuration_ids. Rate limit 60 requests per IP per minute. German page when the browser's first language is German. no-store, noindex, strict CSP. GET and HEAD.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "credential_offer_uri",
            "in": "query",
            "required": false,
            "description": "https URL on this host returning the credential offer",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "credential_offer",
            "in": "query",
            "required": false,
            "description": "Inline credential offer JSON",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Landing page",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "No valid offer for this host (HTML error page)",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "description": "Not GET or HEAD"
          },
          "429": {
            "description": "Too many requests (HTML page)",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds (60)"
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/trust-list.xml": {
      "get": {
        "tags": [
          "trust",
          "well-known"
        ],
        "operationId": "trustListXml",
        "summary": "This tenant's signed Trusted List (ETSI TS 119 612 style XML)",
        "description": "List of the entities this tenant itself trusts as credential issuers (currently its own SD-JWT VC + VCDM 2.0 issuer certificate), shaped after ETSI TS 119 612 and enveloped-signed with XMLDSig (ECDSA-SHA256, exclusive C14N) by the tenant issuer key, certificate in KeyInfo. This is a self-published list, not an EU national Trusted List. Next update +90 days. Also answered at /trust-list.ashx. Cache-Control: public, max-age=300. CORS: *.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "responses": {
          "200": {
            "description": "Signed XML",
            "content": {
              "application/vnd.etsi.tsl+xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "description": "Only GET. Body (text/plain): method_not_allowed.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Signing failed. Body (text/plain): sign_failed, no_tenant.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "503": {
            "description": "Tenant has no issuer key yet. Body (text/plain): issuer_key_not_initialised.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/trust-list.ashx?fmt=json": {
      "get": {
        "tags": [
          "trust"
        ],
        "operationId": "trustListJson",
        "summary": "JSON mirror of this tenant's Trusted List (unsigned)",
        "description": "Same content as /.well-known/trust-list.xml as plain JSON for programmatic clients. Unsigned: check the certificate against /.well-known/did.json or the signed XML. Cache-Control: public, max-age=300. CORS: *.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "responses": {
          "200": {
            "description": "Trusted List (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletTrustListJson"
                }
              }
            }
          },
          "405": {
            "description": "Only GET. Body (text/plain): method_not_allowed.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "503": {
            "description": "Tenant has no issuer key yet. Body (text/plain): issuer_key_not_initialised.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/trust-tenants.ashx?action=list": {
      "get": {
        "tags": [
          "trust"
        ],
        "operationId": "trustTenantsList",
        "summary": "Admin: list the issuers (other tenants) this tenant trusts",
        "description": "Admin only: OIDC bearer whose userinfo role is admin or superuser (checked live). Responses carry Cache-Control: no-store. Each entry is another CodeB tenant (host) whose issuer keys were fetched from its did:web document.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "responses": {
          "200": {
            "description": "Entries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "entries": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WalletTrustEntry"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Not a tenant admin. Body (text/plain): admin_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/trust-tenants.ashx?action=add": {
      "post": {
        "tags": [
          "trust"
        ],
        "operationId": "trustTenantsAdd",
        "summary": "Admin: trust credentials issued by another tenant",
        "description": "Admin only: OIDC bearer whose userinfo role is admin or superuser (checked live). Responses carry Cache-Control: no-store. Fetches https://<host>/.well-known/did.json, caches its signing keys and adds the host to this tenant's trust list. Credentials signed by that host's issuer key then verify here (vcdm.ashx verify, trust resolve). Body cap 8 KB.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "host"
                ],
                "properties": {
                  "host": {
                    "type": "string",
                    "example": "tenant-b.example.com"
                  },
                  "notes": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Added",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "entry": {
                      "$ref": "#/components/schemas/WalletTrustEntry"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad host. Body (text/plain): host_required, bad_host, cannot_add_self.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "409": {
            "description": "Already trusted, or the DID document could not be used. Body (text/plain): already_trusted, did_doc_unreachable, did_doc_no_signing_keys_published, trust_path_unavailable.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "Not a tenant admin. Body (text/plain): admin_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/trust-tenants.ashx?action=refresh": {
      "post": {
        "tags": [
          "trust"
        ],
        "operationId": "trustTenantsRefresh",
        "summary": "Admin: re-fetch the signing keys of a trusted tenant",
        "description": "Admin only: OIDC bearer whose userinfo role is admin or superuser (checked live). Responses carry Cache-Control: no-store. Body cap 8 KB.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "host"
                ],
                "properties": {
                  "host": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Refreshed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "entry": {
                      "$ref": "#/components/schemas/WalletTrustEntry"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad host. Body (text/plain): host_required, bad_host.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "404": {
            "description": "Not trusted, or the DID document could not be used. Body (text/plain): not_trusted, did_doc_unreachable, did_doc_no_signing_keys_published.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "Not a tenant admin. Body (text/plain): admin_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/trust-tenants.ashx?action=remove": {
      "post": {
        "tags": [
          "trust"
        ],
        "operationId": "trustTenantsRemove",
        "summary": "Admin: stop trusting a tenant",
        "description": "Admin only: OIDC bearer whose userinfo role is admin or superuser (checked live). Responses carry Cache-Control: no-store. Body cap 8 KB. ok=false when the host was not in the list.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "host"
                ],
                "properties": {
                  "host": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing host. Body (text/plain): host_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "Not a tenant admin. Body (text/plain): admin_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/trust-tenants.ashx?action=resolve": {
      "get": {
        "tags": [
          "trust"
        ],
        "operationId": "trustTenantsResolve",
        "summary": "Is an issuer trusted here? Returns its cached public keys",
        "description": "Public, read-only check used by verifiers: for iss = did:web:<host> or <host>, returns trusted and the cached public JWKs the tenant admin has added (nothing else). Always application/json; an internal failure answers 200 with trusted=false and error=resolve_failed. Rate limit 60 requests per minute per IP (429, Retry-After 60). Cache-Control: no-store.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "iss",
            "in": "query",
            "required": true,
            "description": "Issuer: did:web:<host> or a host name",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletTrustResolveResult"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Body: {\"error\":\"rate_limited\",\"retry_after\":60}",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds (60)"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/trust-federation.jws": {
      "get": {
        "tags": [
          "trust",
          "well-known"
        ],
        "operationId": "trustFederationStatement",
        "summary": "Signed list of the tenants this tenant trusts",
        "description": "Compact JWS (typ=trust-federation+jwt, ES256, kid=did:web:<host>#issuer) signed by this tenant's issuer key, valid 1 hour: iss/sub = did:web:<host>, trust_model, trusted_peers_count and trusted_peers[] {host, did, added_at, jwks}. Verify with /.well-known/did.json. Also answered at /trust-tenants.ashx?action=federation-statement. Rate limit 60 per minute per IP. Cache-Control: public, max-age=300.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "responses": {
          "200": {
            "description": "Signed statement",
            "content": {
              "application/trust-federation+jwt": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Body: {\"error\":\"rate_limited\"}",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds (60)"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Signing failed (no issuer key). Body (text/plain): sign_failed.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/vc-audit.ashx?list-vp-events=1": {
      "get": {
        "tags": [
          "eu-wallet-verifier"
        ],
        "operationId": "vcAuditListVpEvents",
        "summary": "Admin: EU Wallet verifier audit events (vp-*) of this tenant",
        "description": "Reads this tenant's verifier log and returns the vp-* events newest first. Used by vc-audit.html. Auth: OIDC bearer whose token introspection shows an admin (is_admin, or role admin/superuser). Cache-Control: no-store.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum rows (1..10000, default 500)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10000,
              "default": 500
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Optional ISO 8601 lower bound (UTC)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Events",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletVpEvents"
                }
              }
            }
          },
          "400": {
            "description": "No tenant host. error: no_tenant_host.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Admin sign-in required (WWW-Authenticate: Bearer realm=\"codeb-admin\"). Body: {\"error\":\"admin sign-in required\"}",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=list-wallets": {
      "get": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwListPublicWallets",
        "summary": "List the public business wallets on this tenant",
        "description": "Public directory of business wallets whose owners made them public: id, company name, registration, jurisdiction, VAT, DID, DID document URL, wallet page URL, wallet URN. Private wallets are never listed. No auth.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "responses": {
          "200": {
            "description": "Wallets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "wallets": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BwWalletSummary"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=list-wallets-by-urn": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwLookupWalletsByUrn",
        "summary": "Look up public business wallets by wallet URN",
        "description": "Maps up to 200 wallet URNs (urn:aloaha:web-wallet:...) to public wallets on this tenant. Private wallets report matched=false. URNs come from the JSON body {urns:[...]} or, if absent, from ?urns=a,b,c (GET also works). No auth.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "urns",
            "in": "query",
            "required": false,
            "description": "Comma-separated URNs (used when the body has none)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "urns": {
                    "type": "array",
                    "maxItems": 200,
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rows",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "rows": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "urn": {
                            "type": "string"
                          },
                          "matched": {
                            "type": "boolean"
                          },
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "did": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "No URNs or more than 200. Body (text/plain): urns_required, too_many_urns_max_200.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallets/{companyId}/did.json": {
      "get": {
        "tags": [
          "business-wallet",
          "did"
        ],
        "operationId": "bwDidDocument",
        "summary": "did:web DID Document of one business wallet",
        "description": "Resolution target of did:web:<host>:business-wallets:<companyId>. Lists the tenant issuer key as verification method #key-1 (JsonWebKey2020) and service endpoints for the wallet page and API. Also answered at /business-wallet.ashx?action=bw-did-doc&bw=<id>. Public. Cache-Control: public, max-age=60.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "companyId",
            "in": "path",
            "required": true,
            "description": "Business wallet id",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "DID Document",
            "content": {
              "application/did+json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletDidDocument"
                }
              }
            }
          },
          "400": {
            "description": "Bad id. Body (text/plain): bw_required, invalid_bw.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "404": {
            "description": "No such wallet. Body (text/plain): wallet_not_found.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=identity": {
      "get": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwIdentity",
        "summary": "Tenant or business-wallet identifiers (DIDs and wallet URN)",
        "description": "Without bw: the tenant's did:web, did:webvh, did:key, did:jwk and wallet URN. With bw: the per-wallet path-scoped did:web / did:webvh, the shared did:key / did:jwk of the tenant issuer key, the wallet URN and its DID document URL. Computed values; it does not check that the wallet exists. Public.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": false,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "responses": {
          "200": {
            "description": "Identifiers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BwIdentity"
                }
              }
            }
          },
          "400": {
            "description": "Invalid bw. Body (text/plain): invalid_bw.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=resolve-identity": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwResolveIdentity",
        "summary": "Suggest a name and e-mail for a DID or wallet URN (form auto-fill)",
        "description": "For did:web:<host>: fetches https://<host>/.well-known/openid-federation and reads organization_name and the first contact (HTTPS only, no redirects, 5 s timeout, 32 KB cap, fixed path). For a wallet URN of a public wallet on this tenant: the local company name. did:key / did:jwk carry no metadata. Always HTTP 200; check resolved and reason. Public. Rate-limited per IP (20 per minute); hostnames that resolve to private, loopback or metadata addresses are refused.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "maxLength": 500,
                    "example": "did:web:example.com"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "resolved": {
                      "type": "boolean"
                    },
                    "reason": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string"
                    },
                    "host": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/business-wallet.ashx?action=public-view": {
      "get": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwPublicView",
        "summary": "Read-only public profile of a public business wallet",
        "description": "Company profile (name, registration, jurisdiction, VAT, address, DID), employee names and roles, document and credential counts. A private wallet and a missing wallet both answer 404 so wallets cannot be enumerated. Public. Rate-limited per IP (60 per minute).",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "responses": {
          "200": {
            "description": "Public view",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "company": {
                      "$ref": "#/components/schemas/BwCompany"
                    },
                    "employees": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "doc_count": {
                      "type": "integer"
                    },
                    "vc_count": {
                      "type": "integer"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "wallet_id": {
                      "type": "string"
                    },
                    "bw": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing bw. Body (text/plain): bw_required, invalid_bw.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "404": {
            "description": "Not found or not public. Body: {\"error\":\"wallet_not_found\"}",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/business-wallet.ashx?action=share-download": {
      "get": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwShareDownload",
        "summary": "Download a document through a signed share link",
        "description": "Target of links from create-share-link. The token t is HMAC-signed for this tenant, wallet and document, may expire and can be revoked (revoke-share). Returns the file as an attachment (PDF), X-Content-Type-Options: nosniff, no-store. The download is written to the wallet's audit log. No bearer: the link is the credential.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "t",
            "in": "query",
            "required": true,
            "description": "Share token from create-share-link (5 dot-separated segments, max 512 chars)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Document",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad token. Body (text/plain): token_required, bad_token.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Signature does not match. Body (text/plain): bad_signature.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "404": {
            "description": "Wallet or document gone. Body (text/plain): wallet_not_found, not_found.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "410": {
            "description": "Link expired or revoked. Body (text/plain): link_expired, link_revoked.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=registry-push": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwRegistryPush",
        "summary": "External party pushes a document into a business wallet",
        "description": "Lets a registry, bank or other external party deliver a document (for example a certificate) into a company's wallet. The sender is either a company on this tenant's trust list proving possession of its DID key (X-Push-Auth: company + X-Push-Did + X-Push-Proof, a signed proof bound to this wallet, this action, the body hash, the time and a single-use id), or a signed-in member of the wallet or a tenant administrator (OIDC bearer). multipart/form-data with one PDF (same PDF checks as upload-doc, max 8 MB); max 500 documents per wallet. 30 pushes per minute per IP. The document is queued for a wallet seal on receipt and directors/secretaries are notified. An unknown wallet answers 404 only after authentication.",
        "security": [
          {
            "oidcBearer": []
          },
          {}
        ],
        "x-codeb-audience": "operator",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          },
          {
            "name": "X-Push-Auth",
            "in": "header",
            "required": false,
            "description": "company for a company DID with a signed proof; omitted for an OIDC bearer",
            "schema": {
              "type": "string",
              "enum": [
                "company"
              ]
            }
          },
          {
            "name": "X-Push-Did",
            "in": "header",
            "required": false,
            "description": "With X-Push-Auth: company - the sender's did:web:<host>, exactly as on this tenant's trust list",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Push-Proof",
            "in": "header",
            "required": false,
            "description": "With X-Push-Auth: company - compact JWS, header {alg: ES256, typ: bw-push-proof+jwt}, signed with a key of the sender's DID document as cached on the trust list. Payload: iss (the DID), aud (this host or https://host), bw (target wallet), act (registry-push or countersign), body_sha256 (base64url SHA-256 of the exact request body), iat (within 5 minutes), jti (8-128 chars, single use), optional exp.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "incorp",
                      "ubo",
                      "sow",
                      "board",
                      "poa",
                      "financials",
                      "bank-ref",
                      "tax",
                      "ml",
                      "director-id",
                      "vat",
                      "other"
                    ]
                  },
                  "issuer": {
                    "type": "string",
                    "maxLength": 200
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stored",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "doc": {
                      "$ref": "#/components/schemas/BwDocMeta"
                    },
                    "accepted_via": {
                      "type": "string",
                      "enum": [
                        "registry",
                        "pid",
                        "oidc"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Body (text/plain): bw_required, invalid_bw, file_required, empty_file.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "Sender not authenticated. Body (text/plain): registry_push_auth_failed.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "409": {
            "description": "Wallet document limit reached. Body (text/plain): doc_limit_reached.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "413": {
            "description": "File over 8 MB. Body (text/plain): file_too_large_max_8388608.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): upload_failed, internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Proof refused (missing, bad signature, wrong wallet/action/body/time, replayed jti, sender not on the trust list) or the signed-in caller is not a member. Body (text/plain): registry_push_auth_failed:<reason>.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "404": {
            "description": "Unknown wallet (checked after authentication).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "description": "Replay store unavailable. Body (text/plain): replay_store_unavailable.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=countersign": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwCountersign",
        "summary": "Countersign (endorse) a document in a business wallet",
        "description": "Adds a countersignature record {ts, signer, statement, note} to a document. Either with invite_token from invite-countersign (the invite fixes wallet, document and statement and may expire or be revoked), or authenticated like registry-push (company DID with X-Push-Proof, or OIDC bearer of a member of the wallet or a tenant administrator) with ?bw=. 30 per minute per IP (shared with registry-push). Statement is one of accepted, verified, approved, endorsed, witnessed (other values become endorsed). This is a signed record kept by the wallet, not a cryptographic signature over the file.",
        "security": [
          {
            "oidcBearer": []
          },
          {}
        ],
        "x-codeb-audience": "operator",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": false,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          },
          {
            "name": "X-Push-Auth",
            "in": "header",
            "required": false,
            "description": "company for a company DID with a signed proof; omitted for an OIDC bearer",
            "schema": {
              "type": "string",
              "enum": [
                "company"
              ]
            }
          },
          {
            "name": "X-Push-Did",
            "in": "header",
            "required": false,
            "description": "With X-Push-Auth: company - the sender's did:web:<host>, exactly as on this tenant's trust list",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Push-Proof",
            "in": "header",
            "required": false,
            "description": "With X-Push-Auth: company - compact JWS, header {alg: ES256, typ: bw-push-proof+jwt}, signed with a key of the sender's DID document as cached on the trust list. Payload: iss (the DID), aud (this host or https://host), bw (target wallet), act (registry-push or countersign), body_sha256 (base64url SHA-256 of the exact request body), iat (within 5 minutes), jti (8-128 chars, single use), optional exp.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "docId"
                ],
                "properties": {
                  "docId": {
                    "type": "string"
                  },
                  "statement": {
                    "type": "string",
                    "enum": [
                      "accepted",
                      "verified",
                      "approved",
                      "endorsed",
                      "witnessed"
                    ]
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "invite_token": {
                    "type": "string",
                    "maxLength": 1024
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Recorded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "countersignature": {
                      "$ref": "#/components/schemas/BwCountersignature"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Body (text/plain): bad_id, bad_invite_token, invite_docId_mismatch, invite_bw_mismatch, bw_required, invalid_bw.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No invite and no authenticated signer. Body (text/plain): countersign_auth_or_invite_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Proof refused (missing, bad signature, wrong wallet/action/body/time, replayed jti, sender not on the trust list) or the signed-in caller is not a member. Body (text/plain): countersign_auth_failed:<reason>.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "404": {
            "description": "Unknown wallet (checked after authentication).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "410": {
            "description": "Invite expired or revoked. Body (text/plain): invite_expired, invite_revoked.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "description": "Replay store unavailable. Body (text/plain): replay_store_unavailable.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=agent-manifest": {
      "get": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwAgentManifest",
        "summary": "Public descriptor of an agent identity in a business wallet",
        "description": "Lets any service that receives an agent token look up the agent: agent DID, owner wallet DID, issuer key, token type and the revocation list URL. Public. Cache-Control: public, max-age=60. An unknown wallet answers 404 and nothing is created.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          },
          {
            "name": "emp",
            "in": "query",
            "required": true,
            "description": "Agent employee id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Manifest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BwAgentManifest"
                }
              }
            }
          },
          "400": {
            "description": "Missing parameters. Body (text/plain): bw_required, invalid_bw, emp_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "404": {
            "description": "No such agent. Body (text/plain): agent_not_found.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=verify-agent-token": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwVerifyAgentToken",
        "summary": "Verify an agent token (codeb-agent-token+jwt) issued by a business wallet",
        "description": "Checks an agent token minted on this tenant: ES256 signature with the current tenant issuer key (kid must match), expiry, issuer wallet, agent still present and active, and not revoked. Token from the JSON body {token} or ?token= (GET also works). Always HTTP 200 for a supplied token; read verified and reason. Public.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "token",
            "in": "query",
            "required": false,
            "description": "Agent token (when not in the body)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string",
                    "maxLength": 8192
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BwAgentTokenVerify"
                }
              }
            }
          },
          "400": {
            "description": "No token. Body (text/plain): token_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=agent-status-list": {
      "get": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwAgentStatusList",
        "summary": "Revocation list of a business wallet's agent tokens and mDocs",
        "description": "W3C Bitstring Status List credential (revocation) covering agent tokens (status index sti) and mDocs issued by this wallet. Served as unsigned JSON (application/vc+json). Public. Cache-Control: public, max-age=60. An unknown wallet answers 404 and nothing is created.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "responses": {
          "200": {
            "description": "Status list",
            "content": {
              "application/vc+json": {
                "schema": {
                  "$ref": "#/components/schemas/BwStatusListCredential"
                }
              }
            }
          },
          "400": {
            "description": "Missing bw. Body (text/plain): bw_required, invalid_bw.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "404": {
            "description": "Unknown wallet (nothing is created). Body: wallet_not_found."
          }
        }
      }
    },
    "/business-wallet.ashx?action=create-wallet": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwCreateWallet",
        "summary": "Create a new business wallet",
        "description": "Creates a wallet for a company. The id comes from ?slug or body.slug, else from the company name (lowercase letters, digits, - and _, 4..40 chars). New wallets are private. Auth: OIDC bearer of a signed-in user of this tenant; the caller is recorded as created_by.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "description": "Optional wallet id hint",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "reg": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "juris": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "vat": {
                    "type": "string",
                    "maxLength": 40
                  },
                  "addr": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "slug": {
                    "type": "string",
                    "maxLength": 40
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "did": {
                      "type": "string"
                    },
                    "did_doc_url": {
                      "type": "string"
                    },
                    "wallet_id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad input. Body (text/plain): name_required, invalid_slug, invalid_company_id_derived.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "409": {
            "description": "Id taken. Body (text/plain): wallet_already_exists.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=list-my-wallets": {
      "get": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwListMyWallets",
        "summary": "List the business wallets where the caller is an employee",
        "description": "Public and private wallets on this tenant whose employee list contains the caller (by e-mail or wallet_id), with the caller's role. Auth: OIDC bearer of a signed-in user.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "responses": {
          "200": {
            "description": "Wallets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "actor": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "wallets": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BwWalletSummary"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=list-all-wallets": {
      "get": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwListAllWallets",
        "summary": "Admin: list every business wallet on this tenant",
        "description": "Admin only: OIDC bearer whose token introspection shows role admin or superuser. Every wallet (public and private) with company data and counts, plus leftover directories and recovery copies of deleted wallets. Used by business-wallets-admin.html.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "responses": {
          "200": {
            "description": "Wallets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "wallets": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BwWalletSummary"
                      }
                    },
                    "phantom": {},
                    "tombs": {},
                    "admin_sink": {}
                  }
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Not a tenant admin. Body (text/plain): tenant_admin_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=delete-wallet": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwDeleteWallet",
        "summary": "Admin: delete a business wallet (kept as a recovery copy)",
        "description": "Admin only: OIDC bearer whose token introspection shows role admin or superuser. Moves the wallet to a timestamped recovery copy, purged after the retention period (default 30 days). bw and confirm come from the body or the query; confirm must equal bw.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": false,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "Must equal bw",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "bw": {
                    "type": "string"
                  },
                  "confirm": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "cid": {
                      "type": "string"
                    },
                    "moved_to": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Bad input. Body (text/plain): bw_required, invalid_bw, confirm_mismatch.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Not a tenant admin. Body (text/plain): tenant_admin_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "404": {
            "description": "No such wallet. Body (text/plain): wallet_not_found.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Move failed. Body (text/plain): tomb_collision, move_failed.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=delete-phantoms": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwDeletePhantoms",
        "summary": "Admin: remove leftover wallet directories that hold no wallet",
        "description": "Admin only: OIDC bearer whose token introspection shows role admin or superuser. Deletes directories without a wallet state file (left by aborted creates). Refuses (ok=false) when more than 50 would be deleted. Recovery copies of deleted wallets are kept.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "deleted": {
                      "type": "integer"
                    },
                    "skipped": {
                      "type": "integer"
                    },
                    "skipped_details": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "kept_deleted_sibling": {
                      "type": "integer"
                    },
                    "admin_sink": {
                      "type": "integer"
                    },
                    "phantom_count": {
                      "type": "integer"
                    },
                    "reason": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Not a tenant admin. Body (text/plain): tenant_admin_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Enumeration failed. Body (text/plain): enumeration_failed.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=get-state": {
      "get": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwGetState",
        "summary": "Full state of a business wallet (company, employees, RPs, documents)",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director, secretary, legal, compliance, employee, agent (else 403 role_forbidden:<action>). Returns the company profile, employees, relying parties, document metadata and audit entry count.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "responses": {
          "200": {
            "description": "State",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BwState"
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=save-company": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwSaveCompany",
        "summary": "Update the company profile of a business wallet",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director, secretary (else 403 role_forbidden:<action>). Replaces name, registration, jurisdiction, address, VAT and DID method (web default). Changing public (publish/unpublish) additionally needs the director role (403 publish_toggle_requires_director).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "reg": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "juris": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "addr": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "vat": {
                    "type": "string",
                    "maxLength": 40
                  },
                  "didMethod": {
                    "type": "string",
                    "enum": [
                      "web",
                      "webvh",
                      "key",
                      "jwk"
                    ],
                    "default": "web"
                  },
                  "public": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK (Cache-Control: no-store)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BwOk"
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed. Body (text/plain): role_forbidden:save-company, publish_toggle_requires_director; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=add-employee": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwAddEmployee",
        "summary": "Add an employee (or agent identity) to a business wallet",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director (else 403 role_forbidden:<action>). Needs name and an e-mail or wallet_id (did:web/did:key/did:jwk/did:webvh or urn:aloaha:web-wallet:). role defaults to employee. For role agent, the agent_* fields describe the agent; agent_capabilities limit the scopes its tokens may carry and agent_max_ttl_sec (60..86400, default 3600) their lifetime.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "email": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "wallet_id": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "director",
                      "secretary",
                      "legal",
                      "compliance",
                      "employee",
                      "agent"
                    ]
                  },
                  "agent_model": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "agent_provider_hint": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "agent_purpose": {
                    "type": "string",
                    "maxLength": 400
                  },
                  "agent_capabilities": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9._-]{1,64}$"
                    }
                  },
                  "agent_max_ttl_sec": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Added",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "employee": {
                      "$ref": "#/components/schemas/BwEmployee"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw, name_required, email_or_wallet_id_required, invalid_wallet_id, agent_fields_only_valid_for_agent_role.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "409": {
            "description": "Already enrolled. Body (text/plain): email_already_enrolled, wallet_id_already_enrolled.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=update-employee-role": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwUpdateEmployeeRole",
        "summary": "Change an employee's role",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director (else 403 role_forbidden:<action>). Unknown roles become employee.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "director",
                      "secretary",
                      "legal",
                      "compliance",
                      "employee",
                      "agent"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK (Cache-Control: no-store)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BwOk"
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw, id_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "404": {
            "description": "No such employee. Body (text/plain): employee_not_found.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=remove-employee": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwRemoveEmployee",
        "summary": "Remove an employee from a business wallet",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director (else 403 role_forbidden:<action>). ",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK (Cache-Control: no-store)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BwOk"
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw, id_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "404": {
            "description": "No such employee. Body (text/plain): employee_not_found.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=add-rp": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwAddRelyingParty",
        "summary": "Enrol a relying party (bank, registry, auditor, authority, CSP)",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director, secretary, legal (else 403 role_forbidden:<action>). Relying parties can be granted access to documents. did must be a DID or wallet URN; kind defaults to bank.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "did"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "bank",
                      "registry",
                      "auditor",
                      "authority",
                      "csp"
                    ]
                  },
                  "did": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "email": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "mobile": {
                    "type": "string",
                    "maxLength": 40
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Enrolled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "rp": {
                      "$ref": "#/components/schemas/BwRelyingParty"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw, name_and_did_required, invalid_actor_id.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=remove-rp": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwRemoveRelyingParty",
        "summary": "Remove a relying party and revoke all its document grants",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director, secretary, legal, compliance (else 403 role_forbidden:<action>). ",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK (Cache-Control: no-store)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BwOk"
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw, id_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "404": {
            "description": "No such relying party. Body (text/plain): rp_not_found.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=list-docs": {
      "get": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwListDocs",
        "summary": "List the documents in a business wallet",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director, secretary, legal, compliance, employee, agent (else 403 role_forbidden:<action>). ",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "responses": {
          "200": {
            "description": "Documents",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "docs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BwDocMeta"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=upload-doc": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwUploadDoc",
        "summary": "Upload a PDF document to a business wallet",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director, secretary, legal (else 403 role_forbidden:<action>). multipart/form-data with one PDF (max 8 MB; other files are rejected, malformed PDFs too). Max 500 documents per wallet. Optional sign_by_uploader and wallet_seal request signatures on the PDF at upload.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file",
                  "title",
                  "issuer"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "issuer": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "incorp",
                      "ubo",
                      "sow",
                      "board",
                      "poa",
                      "financials",
                      "bank-ref",
                      "tax",
                      "ml",
                      "director-id",
                      "vat",
                      "other"
                    ]
                  },
                  "sign_by_uploader": {
                    "type": "string",
                    "description": "1/true/on/yes"
                  },
                  "wallet_seal": {
                    "type": "string",
                    "description": "1/true/on/yes"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stored",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "doc": {
                      "$ref": "#/components/schemas/BwDocMeta"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw, title_and_issuer_required, file_required, empty_file, non_pdf_upload_rejected, pdf_malformed.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): upload_failed, pdf_wellformed_check_failed, pdf_magic_check_failed, internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "409": {
            "description": "Document limit reached. Body (text/plain): doc_limit_reached.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "413": {
            "description": "File over 8 MB. Body (text/plain): file_too_large_max_8388608.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=download-doc": {
      "get": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwDownloadDoc",
        "summary": "Download a document from a business wallet",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director, secretary, legal, compliance, employee, agent (else 403 role_forbidden:<action>). Returned as an attachment with X-Content-Type-Options: nosniff and no-store.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Document id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Document",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw, id_required, bad_id.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. Body (text/plain): not_found.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=delete-doc": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwDeleteDoc",
        "summary": "Delete a document from a business wallet",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director, secretary (else 403 role_forbidden:<action>). ",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK (Cache-Control: no-store)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BwOk"
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw, bad_id.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. Body (text/plain): not_found.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=grant-doc": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwGrantDoc",
        "summary": "Grant a relying party access to a document",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director, secretary, legal (else 403 role_forbidden:<action>). The relying party is notified using its stored contact details.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "docId",
                  "rpId"
                ],
                "properties": {
                  "docId": {
                    "type": "string"
                  },
                  "rpId": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK (Cache-Control: no-store)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BwOk"
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw, bad_ids.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "404": {
            "description": "Document not found. Body (text/plain): doc_not_found.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=revoke-doc": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwRevokeDoc",
        "summary": "Revoke a relying party's access to a document",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director, secretary, legal, compliance (else 403 role_forbidden:<action>). ",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "docId",
                  "rpId"
                ],
                "properties": {
                  "docId": {
                    "type": "string"
                  },
                  "rpId": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK (Cache-Control: no-store)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BwOk"
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw, bad_ids.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "404": {
            "description": "Document not found. Body (text/plain): doc_not_found.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=audit-log": {
      "get": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwAuditLog",
        "summary": "Audit log of a business wallet (newest first)",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director, secretary, legal, compliance (else 403 role_forbidden:<action>). ",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Entries (1..2000, default 200)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2000,
              "default": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Entries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "entries": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "total": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=create-share-link": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwCreateShareLink",
        "summary": "Create a signed download link for a document",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director, secretary, legal (else 403 role_forbidden:<action>). Returns a share-download URL (HMAC-signed for this tenant, wallet and document). ttl_sec 0 or absent = no expiry. Each link gets a status index used by revoke-share.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "docId"
                ],
                "properties": {
                  "docId": {
                    "type": "string"
                  },
                  "ttl_sec": {
                    "type": "integer",
                    "minimum": 0
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Link",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "url": {
                      "type": "string"
                    },
                    "status_index": {
                      "type": "integer"
                    },
                    "status_list_url": {
                      "type": "string"
                    },
                    "revoke_url": {
                      "type": "string"
                    },
                    "expires_at": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw, bad_id.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "404": {
            "description": "Document not found. Body (text/plain): doc_not_found.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=revoke-share": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwRevokeShare",
        "summary": "Revoke a share link or countersign invite by its index",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director, secretary, legal, compliance (else 403 role_forbidden:<action>). After this, share-download and countersign refuse the link (410).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          },
          {
            "name": "index",
            "in": "query",
            "required": true,
            "description": "status_index / invite_index",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Revoked",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "revoked_index": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw, bad_index.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=invite-countersign": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwInviteCountersign",
        "summary": "Invite an outside party to countersign a document",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director, secretary, legal (else 403 role_forbidden:<action>). Creates an HMAC-signed invite (default lifetime 7 days) fixing the document and statement, and queues a notification to the invitee's contact details. The invite_token part of the returned URL is what countersign accepts.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "docId"
                ],
                "properties": {
                  "docId": {
                    "type": "string"
                  },
                  "inviteeName": {
                    "type": "string"
                  },
                  "inviteeEmail": {
                    "type": "string"
                  },
                  "inviteeMobile": {
                    "type": "string"
                  },
                  "inviteeDid": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string",
                    "default": "accepted"
                  },
                  "ttl_sec": {
                    "type": "integer",
                    "minimum": 1,
                    "default": 604800
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Invite",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "url": {
                      "type": "string"
                    },
                    "expires_at": {
                      "type": "string"
                    },
                    "invite_index": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw, bad_id.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "404": {
            "description": "Document not found. Body (text/plain): doc_not_found.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=issue-employee-cred": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwIssueEmployeeCredential",
        "summary": "Create an OpenID4VCI offer of an employee credential",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director, secretary (else 403 role_forbidden:<action>). Creates a pre-authorized credential offer at /vci.ashx (valid 10 minutes) for an employee and notifies the employee. vct defaults to the employee-role type; claims are passed to the issuer.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "empId"
                ],
                "properties": {
                  "empId": {
                    "type": "string"
                  },
                  "vct": {
                    "type": "string"
                  },
                  "claims": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Offer",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "offer_id": {
                      "type": "string"
                    },
                    "offer_uri": {
                      "type": "string"
                    },
                    "deep_link": {
                      "type": "string"
                    },
                    "web_link": {
                      "type": "string"
                    },
                    "pre_authorized_code": {
                      "type": "string"
                    },
                    "expires_utc": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw, empId_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "404": {
            "description": "No such employee. Body (text/plain): employee_not_found.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=wia-for-employee": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwWiaForEmployee",
        "summary": "Wallet instance attestation for an employee's wallet key (5 minutes)",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director, secretary, employee (else 403 role_forbidden:<action>). Signs an attestation (5 minutes) over the public P-256 key the employee's wallet generated. Private key material is refused. empId may also be given as ?emp=.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          },
          {
            "name": "emp",
            "in": "query",
            "required": false,
            "description": "Employee id (alternative to body.empId)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "cnf_jwk"
                ],
                "properties": {
                  "empId": {
                    "type": "string"
                  },
                  "cnf_jwk": {
                    "$ref": "#/components/schemas/WalletJwkP256Public"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Attestation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "wia": {
                      "type": "string"
                    },
                    "exp": {
                      "type": "integer"
                    },
                    "cnf": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw, empId_required, cnf_jwk_required_public_key_only, cnf_jwk_must_not_contain_private_component_d, cnf_jwk_must_be_ec_p256_with_x_and_y.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "404": {
            "description": "No such employee. Body (text/plain): employee_not_found.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=mdoc-issue": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwMdocIssue",
        "summary": "Issue an ISO mdoc to an employee's wallet key",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director, secretary (else 403 role_forbidden:<action>). With a public EC cnf_jwk the mdoc (docType default org.iso.18013.5.1.mDL) is created at once (synchronous=true) and stored as a wallet document; revocable via revoke-mdoc. Without a usable key the request is queued (enqueued=true) and nothing is returned yet.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "empId"
                ],
                "properties": {
                  "empId": {
                    "type": "string"
                  },
                  "docType": {
                    "type": "string",
                    "default": "org.iso.18013.5.1.mDL"
                  },
                  "cnf_jwk": {
                    "$ref": "#/components/schemas/WalletJwkP256Public"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "synchronous": {
                      "type": "boolean"
                    },
                    "enqueued": {
                      "type": "boolean"
                    },
                    "docType": {
                      "type": "string"
                    },
                    "empId": {
                      "type": "string"
                    },
                    "mdoc_url": {
                      "type": "string"
                    },
                    "mdoc_id": {
                      "type": "string"
                    },
                    "size": {
                      "type": "integer"
                    },
                    "status_idx": {
                      "type": "integer"
                    },
                    "status_list_url": {
                      "type": "string"
                    },
                    "revoke_url": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw, empId_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=wallet-export": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwWalletExport",
        "summary": "Export a business wallet as a passphrase-encrypted bundle",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director (else 403 role_forbidden:<action>). Returns an encrypted, MAC-protected bundle (.cbbw; key from the passphrase with PBKDF2-SHA256, 100k iterations) with state, document metadata, audit log and document files (4 MB per file, 32 MB total; larger files are listed as truncated).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "passphrase"
                ],
                "properties": {
                  "passphrase": {
                    "type": "string",
                    "minLength": 12,
                    "maxLength": 512
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bundle (attachment)",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw, passphrase_min_12_chars.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "413": {
            "description": "Bundle over 32 MB. Body (text/plain): bundle_too_large_max_32mb.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=wallet-import": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwWalletImport",
        "summary": "Restore a business wallet from an exported bundle (overwrites)",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director (else 403 role_forbidden:<action>). Decrypts and checks the bundle, which must belong to this tenant and wallet, then overwrites the wallet's state, document metadata and audit log. Document files in the bundle are counted but not written back. Bundle max 32 MB.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file",
                  "passphrase"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "passphrase": {
                    "type": "string",
                    "minLength": 12
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Restored",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "verified": {
                      "type": "boolean"
                    },
                    "restored": {
                      "type": "boolean"
                    },
                    "restored_state": {},
                    "restored_docs_meta": {
                      "type": "integer"
                    },
                    "restored_audit": {
                      "type": "integer"
                    },
                    "decoded_size": {
                      "type": "integer"
                    },
                    "bundle_version": {
                      "type": "string"
                    },
                    "restored_doc_bytes": {
                      "type": "integer"
                    },
                    "truncated_docs": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "note": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw, file_and_passphrase_required, bundle_too_small, bundle_header_mismatch, bundle_decode_failed, bundle_tenant_mismatch, bundle_bw_mismatch.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "Wrong passphrase, tampered bundle, or no valid bearer. Body (text/plain): mac_mismatch, bad_passphrase_or_tampered, decrypt_failed, auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "413": {
            "description": "Bundle over 32 MB. Body (text/plain): bundle_too_large_max_32mb.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=store-vc": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwStoreVc",
        "summary": "Store a verifiable credential (compact JWS) in a business wallet",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director, secretary, legal (else 403 role_forbidden:<action>). Stores the JWT and its decoded header/payload. The signature is not checked here (use verify-vc).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "vc_jwt"
                ],
                "properties": {
                  "vc_jwt": {
                    "type": "string",
                    "maxLength": 65536
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stored",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "vcId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw, vc_jwt_required, vc_jwt_must_be_compact_jws.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=list-vc": {
      "get": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwListVc",
        "summary": "List the credentials stored in a business wallet",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director, secretary, legal, compliance, employee, agent (else 403 role_forbidden:<action>). ",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "responses": {
          "200": {
            "description": "Credentials",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "vcs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "vcId": {
                            "type": "string"
                          },
                          "vct": {
                            "type": "string"
                          },
                          "issuer": {
                            "type": "string"
                          },
                          "iss": {
                            "type": "string"
                          },
                          "sub": {
                            "type": "string"
                          },
                          "iat": {},
                          "exp": {},
                          "stored_at": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=get-vc": {
      "get": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwGetVc",
        "summary": "Get one stored credential with its metadata",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director, secretary, legal, compliance, employee (else 403 role_forbidden:<action>). ",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "vcId",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "vcId": {
                      "type": "string"
                    },
                    "vc_jwt": {
                      "type": "string"
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw, bad_id.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. Body (text/plain): not_found.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=delete-vc": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwDeleteVc",
        "summary": "Delete a stored credential",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director, secretary (else 403 role_forbidden:<action>). ",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vcId": {
                    "type": "string"
                  },
                  "id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK (Cache-Control: no-store)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BwOk"
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw, bad_id.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. Body (text/plain): not_found.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=verify-vc": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwVerifyVc",
        "summary": "Verify a stored credential's issuer signature",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director, secretary, legal, compliance, employee, agent (else 403 role_forbidden:<action>). Runs /vcdm.ashx?action=verify on the stored JWT (result in result); if that is unavailable, checks credentials of this tenant's own issuer locally. Read verified and reason.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vcId": {
                    "type": "string"
                  },
                  "id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "vcId": {
                      "type": "string"
                    },
                    "verified": {
                      "type": "boolean"
                    },
                    "reason": {
                      "type": "string"
                    },
                    "via": {
                      "type": "string",
                      "enum": [
                        "vcdm-loopback",
                        "local"
                      ]
                    },
                    "result": {
                      "$ref": "#/components/schemas/WalletVcdmVerifyResult"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw, bad_id.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. Body (text/plain): not_found.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=list-agents": {
      "get": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwListAgents",
        "summary": "List the agent identities of a business wallet",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director, secretary, legal, compliance, employee (else 403 role_forbidden:<action>). ",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "responses": {
          "200": {
            "description": "Agents",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "agents": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BwEmployee"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=mint-agent-token": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwMintAgentToken",
        "summary": "Mint a scoped, short-lived token for an agent identity",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director, secretary (else 403 role_forbidden:<action>). Returns an ES256 JWT (typ=codeb-agent-token+jwt) with iss = wallet DID, sub = agent DID, scope (each entry must be one of the agent's capabilities), optional aud and purpose_hint, and a status entry (sti) in the wallet's agent status list. ttl_sec min 60, max the agent's agent_max_ttl_sec (default 3600). Third parties check it with verify-agent-token.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "empId"
                ],
                "properties": {
                  "empId": {
                    "type": "string"
                  },
                  "scope": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 64
                    }
                  },
                  "ttl_sec": {
                    "type": "integer",
                    "minimum": 60
                  },
                  "audience": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "purpose_hint": {
                    "type": "string",
                    "maxLength": 400
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "token": {
                      "type": "string"
                    },
                    "exp": {
                      "type": "integer"
                    },
                    "iat": {
                      "type": "integer"
                    },
                    "agent_did": {
                      "type": "string"
                    },
                    "owner_did": {
                      "type": "string"
                    },
                    "scope": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "typ": {
                      "type": "string"
                    },
                    "ttl_sec": {
                      "type": "integer"
                    },
                    "sti": {
                      "type": "integer"
                    },
                    "status_list_url": {
                      "type": "string"
                    },
                    "revoke_url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw, empId_required, employee_not_agent, ttl_exceeds_agent_max_ttl_sec:<n>, scope_not_permitted:<scope>.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed, or agent deactivated. Body (text/plain): role_forbidden:mint-agent-token, agent_deactivated; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "404": {
            "description": "No such agent. Body (text/plain): agent_not_found.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=deactivate-agent": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwDeactivateAgent",
        "summary": "Deactivate an agent identity (its tokens stop verifying)",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director, secretary (else 403 role_forbidden:<action>). ",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deactivated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw, id_required, employee_not_agent.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "404": {
            "description": "No such agent. Body (text/plain): agent_not_found.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=revoke-agent-token": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwRevokeAgentToken",
        "summary": "Revoke one agent token by its status index (sti)",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director, secretary (else 403 role_forbidden:<action>). ",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "sti"
                ],
                "properties": {
                  "sti": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 131071
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Revoked",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "revoked_sti": {
                      "type": "integer"
                    },
                    "status_list_url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw, sti_required, sti_out_of_range.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=revoke-mdoc": {
      "post": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwRevokeMdoc",
        "summary": "Revoke an mdoc issued by the wallet by its status index",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director, secretary (else 403 role_forbidden:<action>). ",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "idx"
                ],
                "properties": {
                  "idx": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 131071
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Revoked",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw, idx_required, idx_out_of_range.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=list-shared-in": {
      "get": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwListSharedIn",
        "summary": "Documents other wallets on this tenant have shared with this wallet",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director, secretary, legal, compliance, employee, agent (else 403 role_forbidden:<action>). Lists documents in other business wallets of this tenant that are granted to a relying party whose DID or URN is this wallet's.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          }
        ],
        "responses": {
          "200": {
            "description": "Shared documents",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "my_cid": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "scanned_wallets": {
                      "type": "integer"
                    },
                    "shared": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Role not allowed for this action. Body (text/plain): role_forbidden:<action>; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/business-wallet.ashx?action=cross-download": {
      "get": {
        "tags": [
          "business-wallet"
        ],
        "operationId": "bwCrossDownload",
        "summary": "Download a document another wallet has shared with this wallet",
        "description": "Auth: OIDC bearer of a signed-in user of this tenant (checked live against userinfo). The caller must be listed in the wallet's employees (matched by e-mail or wallet_id) or be a tenant administrator (else 403 not_a_wallet_member); an employee's role must be one of: director, secretary, legal, compliance, employee, agent (else 403 role_forbidden:<action>). Allowed only when the document in wallet `from` is granted to a relying party that is this wallet.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "bw",
            "in": "query",
            "required": true,
            "description": "Business wallet id (companyId)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{4,40}$"
            },
            "example": "acme-ltd"
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "description": "Wallet id of the sharing wallet",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "doc",
            "in": "query",
            "required": true,
            "description": "Document id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Document",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid wallet id, or bad input. Body (text/plain): bw_required, invalid_bw, from_required, doc_required, bad_from, bad_doc, cross_download_same_wallet.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "401": {
            "description": "No valid bearer. Body (text/plain): auth_required.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "403": {
            "description": "Not granted to this wallet, or role not allowed. Body (text/plain): not_granted_to_you, role_forbidden:cross-download; or not a member of this wallet. Body (text/plain): not_a_wallet_member.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Body (text/plain): internal_error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          },
          "404": {
            "description": "Not found. Body (text/plain): wallet_not_found, doc_not_found.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPlainError"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=ping": {
      "get": {
        "tags": [
          "oidc-op"
        ],
        "operationId": "oidcPing",
        "summary": "Liveness probe with build id and OpenID4VP session counters",
        "description": "Unauthenticated. Returns the handler build, the resolved tenant, the server time (Unix seconds) and in-memory counters of OpenID4VP sessions since the last restart.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "ping"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "build": {
                      "type": "string"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "now": {
                      "type": "integer"
                    },
                    "vp_started": {
                      "type": "integer"
                    },
                    "vp_completed": {
                      "type": "integer"
                    },
                    "vp_abandoned": {
                      "type": "integer"
                    },
                    "vp_pending_or_inflight": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=login": {
      "post": {
        "tags": [
          "sign-in"
        ],
        "operationId": "oidcLogin",
        "summary": "Password sign-in (HA1 digest) for the hosted login page",
        "description": "Called by /login.html. The browser never sends the password: it sends `ha1` = lowercase hex MD5 of `username:realm:password`, where realm is the tenant host name. On success the response carries the next navigation target (when `return` is an /oauth2/v1/authorize URL an authorization code is minted directly into the redirect) plus an SSO assertion for silent re-sign-in. Accounts with TOTP enrolled get a `requires: totp` challenge instead; finish with ?action=totp-verify. Per-IP limit: 10 attempts per 60 s (shared with the other sign-in endpoints).",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "login"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "username": {
                    "type": "string"
                  },
                  "ha1": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{32}$",
                    "description": "32 lowercase hex chars"
                  },
                  "return": {
                    "type": "string",
                    "description": "Return URL (same-origin); default /"
                  }
                },
                "required": [
                  "username",
                  "ha1"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Signed in, or second factor required",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/CoreSignInResult"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "requires": {
                          "type": "string",
                          "enum": [
                            "totp"
                          ]
                        },
                        "session_id": {
                          "type": "string"
                        },
                        "return": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "requires",
                        "session_id"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "username and ha1 required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "invalid_credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "claim_pending (account must be claimed first; body carries claim_url) or account_disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=sso-mint": {
      "post": {
        "tags": [
          "sign-in"
        ],
        "operationId": "oidcSsoMint",
        "summary": "Silent re-sign-in: exchange an SSO assertion for an authorization code",
        "description": "Called by /login.html when the browser still holds a valid `sso_assertion` from an earlier sign-in. `return` must be an /oauth2/v1/authorize URL of a registered client; the response redirects to the client with a fresh code and returns a refreshed assertion. The assertion keeps the original auth_time; expired assertions are refused.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "sso-mint"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "assertion": {
                    "type": "string",
                    "description": "JWS from a previous sign-in (typ sso)"
                  },
                  "return": {
                    "type": "string",
                    "description": "/oauth2/v1/authorize?... URL"
                  }
                },
                "required": [
                  "assertion",
                  "return"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Code minted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreSignInResult"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request or invalid_return",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "invalid_assertion or assertion_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=jar-proxy": {
      "get": {
        "tags": [
          "eu-wallet-verifier"
        ],
        "operationId": "oidcJarProxy",
        "summary": "Fetch a third-party verifier's signed request object for the web wallet",
        "description": "Used by the browser-based web wallet, which cannot fetch a cross-origin request_uri itself. Fetches `url` server-side and returns the raw JWS (application/oauth-authz-req+jwt). Hardened against SSRF: https only, no redirects followed, loopback/private/link-local targets refused (unless the operator allow-lists the host), response size capped. Requires the request itself to arrive over https.",
        "security": [],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "jar-proxy"
              ]
            }
          },
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "https URL of the request object (request_uri)"
          }
        ],
        "responses": {
          "200": {
            "description": "Request object",
            "content": {
              "application/oauth-authz-req+jwt": {
                "schema": {
                  "type": "string",
                  "description": "Compact JWS"
                }
              }
            }
          },
          "400": {
            "description": "url_required, url_malformed, https_required, host_not_routable, host_unresolvable, host_resolves_to_private_ip",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "https_required (request reached the server over plain http)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "upstream_error, upstream_redirect_refused, response_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "proxy_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/jwt-vc-issuer": {
      "get": {
        "tags": [
          "well-known",
          "credential-catalog"
        ],
        "operationId": "getJwtVcIssuerMetadata",
        "summary": "SD-JWT VC issuer metadata (issuer + jwks_uri)",
        "description": "SD-JWT VC issuer metadata discovery document (draft-ietf-oauth-sd-jwt-vc). Lets a verifier find the keys that sign this tenant's SD-JWT VCs. CORS: *. A trailing slash and sub-paths are accepted. Rewritten to /oidc.ashx?action=jwt-vc-issuer.",
        "security": [],
        "x-codeb-audience": "public",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "issuer": {
                      "type": "string",
                      "format": "uri"
                    },
                    "jwks_uri": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "issuer",
                    "jwks_uri"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/web-identity": {
      "get": {
        "tags": [
          "well-known",
          "eu-wallet-verifier"
        ],
        "operationId": "getWebIdentityManifest",
        "summary": "Digital Credentials API wallet manifest of this origin",
        "description": "Wallet registration manifest for browsers that implement the W3C Digital Credentials API: names this origin's web wallet, the presentation protocols it speaks (OpenID4VP variants) and the credential types it holds (PID test credentials in SD-JWT VC and mdoc form). CORS: *. Rewritten to /oidc.ashx?action=web-identity.",
        "security": [],
        "x-codeb-audience": "public",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "provider_name": {
                      "type": "string"
                    },
                    "provider_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "provider_icon": {
                      "type": "string",
                      "format": "uri"
                    },
                    "wallet_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "protocols": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "trust_frameworks": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "supported_credentials": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "vct": {
                            "type": "string"
                          },
                          "doctype": {
                            "type": "string"
                          },
                          "format": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "standards": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "uri"
                      }
                    },
                    "support_contact": {
                      "type": "string",
                      "format": "uri"
                    },
                    "tenant": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/trust-list.jwt": {
      "get": {
        "tags": [
          "well-known",
          "credential-catalog"
        ],
        "operationId": "getTrustListJwt",
        "summary": "Signed trust list of this tenant's credential-signing keys",
        "description": "Compact JWS (header typ `trust-list+jwt`, RS256) whose payload lists the tenant as a trusted authority together with its signing JWKS; consumers of the schema-metadata catalogue use it to check record signatures. Cached server-side. Rewritten to /oidc.ashx?action=trust-list-jwt.",
        "security": [],
        "x-codeb-audience": "public",
        "responses": {
          "200": {
            "description": "Trust list",
            "content": {
              "application/jwt": {
                "schema": {
                  "type": "string",
                  "description": "Compact JWS: payload {iss, iat, exp, trustedAuthorities:[{iss, jwks}]}"
                }
              }
            }
          },
          "500": {
            "description": "key or signing failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=security-txt": {
      "get": {
        "tags": [
          "well-known"
        ],
        "operationId": "getSecurityTxt",
        "summary": "Per-tenant security.txt (RFC 9116)",
        "description": "Returns the tenant's RFC 9116 security.txt built from its own configuration; 404 when the tenant has none configured. GET only; a request with a body is refused. The handler also answers when reached at /.well-known/security.txt.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "security-txt"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "security.txt",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Request body not allowed / bad configuration",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Not configured for this tenant",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "description": "GET only",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "description": "Configuration unreadable",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=verifier-metadata": {
      "get": {
        "tags": [
          "eu-wallet-verifier"
        ],
        "operationId": "oidcVerifierMetadata",
        "summary": "OpenID4VP verifier metadata of this tenant (client_id, formats, endpoints)",
        "description": "Describes the tenant's OpenID4VP verifier: client_id in both client identifier prefixes (x509_hash default, x509_san_dns), supported credential formats and algorithms (dc+sd-jwt, mso_mdoc, ES256), response encryption (ECDH-ES / A128GCM), the certificate thumbprint and the vp-start / vp-request / vp-response endpoint templates. The ES256 key is created on first use. 503 when the operator has switched the verifier off.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "verifier-metadata"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "client_id": {
                      "type": "string"
                    },
                    "client_id_scheme": {
                      "type": "string"
                    },
                    "client_id_schemes_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "x509_hash_value": {
                      "type": "string"
                    },
                    "request_object_signing_alg_values_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "vp_formats_supported": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "authorization_encrypted_response_alg": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "authorization_encrypted_response_enc": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "x509_thumbprint_sha1": {
                      "type": "string"
                    },
                    "request_uri_endpoint": {
                      "type": "string"
                    },
                    "response_uri_endpoint": {
                      "type": "string"
                    },
                    "vp_start_endpoint": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "500": {
            "description": "key_setup_failed / key_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "vc_verifier_disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=de-registrar-wrps": {
      "get": {
        "tags": [
          "credential-catalog"
        ],
        "operationId": "oidcRegistrarRpListProxy",
        "summary": "Cached copy of an external sandbox registrar's relying-party list",
        "description": "Read-through cache (1 hour) of the public list of registered wallet-relying parties published by an external national EUDI sandbox registrar, served with CORS * so /eudi-registration.html can show it. Falls back to the last good copy when the upstream is unreachable. The operator can disable it (503).",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "de-registrar-wrps"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Upstream JSON as received",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "502": {
            "description": "de_registrar_upstream_unreachable (no cached copy)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "de_registrar_proxy_disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=schema-metadata": {
      "get": {
        "tags": [
          "credential-catalog"
        ],
        "operationId": "oidcSchemaMetadataList",
        "summary": "List the attestation schema records of every published credential type",
        "description": "Attestation schema catalogue in the shape used by EUDI registrar catalogues. Records are built from the tenant's credential type definitions; CORS *, cacheable 5 minutes.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "schema-metadata"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CoreSchemaMetadataRecord"
                  }
                }
              }
            }
          },
          "500": {
            "description": "schema_metadata_list_ex",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=schema-metadata-item": {
      "get": {
        "tags": [
          "credential-catalog"
        ],
        "operationId": "oidcSchemaMetadataItem",
        "summary": "Get one attestation schema record by slug",
        "description": "One record of the catalogue. Records are built from the tenant's credential type definitions; CORS *, cacheable 5 minutes.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "schema-metadata-item"
              ]
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Record slug (case-insensitive)"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreSchemaMetadataRecord"
                }
              }
            }
          },
          "400": {
            "description": "missing_id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=schema-metadata-versions": {
      "get": {
        "tags": [
          "credential-catalog"
        ],
        "operationId": "oidcSchemaMetadataVersions",
        "summary": "List the versions of one attestation schema record",
        "description": "Version list of a record (currently one version per record, marked isLatest). Records are built from the tenant's credential type definitions; CORS *, cacheable 5 minutes.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "schema-metadata-versions"
              ]
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Record slug"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "version": {
                        "type": "string"
                      },
                      "issuedAt": {
                        "type": "string"
                      },
                      "isLatest": {
                        "type": "boolean"
                      },
                      "deprecated": {
                        "type": "boolean"
                      },
                      "deprecationMessage": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "supersededByVersion": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "jwtUrl": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "missing_id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=schema-metadata-vocabularies": {
      "get": {
        "tags": [
          "credential-catalog"
        ],
        "operationId": "oidcSchemaMetadataVocabularies",
        "summary": "Category and tag vocabularies used by the schema catalogue",
        "description": "Static vocabulary document (categories such as identity, health, finance, education; tags such as pid, kyc, age-verification). CORS *.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "schema-metadata-vocabularies"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "version": {
                      "type": "string"
                    },
                    "categories": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "tags": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=rulebook": {
      "get": {
        "tags": [
          "credential-catalog"
        ],
        "operationId": "oidcRulebook",
        "summary": "Generated markdown rulebook for one credential type",
        "description": "Markdown rulebook generated from the credential type's metadata (name, description, claims). Its SHA-256 matches `rulebookIntegrity` in the schema record. CORS *, cacheable 1 hour.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "rulebook"
              ]
            }
          },
          {
            "name": "slug",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Credential type slug [A-Za-z0-9_.-]"
          }
        ],
        "responses": {
          "200": {
            "description": "Rulebook",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "missing_slug / bad_slug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "rulebook_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=lotl-cert-inspect": {
      "get": {
        "tags": [
          "lotl"
        ],
        "operationId": "oidcLotlCertInspect",
        "summary": "Decode one cached EU trust-list anchor certificate",
        "description": "Parses a trust anchor from the LOTL cache (see /lotl.ashx?anchors) and returns its X.509 fields: subject, issuer, serial, validity, thumbprints, algorithms, key usage, extended key usage, basic constraints and raw extensions. Used by /lotl-certs.html. CORS *.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "lotl-cert-inspect"
              ]
            }
          },
          {
            "name": "anchor",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{64}$"
            },
            "description": "SHA-256 of the anchor (64 hex chars)"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "anchor_sha256": {
                      "type": "string"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "issuer": {
                      "type": "string"
                    },
                    "serial_hex": {
                      "type": "string"
                    },
                    "not_before_utc": {
                      "type": "string"
                    },
                    "not_after_utc": {
                      "type": "string"
                    },
                    "version": {
                      "type": "integer"
                    },
                    "thumbprint_sha1": {
                      "type": "string"
                    },
                    "thumbprint_sha256": {
                      "type": "string"
                    },
                    "signature_algorithm_oid": {
                      "type": "string"
                    },
                    "public_key_algorithm_oid": {
                      "type": "string"
                    },
                    "is_self_signed": {
                      "type": "boolean"
                    },
                    "extensions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "bad_anchor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "anchor_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "pem_decode_fail / x509_parse_fail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=wallet-link-list": {
      "get": {
        "tags": [
          "eu-wallet-verifier",
          "account"
        ],
        "operationId": "oidcWalletLinkList",
        "summary": "List the EU Wallet PIDs linked to the signed-in account",
        "description": "Returns the wallet links of the caller (EU Wallet PID presentations that are bound to this account for wallet sign-in): link id, PID issuer and creation time. No PID data is returned.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "wallet-link-list"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "links": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "16 hex chars"
                          },
                          "issuer": {
                            "type": "string"
                          },
                          "created_utc": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "login_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=wallet-link-delete": {
      "post": {
        "tags": [
          "eu-wallet-verifier",
          "account"
        ],
        "operationId": "oidcWalletLinkDelete",
        "summary": "Remove one EU Wallet link from the signed-in account",
        "description": "Deletes the caller's own wallet link with the given id. Links of other users are never touched.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "wallet-link-delete"
              ]
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{16}$"
            },
            "description": "Link id from wallet-link-list"
          }
        ],
        "responses": {
          "200": {
            "description": "Removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "removed": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "login_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "removed": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=passkey-signin-start": {
      "post": {
        "tags": [
          "sign-in"
        ],
        "operationId": "oidcPasskeySigninStart",
        "summary": "Start a passkey (WebAuthn) sign-in",
        "description": "Returns PublicKeyCredentialRequestOptions JSON for navigator.credentials.get(). Without `username` the discoverable-credential flow is used (empty allowCredentials). 402 when passkeys are not enabled for the tenant.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "passkey-signin-start"
              ]
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "username": {
                    "type": "string",
                    "description": "Optional; narrows allowCredentials"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Request options (includes a session id to send back on finish)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "402": {
            "description": "feature_not_licensed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "internal_error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=passkey-signin-finish": {
      "post": {
        "tags": [
          "sign-in"
        ],
        "operationId": "oidcPasskeySigninFinish",
        "summary": "Finish a passkey sign-in with the WebAuthn assertion",
        "description": "Verifies the assertion against the stored credential and signs the user in (amr hwk + user). Same success shape as ?action=login.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "passkey-signin-finish"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "session": {
                    "type": "string",
                    "description": "Session id from passkey-signin-start"
                  },
                  "returnUrl": {
                    "type": "string"
                  },
                  "response": {
                    "type": "object",
                    "description": "Full WebAuthn assertion",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Credential id"
                      }
                    },
                    "required": [
                      "id"
                    ],
                    "additionalProperties": true
                  }
                },
                "required": [
                  "response"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Signed in",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreSignInResult"
                }
              }
            }
          },
          "400": {
            "description": "missing_body, invalid_body, missing_credentialId or a verification error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "credential_unknown / user_unknown",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "account_disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "internal_error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=totp-verify": {
      "post": {
        "tags": [
          "sign-in"
        ],
        "operationId": "oidcTotpVerify",
        "summary": "Complete password sign-in with a TOTP, recovery or e-mailed code",
        "description": "Second step after ?action=login answered `requires: totp`. Accepts a 6-digit TOTP code, an unused recovery code, or the code sent by totp-email-fallback. After 5 wrong codes the session is closed. Per-IP limit shared with login.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "totp-verify"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "session_id": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string",
                    "description": "TOTP, recovery or e-mail code; spaces and dashes ignored"
                  }
                },
                "required": [
                  "session_id",
                  "code"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Signed in",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreSignInResult"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, session_expired, not_enrolled, bad_code (with attempts_remaining)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "500": {
            "description": "totp_doc_unreadable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=totp-email-fallback": {
      "post": {
        "tags": [
          "sign-in"
        ],
        "operationId": "oidcTotpEmailFallback",
        "summary": "E-mail a one-time sign-in code when the authenticator is unavailable",
        "description": "Sends a 6-digit code to the account's e-mail address for the pending TOTP session. The answer is the same whether or not an address is on file (no account enumeration); repeated sends are throttled per session.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "totp-email-fallback"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "session_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "session_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Uniform answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreOkMessage"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request / session_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=mdoc-cred-verify": {
      "post": {
        "tags": [
          "eu-wallet-verifier"
        ],
        "operationId": "oidcMdocCredVerify",
        "summary": "Verify the issuer signature of a stored mdoc credential",
        "description": "Checks an ISO/IEC 18013-5 mdoc at rest: verifies IssuerAuth (COSE_Sign1 over the MSO) and the issuer certificate chain against the tenant's configured mdoc issuer anchors. Used by the web wallet to label a card as verified. Body cap 256 KB; 20 requests per minute per IP. 501 when the tenant has no mdoc issuer anchors configured (the card is then never labelled verified).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "mdoc-cred-verify"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "One of issuerSigned or deviceResponse is required.",
                "properties": {
                  "issuerSigned": {
                    "type": "string",
                    "description": "base64url CBOR IssuerSigned"
                  },
                  "deviceResponse": {
                    "type": "string",
                    "description": "base64url CBOR DeviceResponse"
                  },
                  "docType": {
                    "type": "string",
                    "description": "Optional docType hint"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verification result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreMdocVerifyResult"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "500": {
            "description": "verify_throw",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "501": {
            "description": "mdoc_verify_not_configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=claim-info": {
      "get": {
        "tags": [
          "sign-in"
        ],
        "operationId": "oidcClaimInfo",
        "summary": "Check whether a newly onboarded admin account is waiting to be claimed",
        "description": "Used by /claim.html. Tells whether the account still needs to be claimed, when the claim link expires and the masked admin e-mail. The claim token itself is never disclosed. Negative answers are 200 with ok:false and a code.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "claim-info"
              ]
            }
          },
          {
            "name": "username",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Claim state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not-claimable",
                        "claim-file-missing",
                        "claim-file-corrupt"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "username": {
                      "type": "string"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "expiresUtc": {
                      "type": "string"
                    },
                    "expired": {
                      "type": "boolean"
                    },
                    "adminEmailMasked": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "username required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=claim": {
      "post": {
        "tags": [
          "sign-in"
        ],
        "operationId": "oidcClaim",
        "summary": "Claim a newly onboarded admin account and set its password",
        "description": "Consumes the one-time claim token from the onboarding e-mail and stores the new password as HA1 (MD5 of username:realm:password; realm = tenant host), optionally with a browser-computed PBKDF2 hash. Per-IP limit shared with login.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "claim"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "username": {
                    "type": "string"
                  },
                  "claim_token": {
                    "type": "string"
                  },
                  "new_ha1": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{32}$"
                  },
                  "new_pbkdf2": {
                    "type": "string",
                    "description": "Optional pbkdf2:sha256:<iterations>:<salt b64>:<hash b64>"
                  }
                },
                "required": [
                  "username",
                  "claim_token",
                  "new_ha1"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Claimed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "username": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, invalid_or_used, claim_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "500": {
            "description": "internal / claim_file_corrupt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=recover-start": {
      "post": {
        "tags": [
          "sign-in"
        ],
        "operationId": "oidcRecoverStart",
        "summary": "Request a password-reset link by e-mail",
        "description": "Sends a reset link (valid 15 minutes, single use) when an account with this e-mail exists. Always answers with the same message so account existence is not revealed. 402 when self-service recovery is not enabled for the tenant.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "recover-start"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  }
                },
                "required": [
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Uniform answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreOkMessage"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_licensed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=recover-finish": {
      "post": {
        "tags": [
          "sign-in"
        ],
        "operationId": "oidcRecoverFinish",
        "summary": "Set a new password with a reset token",
        "description": "Validates the reset token from the e-mail (15 minutes, single use) and stores the new HA1 (plus optional PBKDF2 hash). Per-IP limit shared with login.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "recover-finish"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string"
                  },
                  "new_ha1": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{32}$"
                  },
                  "new_pbkdf2": {
                    "type": "string"
                  }
                },
                "required": [
                  "token",
                  "new_ha1"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Password reset",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "username": {
                      "type": "string"
                    },
                    "redirect": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, invalid_or_expired, invalid_or_used, user_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_licensed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "500": {
            "description": "internal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=magic-link-start": {
      "post": {
        "tags": [
          "sign-in"
        ],
        "operationId": "oidcMagicLinkStart",
        "summary": "Request a one-time sign-in link by e-mail",
        "description": "Sends a sign-in link (valid 15 minutes, single use) when an account with this e-mail exists; uniform answer otherwise. 402 when magic-link sign-in is not enabled for the tenant.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "magic-link-start"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  }
                },
                "required": [
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Uniform answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreOkMessage"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_licensed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=magic-link-finish": {
      "post": {
        "tags": [
          "sign-in"
        ],
        "operationId": "oidcMagicLinkFinish",
        "summary": "Sign in with a magic-link token",
        "description": "Redeems the token from the e-mailed link and signs the user in; same success shape as ?action=login. Per-IP limit shared with login.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "magic-link-finish"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string"
                  },
                  "return": {
                    "type": "string",
                    "description": "Return URL; default /"
                  }
                },
                "required": [
                  "token"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Signed in",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreSignInResult"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, invalid_or_expired, invalid_or_used, user_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_licensed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "account_disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=data-deletion-request": {
      "post": {
        "tags": [
          "data-protection"
        ],
        "operationId": "oidcDataDeletionRequest",
        "summary": "Lodge a data-deletion request for a data subject",
        "description": "Queues a deletion request (EUDI ARF data-deletion request topic). Anyone may lodge one; the request is recorded with a hash of the subject identifier and handled by the controller within the stated ETA. Body cap 4 KB; 3 requests per hour per IP. 404 when the tenant has switched the endpoint off; 503 when the queue is full.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "data-deletion-request"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sub": {
                    "type": "string",
                    "description": "Subject identifier, max 256 chars"
                  },
                  "requester_type": {
                    "type": "string",
                    "enum": [
                      "self",
                      "controller",
                      "dpa"
                    ]
                  },
                  "contact": {
                    "type": "string",
                    "description": "E-mail address or https URL for the answer"
                  },
                  "reason": {
                    "type": "string",
                    "description": "Optional, truncated to 512 chars"
                  },
                  "wallet_attestation": {
                    "type": "string",
                    "description": "Optional wallet attestation"
                  }
                },
                "required": [
                  "sub",
                  "requester_type",
                  "contact"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Queued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "request_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued"
                      ]
                    },
                    "eta_days": {
                      "type": "integer"
                    },
                    "controller": {
                      "type": "string",
                      "description": "Data-protection contact of the controller, when configured"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found (disabled for this tenant)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "503": {
            "description": "queue_full",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "queue_scan_failed / queue_write_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=data-deletion-list": {
      "get": {
        "tags": [
          "data-protection"
        ],
        "operationId": "oidcDataDeletionList",
        "summary": "List queued data-deletion requests",
        "description": "Returns the tenant's deletion queue (request id, subject hash, requester type, status, created). No raw subject identifiers or contact details. Admin auth: OIDC bearer with role admin/superuser, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'ts7-ts8-admin|' + Host).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "data-deletion-list"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "requests": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "request_id": {
                            "type": "string"
                          },
                          "subject_hash": {
                            "type": "string"
                          },
                          "requester_type": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "controller": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "GET required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "list_scan_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=dpa-report": {
      "get": {
        "tags": [
          "data-protection"
        ],
        "operationId": "oidcDpaReport",
        "summary": "Export the processing records for one data subject",
        "description": "Builds a processing-record report for a subject over a period (presentations received, credentials issued, sign-ins, revocation checks) for answering a data-protection authority or an access request. JSON only; responses are capped at 10 MB (truncated flag). Every export is itself audit-logged. Admin auth: OIDC bearer with role admin/superuser, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'ts7-ts8-admin|' + Host).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "dpa-report"
              ]
            }
          },
          {
            "name": "subject",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Subject identifier"
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "json"
              ],
              "default": "json"
            },
            "description": "Only json is served"
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "ISO 8601 start"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "ISO 8601 end"
          },
          {
            "name": "purpose",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Free-text purpose recorded in the audit log"
          }
        ],
        "responses": {
          "200": {
            "description": "Report",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "report_id": {
                      "type": "string"
                    },
                    "generated_at": {
                      "type": "string"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "period": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "string"
                        },
                        "to": {
                          "type": "string"
                        }
                      }
                    },
                    "records": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string"
                          },
                          "at": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "aggregate": {
                      "type": "object",
                      "properties": {
                        "vp_responses": {
                          "type": "integer"
                        },
                        "vc_issuances": {
                          "type": "integer"
                        },
                        "sign_ins": {
                          "type": "integer"
                        },
                        "revocation_checks": {
                          "type": "integer"
                        }
                      }
                    },
                    "truncated": {
                      "type": "boolean"
                    },
                    "controller": {
                      "type": "string"
                    },
                    "meta_audit": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "GET required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "501": {
            "description": "not_implemented (format=pdf)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=tenant-security": {
      "get": {
        "tags": [
          "data-protection"
        ],
        "operationId": "oidcTenantSecurityGet",
        "summary": "Read the tenant's security profile switches and their effective values",
        "description": "Returns the two switchable settings (eudiProductionProfile, Oidc:UserinfoConformanceDefaults) and what they currently imply: LOTL chain requirement, status-list check mode, whether reference test issuers are accepted and whether PID retention is capped at 30 days. Used by /standards-admin.html. Admin auth: OIDC bearer with role admin/superuser, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'ts7-ts8-admin|' + Host).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "tenant-security"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "settings": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "effective": {
                      "type": "object",
                      "properties": {
                        "lotl_require_chain": {},
                        "status_list_check": {},
                        "eu_reference_test_issuers_accepted": {
                          "type": "boolean"
                        },
                        "pid_retention_max_30_days": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "no_tenant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "data-protection"
        ],
        "operationId": "oidcTenantSecuritySet",
        "summary": "Switch one tenant security profile setting on or off",
        "description": "Writes one boolean setting and returns the same document as the GET. Body cap 2 KB; 20 writes per minute per IP. Every change is logged with the acting user. Admin auth: OIDC bearer with role admin/superuser, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'ts7-ts8-admin|' + Host).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "tenant-security"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "enum": [
                      "eudiProductionProfile",
                      "Oidc:UserinfoConformanceDefaults"
                    ]
                  },
                  "value": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "key",
                  "value"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated; current state"
          },
          "400": {
            "description": "invalid_key / invalid_value",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "body_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "500": {
            "description": "appsettings_write_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=da-create": {
      "post": {
        "tags": [
          "data-protection"
        ],
        "operationId": "oidcDaCreate",
        "summary": "Create a data agreement (purpose, lawful basis, retention)",
        "description": "Creates a Data Agreement shaped after ISO/IEC TS 27560 as revision 1. `da_id` may be supplied, otherwise one is generated. Admin auth as for data-deletion-list (bearer admin/superuser or HMAC bucket 'ts7-ts8-admin'). Writes: 60 per hour per IP, JSON body cap 16 KB.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "da-create"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "da_id": {
                    "type": "string"
                  },
                  "purpose": {
                    "type": "string",
                    "maxLength": 512
                  },
                  "lawful_basis": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "controller": {
                    "type": "string"
                  },
                  "retention_days": {
                    "type": "integer"
                  },
                  "data_categories": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "third_parties": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "purpose",
                  "lawful_basis"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "da_id": {
                      "type": "string"
                    },
                    "rev": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "da_exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=da-read": {
      "get": {
        "tags": [
          "data-protection"
        ],
        "operationId": "oidcDaRead",
        "summary": "Read one data agreement with its revisions",
        "description": "Returns the stored agreement. Admin auth as for data-deletion-list (bearer admin/superuser or HMAC bucket 'ts7-ts8-admin'). Writes: 60 per hour per IP, JSON body cap 16 KB.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "da-read"
              ]
            }
          },
          {
            "name": "da_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreDataAgreement"
                }
              }
            }
          },
          "400": {
            "description": "da_id_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "GET required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=da-update": {
      "post": {
        "tags": [
          "data-protection"
        ],
        "operationId": "oidcDaUpdate",
        "summary": "Add a new revision to a data agreement",
        "description": "Applies `patch` on top of the latest revision and stores it as a new revision; earlier receipts stay tied to the revision they signed. Admin auth as for data-deletion-list (bearer admin/superuser or HMAC bucket 'ts7-ts8-admin'). Writes: 60 per hour per IP, JSON body cap 16 KB.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "da-update"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "da_id": {
                    "type": "string"
                  },
                  "patch": {
                    "type": "object",
                    "additionalProperties": true
                  }
                },
                "required": [
                  "da_id",
                  "patch"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "da_id": {
                      "type": "string"
                    },
                    "rev": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=da-delete": {
      "post": {
        "tags": [
          "data-protection"
        ],
        "operationId": "oidcDaDelete",
        "summary": "Delete a data agreement",
        "description": "Removes the agreement. Admin auth as for data-deletion-list (bearer admin/superuser or HMAC bucket 'ts7-ts8-admin'). Writes: 60 per hour per IP, JSON body cap 16 KB.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "da-delete"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "da_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "da_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "da_id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "da_id_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=da-list": {
      "get": {
        "tags": [
          "data-protection"
        ],
        "operationId": "oidcDaList",
        "summary": "List the tenant's data agreements",
        "description": "Summary list of all agreements. Admin auth as for data-deletion-list (bearer admin/superuser or HMAC bucket 'ts7-ts8-admin'). Writes: 60 per hour per IP, JSON body cap 16 KB.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "da-list"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "data_agreements": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=da-list-revisions": {
      "get": {
        "tags": [
          "data-protection"
        ],
        "operationId": "oidcDaListRevisions",
        "summary": "List the revisions of one data agreement",
        "description": "Revision chain of one agreement. Admin auth as for data-deletion-list (bearer admin/superuser or HMAC bucket 'ts7-ts8-admin'). Writes: 60 per hour per IP, JSON body cap 16 KB.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "da-list-revisions"
              ]
            }
          },
          {
            "name": "da_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "da_id": {
                      "type": "string"
                    },
                    "revision_count": {
                      "type": "integer"
                    },
                    "revisions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "da_id_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=receipt-sign": {
      "post": {
        "tags": [
          "data-protection"
        ],
        "operationId": "oidcReceiptSign",
        "summary": "Sign a consent receipt for a data agreement",
        "description": "Records the subject's opt-in (or opt-out) to the current revision of the agreement and returns the receipt id. Subject = the bearer's `sub`. An admin (bearer admin/superuser or HMAC 'ts7-ts8-admin') may act for another subject with `sub` (body or query). 60 requests per hour per IP on writes.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "receipt-sign"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "da_id": {
                    "type": "string"
                  },
                  "opt_in": {
                    "type": "boolean",
                    "default": true
                  },
                  "sub": {
                    "type": "string",
                    "description": "Admin only"
                  }
                },
                "required": [
                  "da_id"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Signed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "receipt_id": {
                      "type": "string"
                    },
                    "da_id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_request / subject_unresolvable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "da_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=receipt-revoke": {
      "post": {
        "tags": [
          "data-protection"
        ],
        "operationId": "oidcReceiptRevoke",
        "summary": "Withdraw a consent receipt",
        "description": "Marks the receipt as revoked (consent withdrawn). Subject = the bearer's `sub`. An admin (bearer admin/superuser or HMAC 'ts7-ts8-admin') may act for another subject with `sub` (body or query). 60 requests per hour per IP on writes.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "receipt-revoke"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "da_id": {
                    "type": "string"
                  },
                  "receipt_id": {
                    "type": "string"
                  },
                  "sub": {
                    "type": "string",
                    "description": "Admin only"
                  }
                },
                "required": [
                  "da_id",
                  "receipt_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Revoked",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "receipt_id": {
                      "type": "string"
                    },
                    "da_id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=receipt-list": {
      "get": {
        "tags": [
          "data-protection"
        ],
        "operationId": "oidcReceiptList",
        "summary": "List the consent receipts of a data subject",
        "description": "Receipts of the subject across all agreements; used by /privacy-dashboard.html. Subject = the bearer's `sub`. An admin (bearer admin/superuser or HMAC 'ts7-ts8-admin') may act for another subject with `sub` (body or query). 60 requests per hour per IP on writes.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "receipt-list"
              ]
            }
          },
          {
            "name": "sub",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Admin only"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "subject_hash": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "receipts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "subject_unresolvable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=access-log": {
      "get": {
        "tags": [
          "data-protection"
        ],
        "operationId": "oidcAccessLog",
        "summary": "Read the access log of a data subject",
        "description": "Entries recorded whenever the subject's data was used under an agreement; used by /privacy-dashboard.html. Subject = the bearer's `sub`. An admin (bearer admin/superuser or HMAC 'ts7-ts8-admin') may act for another subject with `sub` (body or query). 60 requests per hour per IP on writes.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "access-log"
              ]
            }
          },
          {
            "name": "sub",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Admin only"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "subject_hash": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "entries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "subject_unresolvable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=ops-health": {
      "get": {
        "tags": [
          "monitoring"
        ],
        "operationId": "oidcOpsHealth",
        "summary": "Operational counters of the identity provider for this tenant",
        "description": "Read-only: revoked token counts and last prune, data-agreement count, deletion-queue size, free disk space of the data volume, tenant directory entries. Admin auth: OIDC bearer with role admin/superuser, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'ts7-ts8-admin|' + Host).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "ops-health"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "ts": {
                      "type": "string"
                    },
                    "build": {
                      "type": "string"
                    },
                    "revocation": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "consent": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "ts7": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "disk": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "tenant_dir_entries": {},
                    "scale_prep_scan_limit": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "GET required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/oauth-authorization-server/vci.ashx": {
      "get": {
        "tags": [
          "well-known",
          "eu-wallet-issuer"
        ],
        "operationId": "getVciAuthServerMetadata",
        "summary": "OAuth authorization server metadata of the credential issuer",
        "description": "RFC 8414 metadata for the issuer's own authorization server (issuer `<origin>/vci.ashx`): token, authorize and PAR endpoints in path form, supported grants, PKCE S256, DPoP and client-attestation algorithms (ES256/384/512), pre-authorized anonymous access. Rewritten to /vci.ashx?oauth-as-metadata.",
        "security": [],
        "x-codeb-audience": "wallet",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/mdoc-iaca.{format}": {
      "get": {
        "tags": [
          "well-known",
          "eu-wallet-issuer"
        ],
        "operationId": "getMdocIaca",
        "summary": "Download the tenant's mdoc IACA certificate or CRL",
        "description": "The issuing authority CA (IACA) certificate that signs this tenant's mdoc document signer certificates, as PEM or DER, or its CRL. Verifiers add it as an mdoc trust anchor. GET/HEAD. Rewritten to /vci.ashx?mdoc-iaca={format}.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "format",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "pem",
                "cer",
                "crl"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Certificate or CRL",
            "content": {
              "application/x-pem-file": {
                "schema": {
                  "type": "string"
                }
              },
              "application/pkix-cert": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/pkix-crl": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "not_found (no IACA yet)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "method_not_allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/mdoc-iacas": {
      "get": {
        "tags": [
          "well-known",
          "eu-wallet-issuer"
        ],
        "operationId": "getMdocIacaList",
        "summary": "List the tenant's mdoc IACA certificates (base64 DER)",
        "description": "IACA list for verifiers that import trust anchors in bulk. Rewritten to /vci.ashx?mdoc-iaca=list.",
        "security": [],
        "x-codeb-audience": "public",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "iacas": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "certificate": {
                            "type": "string",
                            "description": "base64 DER"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?mdoc-iaca=info": {
      "get": {
        "tags": [
          "eu-wallet-issuer"
        ],
        "operationId": "vciMdocIacaInfo",
        "summary": "Summary of the tenant's mdoc IACA (subject, fingerprint, validity, links)",
        "description": "Human-oriented summary with the SHA-256 fingerprint and the download links of the PEM, DER, CRL and list forms.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "mdoc-iaca",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "info"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "subject": {
                      "type": "string"
                    },
                    "sha256_fingerprint": {
                      "type": "string"
                    },
                    "not_before": {
                      "type": "string"
                    },
                    "not_after": {
                      "type": "string"
                    },
                    "pem": {
                      "type": "string"
                    },
                    "cer": {
                      "type": "string"
                    },
                    "crl": {
                      "type": "string"
                    },
                    "list": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/type-metadata/{vct}": {
      "get": {
        "tags": [
          "eu-wallet-issuer"
        ],
        "operationId": "getVctTypeMetadata",
        "summary": "SD-JWT VC type metadata for one credential type",
        "description": "Type metadata (draft-ietf-oauth-sd-jwt-vc) with display names (en, de, mt), claim definitions and rendering for the given vct. Rewritten to /vci.ashx?type-metadata&vct={vct}.",
        "security": [],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "name": "vct",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "URL-encoded vct"
          }
        ],
        "responses": {
          "200": {
            "description": "Type metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "invalid_request (vct missing, too long or malformed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found (unknown vct)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vc-images/{name}.png": {
      "get": {
        "tags": [
          "eu-wallet-issuer"
        ],
        "operationId": "getVcImage",
        "summary": "Logo or card artwork of a credential type",
        "description": "PNG uploaded by the tenant admin for a credential type and referenced from the issuer metadata. GET or HEAD. Rewritten to /vci.ashx?vc-image={name}.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^(logo|card)-[a-z0-9-]{1,40}-[0-9a-f]{10}$"
            },
            "description": "logo-<slug>-<10 hex> or card-<slug>-<10 hex>"
          }
        ],
        "responses": {
          "200": {
            "description": "Image",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "method_not_allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?nonce": {
      "post": {
        "tags": [
          "eu-wallet-issuer"
        ],
        "operationId": "vciNonce",
        "summary": "Get a fresh c_nonce for the key proof (OpenID4VCI nonce endpoint)",
        "description": "Nonce endpoint of OpenID4VCI 1.0: returns a c_nonce valid 5 minutes for the proof JWT of the next credential request. No input; GET is accepted as well. Shares the per-IP budget of the wallet endpoints (60 requests per minute; 429 with Retry-After: 30). Also answered at the advertised path form /vci.ashx/{endpoint}.",
        "security": [],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "name": "nonce",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "responses": {
          "200": {
            "description": "Nonce",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "c_nonce": {
                      "type": "string"
                    },
                    "c_nonce_expires_in": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "c_nonce"
                  ]
                }
              }
            }
          },
          "405": {
            "description": "method_not_allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          }
        }
      }
    },
    "/vci.ashx?notification": {
      "post": {
        "tags": [
          "eu-wallet-issuer"
        ],
        "operationId": "vciNotification",
        "summary": "Report what the wallet did with an issued credential",
        "description": "Notification endpoint of OpenID4VCI 1.0. The wallet reports credential_accepted, credential_deleted or credential_failure for a notification_id it received with the credential, using the same access token. Body cap 2 KB. Shares the per-IP budget of the wallet endpoints (60 requests per minute; 429 with Retry-After: 30). Also answered at the advertised path form /vci.ashx/{endpoint}.",
        "security": [
          {
            "credentialAccessToken": []
          }
        ],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "name": "notification",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "notification_id": {
                    "type": "string"
                  },
                  "event": {
                    "type": "string",
                    "enum": [
                      "credential_accepted",
                      "credential_deleted",
                      "credential_failure"
                    ]
                  },
                  "event_description": {
                    "type": "string"
                  }
                },
                "required": [
                  "notification_id",
                  "event"
                ]
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Recorded"
          },
          "400": {
            "description": "invalid_notification_request / invalid_notification_id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "invalid_token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "method_not_allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          }
        }
      }
    },
    "/vci.ashx?available-attributes": {
      "get": {
        "tags": [
          "eu-wallet-issuer"
        ],
        "operationId": "vciAvailableAttributes",
        "summary": "Which self-service credentials the signed-in user can mint now",
        "description": "For each credential type of the tenant's self-service catalogue: whether the user's verified account data covers it and which claims are missing. Used by the web wallet and member-card pages.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "available-attributes",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "subject": {
                      "type": "string"
                    },
                    "credentials": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "vct": {
                            "type": "string"
                          },
                          "ready": {
                            "type": "boolean"
                          },
                          "missing": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "display": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "invalid_token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?issue-in-session": {
      "post": {
        "tags": [
          "eu-wallet-issuer"
        ],
        "operationId": "vciIssueInSession",
        "summary": "Mint an SD-JWT VC from the signed-in user's verified account data",
        "description": "Issues a catalogue credential directly to the signed-in web wallet, bound to the supplied holder key (`cnf.jwk`). Claims come only from the server-side account record. Body cap 64 KB. 404 `vct_retired` names the successor type; 422 lists missing claims.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "issue-in-session",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vct": {
                    "type": "string"
                  },
                  "cnf": {
                    "type": "object",
                    "properties": {
                      "jwk": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                },
                "required": [
                  "vct"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "credential": {
                      "type": "string",
                      "description": "SD-JWT VC"
                    },
                    "credentials": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "credential": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "vct": {
                      "type": "string"
                    },
                    "format": {
                      "type": "string",
                      "enum": [
                        "dc+sd-jwt"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "empty_body, invalid_json, vct_required, unknown_vct",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "invalid_token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "vct_retired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "body_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "not_ready (missing claims)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "mint_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?self-offer": {
      "post": {
        "tags": [
          "eu-wallet-issuer"
        ],
        "operationId": "vciSelfOffer",
        "summary": "Create a credential offer for the signed-in member (self-service)",
        "description": "Like create-offer, but for the caller only: the subject is taken from the bearer and the claims from the account record; only credential types the tenant allows for self-service. `days` 1-30 (default 7). One offer per subject every 5 seconds.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "self-offer",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vct": {
                    "type": "string"
                  },
                  "days": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 30
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Offer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreCredentialOfferLinks"
                }
              }
            }
          },
          "400": {
            "description": "unknown_vct",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "invalid_token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "vct_not_self_serviceable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "not_ready (missing claims)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "500": {
            "description": "issuer_init_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?list-offers": {
      "get": {
        "tags": [
          "eu-wallet-issuer-admin"
        ],
        "operationId": "vciListOffers",
        "summary": "List the tenant's credential offers",
        "description": "All offers with state (issued, revoked, expired); pre-authorized codes are shown only as their last 8 characters. Admin auth: OIDC bearer with role admin (checked by introspection), or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'vci-list|' + Host).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "list-offers",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "offers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?list-issued": {
      "get": {
        "tags": [
          "eu-wallet-issuer-admin"
        ],
        "operationId": "vciListIssued",
        "summary": "List credentials issued by the tenant",
        "description": "Issuance log rows. Admin auth: OIDC bearer with role admin (checked by introspection), or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'vci-list|' + Host).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "list-issued",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "issued": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?revoke-offer": {
      "post": {
        "tags": [
          "eu-wallet-issuer-admin"
        ],
        "operationId": "vciRevokeOffer",
        "summary": "Revoke an offer and the credentials issued from it",
        "description": "Marks the offer revoked, invalidates its pre-authorized code and sets the revocation bit of every credential issued from it in the status list (including refreshed copies). Admin auth: OIDC bearer with role admin (checked by introspection), or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'vci-revoke-offer|' + Host).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "revoke-offer",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "offer_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "offer_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Revoked",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "offer_id": {
                      "type": "string"
                    },
                    "status_revoked": {},
                    "refreshed_copies_revoked": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_json / invalid_offer_id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "status_list_write_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?type-display": {
      "get": {
        "tags": [
          "eu-wallet-issuer-admin"
        ],
        "operationId": "vciTypeDisplayList",
        "summary": "List admin-set display names, logos and colours per credential type",
        "description": "Display overrides used in the issuer metadata. Admin auth: OIDC bearer with role admin (checked by introspection), or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'vci-list|' + Host).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "type-display",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "types": {}
                  }
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?type-display-save": {
      "post": {
        "tags": [
          "eu-wallet-issuer-admin"
        ],
        "operationId": "vciTypeDisplaySave",
        "summary": "Set the display (names, logo, colours) of one credential type",
        "description": "Built-in types (PID, mDL) keep their own names. Admin auth: OIDC bearer with role admin (checked by introspection), or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'vci-create-offer|' + Host).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "type-display-save",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vct": {
                    "type": "string"
                  },
                  "display": {
                    "type": "object",
                    "additionalProperties": true
                  }
                },
                "required": [
                  "vct"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "vct": {
                      "type": "string"
                    },
                    "display": {}
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_json, invalid_vct, invalid_display",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?reload-keys": {
      "post": {
        "tags": [
          "eu-wallet-issuer-admin"
        ],
        "operationId": "vciReloadKeys",
        "summary": "Drop the cached issuer keys so they are re-read from disk",
        "description": "Use after replacing the issuer key material. Admin auth: OIDC bearer with role admin (checked by introspection), or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'vci-reload-keys|' + Host).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "reload-keys",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "action": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?rebuild-code-index": {
      "post": {
        "tags": [
          "eu-wallet-issuer-admin"
        ],
        "operationId": "vciRebuildCodeIndex",
        "summary": "Drop the pre-authorized-code index so it is rebuilt from the offers",
        "description": "Maintenance helper. Admin auth: OIDC bearer with role admin (checked by introspection), or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'vci-rebuild-code-index|' + Host).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "rebuild-code-index",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "action": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?wallet-clients-status": {
      "get": {
        "tags": [
          "eu-wallet-issuer-admin"
        ],
        "operationId": "vciWalletClientsStatus",
        "summary": "Show which wallet client_ids the issuer currently accepts",
        "description": "Accepted wallet client ids and where the list was loaded from. Admin auth: OIDC bearer with role admin (checked by introspection), or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'vci-wallet-clients-status|' + Host).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "wallet-clients-status",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "client_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "source": {
                      "type": "string"
                    },
                    "loaded_at": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?issuer-settings": {
      "get": {
        "tags": [
          "eu-wallet-issuer-admin"
        ],
        "operationId": "vciIssuerSettings",
        "summary": "Read the issuer settings and trust material status",
        "description": "Every switchable issuer setting with allowed values, default, configured and effective value; wallet-provider policy; presence of registration certificate, access certificate and request-encryption key; registration_certificate_published: which registration certificate the metadata carries (installed or own-registrar) and, if the own one cannot be issued, why. Admin auth: OIDC bearer with role admin (checked by introspection), or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'vci-settings|' + Host).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "issuer-settings",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "appsettings": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "settings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "allowed": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "default": {
                            "type": "string"
                          },
                          "configured": {},
                          "effective": {
                            "type": "string"
                          },
                          "unrecognised_value": {
                            "type": "boolean"
                          },
                          "help": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "trust": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?issuer-settings-save": {
      "post": {
        "tags": [
          "eu-wallet-issuer-admin"
        ],
        "operationId": "vciIssuerSettingsSave",
        "summary": "Change issuer settings",
        "description": "Each key must be a known setting and each value one of its allowed values; an empty value restores the default. Body cap 8 KB. Nothing is written when the tenant settings file is not valid JSON. Admin auth: OIDC bearer with role admin (checked by introspection), or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'vci-settings-save|' + Host).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "issuer-settings-save",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "settings": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "settings"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved; current settings document"
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "method_not_allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "body_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?issuer-install-eu-ca": {
      "post": {
        "tags": [
          "eu-wallet-issuer-admin"
        ],
        "operationId": "vciIssuerInstallEuCa",
        "summary": "Install the bundled reference CA for key or wallet-provider attestations",
        "description": "Copies the bundled reference CA into the tenant's trust folder for wallet key attestations or wallet-provider attestations, then returns the settings document. Admin auth: OIDC bearer with role admin (checked by introspection), or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'vci-settings-save|' + Host).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "issuer-install-eu-ca",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "target": {
                    "type": "string",
                    "enum": [
                      "key-attestation",
                      "wallet-provider"
                    ]
                  }
                },
                "required": [
                  "target"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Installed; current settings document"
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "method_not_allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?templates": {
      "get": {
        "tags": [
          "eu-wallet-issuer-admin"
        ],
        "operationId": "vciTemplatesList",
        "summary": "List card templates with attributes, images and limits",
        "description": "Card templates (name, credential type, claims and their sources), the account attributes a claim can be taken from, uploaded images and the image rules. Admin auth: OIDC bearer with role admin (checked by introspection), or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'vci-templates|' + Host).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "templates",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "templates": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "attributes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "path": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "images": {},
                    "image_rules": {},
                    "max_days": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?template-preview": {
      "post": {
        "tags": [
          "eu-wallet-issuer-admin"
        ],
        "operationId": "vciTemplatePreview",
        "summary": "Preview the claims a template would put on a user's card",
        "description": "Resolves the template against one account and reports missing required and optional data. Admin auth: OIDC bearer with role admin (checked by introspection), or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'vci-templates|' + Host).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "template-preview",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "Template id"
                  },
                  "user": {
                    "type": "string",
                    "description": "Username"
                  },
                  "create_guest": {
                    "type": "boolean",
                    "description": "Create an enabled guest account for the e-mail address `user` when none exists (see description)."
                  },
                  "given_name": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "First name of the new guest (with create_guest)."
                  },
                  "family_name": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "Last name of the new guest (with create_guest)."
                  }
                },
                "required": [
                  "id",
                  "user"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preview",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "user": {
                      "type": "string"
                    },
                    "claims": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "missing_required": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "missing_optional": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "disabled": {
                      "type": "boolean"
                    },
                    "ready": {
                      "type": "boolean"
                    },
                    "new_guest": {
                      "type": "boolean"
                    },
                    "names_ok": {
                      "type": "boolean"
                    },
                    "days": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_template_id / invalid_user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found / user_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "email_in_use: the address is already a login or another account's e-mail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?template-assignments": {
      "get": {
        "tags": [
          "eu-wallet-issuer-admin"
        ],
        "operationId": "vciTemplateAssignments",
        "summary": "List the offers created from one template",
        "description": "Offer rows (subject, created, expiry, multi-use, invite mode, issued count, revoked, expired). Admin auth: OIDC bearer with role admin (checked by introspection), or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'vci-templates|' + Host). Rows of cards delivered to the wallet carry wallet_delivery: [{wallet, device_name, state (waiting | accepted | declined | collected | collected_elsewhere | withdrawn | expired), state_utc, seen_utc}].",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "template-assignments",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Template id"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "assignments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_template_id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?vc-images": {
      "get": {
        "tags": [
          "eu-wallet-issuer-admin"
        ],
        "operationId": "vciImagesList",
        "summary": "List uploaded credential images and the image rules",
        "description": "Index of uploaded logos and card artwork. Admin auth: OIDC bearer with role admin (checked by introspection), or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'vci-templates|' + Host).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "vc-images",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "images": {},
                    "rules": {}
                  }
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?template-save": {
      "post": {
        "tags": [
          "eu-wallet-issuer-admin"
        ],
        "operationId": "vciTemplateSave",
        "summary": "Create or update a card template",
        "description": "Saves a template: name, own credential type URI (built-in types are refused; fixed once cards exist), default validity, multi-use / invite-only flags, claims (source: account attribute or fixed value; required flag) and optional display. Body cap 64 KB. Admin auth: OIDC bearer with role admin (checked by introspection), or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'vci-templates-save|' + Host).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "template-save",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "Omit to create"
                  },
                  "name": {
                    "type": "string"
                  },
                  "vct": {
                    "type": "string"
                  },
                  "default_days": {
                    "type": "integer"
                  },
                  "card_days": {
                    "type": "integer",
                    "description": "Card validity in the wallet (exp / mdoc validUntil): 0 = issuer standard (1 year), 1-365 days. The Debug enabled card (vct https://<host>/vc/debug-enabled/1.0, template id debug-enabled) needs 1-30 days, invite only, single collection."
                  },
                  "multi_use": {
                    "type": "boolean"
                  },
                  "unlisted": {
                    "type": "boolean",
                    "description": "Invite-only card"
                  },
                  "card_function": {
                    "type": "string",
                    "enum": [
                      "none",
                      "pki-rw",
                      "pki-ro",
                      "nfc-memory"
                    ],
                    "description": "Card function in CodeB Wallet (fixed once saved): the card also works as a read/write PKI card, a read-only PKI card (with the member's signing certificate, created at rollout when missing) or an NFC memory card (NFC Forum Type 4 Tag; read-only or writable by readers, see nfc_write). A card with a function is invite only and collected once; PKI functions need PKI cards on phones switched on and a sign-in invite. Issued claims: card_function, plus card_type / card_id / holder_login / valid_from / valid_until / admin_key_ref (PKI) or nfc_ndef (NDEF message, base64url, at most 4094 bytes) / nfc_summary / nfc_write / nfc_capacity (memory). Secrets never travel as claims (vci.ashx/card-secrets)."
                  },
                  "nfc_write": {
                    "type": "string",
                    "enum": [
                      "none",
                      "reader"
                    ],
                    "default": "none",
                    "description": "NFC memory card only (fixed once saved): \"reader\" lets NFC readers (e.g. a logical access control system) replace the card's NDEF content while the member holds the phone to the reader with the card screen open. What a reader writes stays on the phone only (never sent to this server, not confirmed by this site); the member can restore the issued content. Issued claims: nfc_write, and nfc_capacity for writable cards. A writable card may start with no records (empty NDEF)."
                  },
                  "nfc_capacity": {
                    "type": "integer",
                    "minimum": 128,
                    "maximum": 4094,
                    "default": 4094,
                    "description": "Writable NDEF size in bytes (nfc_write reader); the issued start content must fit."
                  },
                  "nfc_records": {
                    "type": "array",
                    "maxItems": 4,
                    "description": "NFC memory card content (card_function nfc-memory). {attribute} placeholders from the template attribute catalogue are filled per member at rollout; a member without the data cannot get the card. Readable by any NFC reader while the card is active: no secrets.",
                    "items": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "uri",
                            "text",
                            "vcard",
                            "mime"
                          ]
                        },
                        "value": {
                          "type": "string",
                          "description": "uri: https://, http://, mailto: or tel: link (or one placeholder such as {website}); text: the text; mime: base64 data (at most 3500 bytes)"
                        },
                        "lang": {
                          "type": "string",
                          "description": "text: language code (default en)"
                        },
                        "mime": {
                          "type": "string",
                          "description": "mime: MIME type, e.g. application/x-company-data"
                        },
                        "name": {
                          "type": "string",
                          "description": "vcard: name (required)"
                        },
                        "org": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "phone": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "type"
                      ]
                    }
                  },
                  "claims": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "source": {
                          "type": "string",
                          "enum": [
                            "attr",
                            "fixed"
                          ]
                        },
                        "attr": {
                          "type": "string"
                        },
                        "value": {
                          "type": "string"
                        },
                        "required": {
                          "type": "boolean"
                        }
                      }
                    }
                  },
                  "display": {
                    "type": "object",
                    "additionalProperties": true
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "id": {
                      "type": "string"
                    },
                    "vct": {
                      "type": "string"
                    },
                    "template": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_json / invalid_template / invalid_display",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?template-delete": {
      "post": {
        "tags": [
          "eu-wallet-issuer-admin"
        ],
        "operationId": "vciTemplateDelete",
        "summary": "Delete a card template and close its open offers",
        "description": "Open offers created from the template can no longer be collected. Admin auth: OIDC bearer with role admin (checked by introspection), or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'vci-templates-save|' + Host).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "template-delete",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "id": {
                      "type": "string"
                    },
                    "offers_closed": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_template_id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?template-assign": {
      "post": {
        "tags": [
          "eu-wallet-issuer-admin"
        ],
        "operationId": "vciTemplateAssign",
        "summary": "Give a card to a user: create an offer from a template",
        "description": "Creates an offer for one account from a template. `days` 0 (unlimited) or 1-30; invite-only cards need 1-30 days and cannot be multi-use. `invite`: signin (the member signs in with the wallet) or code (one collection by link); multi-use cards are collected from the wallet's document list. With `email: true` an invitation mail is sent. Admin auth: OIDC bearer with role admin (checked by introspection), or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'vci-templates-assign|' + Host). With `create_guest: true` and no account `user`: an enabled guest account is created for the e-mail address `user` (login name = the address in lower case, no password, profile given_name / family_name / name from the request) only after every other check passed; the offer is then a one-time link (invite code), valid 30 days, always e-mailed with a note on setting a password on recover.html. At most 50 new guest accounts per site and hour. `create_guest` needs an admin signed in with the OIDC bearer: the X-CodeB-Admin-Signature alone is refused (403 admin_signin_required). [Wallet inbox] `invite: wallet` puts the card straight into the CodeB Wallet(s) linked to the member's account (wallet-provider inbox): no link, no QR code; the member opens the app and presses Add. The offer is bound to those wallet instances (a token request must carry this site's wallet instance attestation of one of them; anyone else gets invalid_grant). `fallback` (signin | code | none; default signin for invite-only cards, otherwise code) applies when the member has no linked wallet; with none the answer is 409 no_linked_wallet. Not for multi-use or PKI cards. The answer then carries delivery: wallet, delivered_to (device names), delivered_count, or delivery_fallback. A wallet is linked when the member links it in the app (wallet-provider/link) or automatically the first time the member signs in from this site's CodeB Wallet to collect a card (only a wallet not linked to any account yet).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "template-assign",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "Template id"
                  },
                  "user": {
                    "type": "string"
                  },
                  "days": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 30
                  },
                  "multi_use": {
                    "type": "boolean"
                  },
                  "invite": {
                    "type": "string",
                    "enum": [
                      "wallet",
                      "signin",
                      "code"
                    ]
                  },
                  "email": {
                    "type": "boolean"
                  },
                  "create_guest": {
                    "type": "boolean",
                    "description": "Create an enabled guest account for the e-mail address `user` when none exists (see description)."
                  },
                  "given_name": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "First name of the new guest (with create_guest)."
                  },
                  "family_name": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "Last name of the new guest (with create_guest)."
                  },
                  "fallback": {
                    "type": "string",
                    "enum": [
                      "signin",
                      "code",
                      "none"
                    ],
                    "description": "With invite wallet: what to make when the member has no linked wallet."
                  }
                },
                "required": [
                  "id",
                  "user",
                  "invite"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Offer created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "offer_id": {
                      "type": "string"
                    },
                    "user": {
                      "type": "string"
                    },
                    "vct": {
                      "type": "string"
                    },
                    "expires_utc": {
                      "type": "string"
                    },
                    "unlimited": {
                      "type": "boolean"
                    },
                    "multi_use": {
                      "type": "boolean"
                    },
                    "unlisted": {
                      "type": "boolean"
                    },
                    "invite": {
                      "type": "string"
                    },
                    "claims": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "missing_optional": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "offer_uri": {
                      "type": "string"
                    },
                    "deep_link": {
                      "type": "string"
                    },
                    "web_link": {
                      "type": "string"
                    },
                    "email": {},
                    "collect": {
                      "type": "string"
                    },
                    "new_guest": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_template_id, invalid_user, user_disabled, missing_required, invalid_days, invalid_request, invalid_vct / invalid_email / invalid_name (create_guest)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found / user_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "issuer_init_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "email_in_use: the address is already a login or another account's e-mail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited: too many new guest accounts in the last hour",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?access-offer": {
      "post": {
        "tags": [
          "eu-wallet-issuer-admin"
        ],
        "operationId": "vciAccessOffer",
        "summary": "Offer a CodeB Access card (NFC door access) to a member",
        "description": "Creates a sign-in invitation for one CodeB Access card: mdoc (doctype and namespace io.codeb.access.1) and SD-JWT VC (vct https://<host>/vc/access/1.0) collected once with the same token, no refresh token. The member collects it by signing in as themselves in the wallet; the wallet must present a hardware key attestation for both formats (otherwise key_attestation_required), and the card is never issued after valid_until. Both formats get a status list entry (revoke with ?revoke-offer). Validity: valid_from (default now, never back-dated) and valid_until or days (1-366, default 30); at most 366 days from now. unlock_policy: unlocked (default) or biometric_each_tap. Refused when the issuer cannot sign under its IACA or the status list is switched off. Test credentials; not certified. Admin auth: OIDC bearer with role admin (checked by introspection), or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'vci-access-offer|' + Host).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "access-offer",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "site_ids",
                  "access_groups"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Login of an enabled account on this site."
                  },
                  "site_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[a-z0-9][a-z0-9-]{0,39}$"
                    },
                    "minItems": 1,
                    "maxItems": 20
                  },
                  "access_groups": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[a-z0-9][a-z0-9-]{0,39}$"
                    },
                    "minItems": 1,
                    "maxItems": 50
                  },
                  "valid_from": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "valid_until": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "days": {
                    "type": [
                      "integer",
                      "string"
                    ],
                    "minimum": 1,
                    "maximum": 366
                  },
                  "schedule_ref": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9-]{0,39}$"
                  },
                  "unlock_policy": {
                    "type": "string",
                    "enum": [
                      "unlocked",
                      "biometric_each_tap"
                    ],
                    "default": "unlocked"
                  },
                  "holder_display_name": {
                    "type": "string",
                    "maxLength": 64,
                    "description": "Optional; no control or format characters, no < >."
                  },
                  "invite": {
                    "type": "string",
                    "enum": [
                      "signin"
                    ],
                    "default": "signin"
                  },
                  "invite_days": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 30,
                    "default": 14
                  },
                  "email": {
                    "type": "boolean",
                    "default": false
                  }
                }
              },
              "example": {
                "user": "member@example.test",
                "site_ids": [
                  "hq"
                ],
                "access_groups": [
                  "main-entrance"
                ],
                "days": 30,
                "unlock_policy": "unlocked",
                "email": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Card offered",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "offer_id": {
                      "type": "string"
                    },
                    "user": {
                      "type": "string"
                    },
                    "vct": {
                      "type": "string"
                    },
                    "doctype": {
                      "type": "string",
                      "const": "io.codeb.access.1"
                    },
                    "expires_utc": {
                      "type": "string",
                      "format": "date-time",
                      "description": "End of the invitation (never after the card's end)."
                    },
                    "invite": {
                      "type": "string",
                      "const": "signin"
                    },
                    "claims": {
                      "type": "object",
                      "description": "The card claims as issued (mdoc namespace io.codeb.access.1 and SD-JWT VC https://<host>/vc/access/1.0).",
                      "properties": {
                        "credential_id": {
                          "type": "string",
                          "description": "Random card number (pseudonymous, also the SD-JWT sub); never the login."
                        },
                        "holder_display_name": {
                          "type": "string"
                        },
                        "site_ids": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9-]{0,39}$"
                          }
                        },
                        "access_groups": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9-]{0,39}$"
                          }
                        },
                        "valid_from": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "valid_until": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "schedule_ref": {
                          "type": "string"
                        },
                        "unlock_policy": {
                          "type": "string",
                          "enum": [
                            "unlocked",
                            "biometric_each_tap"
                          ]
                        },
                        "profile": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Door profiles the phone answers: [\"mdoc\", \"cap1\"] (ISO/IEC 18013-5 data in both)."
                        }
                      }
                    },
                    "offer_uri": {
                      "type": "string",
                      "format": "uri"
                    },
                    "deep_link": {
                      "type": "string"
                    },
                    "web_link": {
                      "type": "string",
                      "format": "uri"
                    },
                    "email": {
                      "type": "object",
                      "properties": {
                        "sent": {
                          "type": "boolean"
                        },
                        "to": {
                          "type": "string"
                        },
                        "reason": {
                          "type": "string"
                        }
                      }
                    },
                    "collect": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_json / invalid_user / user_disabled / invalid_access_card / invalid_days / invalid_request / status_list_off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "user_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error (the issuer cannot sign under its IACA at the moment)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?access-cards": {
      "get": {
        "tags": [
          "eu-wallet-issuer-admin"
        ],
        "operationId": "vciAccessCards",
        "summary": "List the CodeB Access cards of this site",
        "description": "Every access card offer, newest first (at most 5000), with its state, claims and the key records of the phones that collected it, plus the replaces / replaced_by chain of lost-phone re-enrolments. Admin auth: OIDC bearer with role admin (checked by introspection), or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'vci-access-list|' + Host).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "access-cards",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "responses": {
          "200": {
            "description": "Cards",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "cards": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "offer_id": {
                            "type": "string"
                          },
                          "user": {
                            "type": "string"
                          },
                          "created_utc": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "issued": {
                            "type": "boolean"
                          },
                          "invite_expires_utc": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "revoked": {
                            "type": "boolean"
                          },
                          "revoked_reason": {
                            "type": "string"
                          },
                          "replaced_by": {
                            "type": "string",
                            "description": "New offer id after a re-enrolment (\"pending\" while it runs)."
                          },
                          "replaces": {
                            "type": "string"
                          },
                          "credential_id": {
                            "type": "string"
                          },
                          "holder_display_name": {
                            "type": "string"
                          },
                          "site_ids": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "pattern": "^[a-z0-9][a-z0-9-]{0,39}$"
                            }
                          },
                          "access_groups": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "pattern": "^[a-z0-9][a-z0-9-]{0,39}$"
                            }
                          },
                          "valid_from": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "valid_until": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "schedule_ref": {
                            "type": "string"
                          },
                          "unlock_policy": {
                            "type": "string"
                          },
                          "holder_keys": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "description": "Key record of the phone that collected the card (public data only).",
                              "properties": {
                                "format": {
                                  "type": "string",
                                  "enum": [
                                    "mso_mdoc",
                                    "dc+sd-jwt"
                                  ]
                                },
                                "recorded_utc": {
                                  "type": "string",
                                  "format": "date-time"
                                },
                                "key_storage": {
                                  "type": "string",
                                  "description": "From the wallet provider's key attestation, e.g. android_strongbox, android_tee."
                                },
                                "user_authentication": {
                                  "type": "string"
                                },
                                "attesting_issuer": {
                                  "type": "string"
                                },
                                "attestation_format": {
                                  "type": "string"
                                },
                                "key_thumbprint": {
                                  "type": "string",
                                  "description": "RFC 7638 thumbprint of the attested key."
                                },
                                "wallet_instance_jkt": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "previous_holder_keys": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "description": "Key record of the phone that collected the card (public data only).",
                              "properties": {
                                "format": {
                                  "type": "string",
                                  "enum": [
                                    "mso_mdoc",
                                    "dc+sd-jwt"
                                  ]
                                },
                                "recorded_utc": {
                                  "type": "string",
                                  "format": "date-time"
                                },
                                "key_storage": {
                                  "type": "string",
                                  "description": "From the wallet provider's key attestation, e.g. android_strongbox, android_tee."
                                },
                                "user_authentication": {
                                  "type": "string"
                                },
                                "attesting_issuer": {
                                  "type": "string"
                                },
                                "attestation_format": {
                                  "type": "string"
                                },
                                "key_thumbprint": {
                                  "type": "string",
                                  "description": "RFC 7638 thumbprint of the attested key."
                                },
                                "wallet_instance_jkt": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "method_not_allowed (GET only)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?access-reenroll": {
      "post": {
        "tags": [
          "eu-wallet-issuer-admin"
        ],
        "operationId": "vciAccessReenroll",
        "summary": "Lost phone: revoke a CodeB Access card and offer the same access to a new phone",
        "description": "Revokes the card (status list, both formats, revoked_reason lost_phone_reenrolled) and offers the same sites, door groups, schedule, unlock rule and end date as a sign-in invitation with a new credential_id. The start moves to now if it is in the past; the end never moves. Refused for other credential types (not_an_access_card), ended cards (card_ended), cards revoked for another reason (409 card_revoked) and cards already re-enrolled (409 already_replaced). A failed run can be repeated. Admin auth: OIDC bearer with role admin (checked by introspection), or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'vci-access-reenroll|' + Host).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "access-reenroll",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "offer_id"
                ],
                "properties": {
                  "offer_id": {
                    "type": "string"
                  },
                  "invite_days": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 30,
                    "default": 14
                  },
                  "email": {
                    "type": "boolean",
                    "default": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Old card revoked, new card offered",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "type": "object",
                      "properties": {
                        "ok": {
                          "type": "boolean"
                        },
                        "offer_id": {
                          "type": "string"
                        },
                        "user": {
                          "type": "string"
                        },
                        "vct": {
                          "type": "string"
                        },
                        "doctype": {
                          "type": "string",
                          "const": "io.codeb.access.1"
                        },
                        "expires_utc": {
                          "type": "string",
                          "format": "date-time",
                          "description": "End of the invitation (never after the card's end)."
                        },
                        "invite": {
                          "type": "string",
                          "const": "signin"
                        },
                        "claims": {
                          "type": "object",
                          "description": "The card claims as issued (mdoc namespace io.codeb.access.1 and SD-JWT VC https://<host>/vc/access/1.0).",
                          "properties": {
                            "credential_id": {
                              "type": "string",
                              "description": "Random card number (pseudonymous, also the SD-JWT sub); never the login."
                            },
                            "holder_display_name": {
                              "type": "string"
                            },
                            "site_ids": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[a-z0-9][a-z0-9-]{0,39}$"
                              }
                            },
                            "access_groups": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[a-z0-9][a-z0-9-]{0,39}$"
                              }
                            },
                            "valid_from": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "valid_until": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "schedule_ref": {
                              "type": "string"
                            },
                            "unlock_policy": {
                              "type": "string",
                              "enum": [
                                "unlocked",
                                "biometric_each_tap"
                              ]
                            },
                            "profile": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              },
                              "description": "Door profiles the phone answers: [\"mdoc\", \"cap1\"] (ISO/IEC 18013-5 data in both)."
                            }
                          }
                        },
                        "offer_uri": {
                          "type": "string",
                          "format": "uri"
                        },
                        "deep_link": {
                          "type": "string"
                        },
                        "web_link": {
                          "type": "string",
                          "format": "uri"
                        },
                        "email": {
                          "type": "object",
                          "properties": {
                            "sent": {
                              "type": "boolean"
                            },
                            "to": {
                              "type": "string"
                            },
                            "reason": {
                              "type": "string"
                            }
                          }
                        },
                        "collect": {
                          "type": "string"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "properties": {
                        "replaced_offer_id": {
                          "type": "string"
                        },
                        "old_card_status_revoked": {
                          "type": "integer"
                        },
                        "old_phone_keys": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "description": "Key record of the phone that collected the card (public data only).",
                            "properties": {
                              "format": {
                                "type": "string",
                                "enum": [
                                  "mso_mdoc",
                                  "dc+sd-jwt"
                                ]
                              },
                              "recorded_utc": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "key_storage": {
                                "type": "string",
                                "description": "From the wallet provider's key attestation, e.g. android_strongbox, android_tee."
                              },
                              "user_authentication": {
                                "type": "string"
                              },
                              "attesting_issuer": {
                                "type": "string"
                              },
                              "attestation_format": {
                                "type": "string"
                              },
                              "key_thumbprint": {
                                "type": "string",
                                "description": "RFC 7638 thumbprint of the attested key."
                              },
                              "wallet_instance_jkt": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_json / invalid_offer_id / invalid_days / not_an_access_card / card_ended / user_not_usable / status_list_off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "card_revoked / already_replaced",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error / status_list_write_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?vc-image-upload": {
      "post": {
        "tags": [
          "eu-wallet-issuer-admin"
        ],
        "operationId": "vciImageUpload",
        "summary": "Upload a logo or card image for credential types",
        "description": "PNG/JPEG as base64 or data URL, max 2 MB. Logos must be square 128-1024 px; card images 640-2048 px wide with aspect 1.50-1.68. Admin auth: OIDC bearer with role admin (checked by introspection), or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'vci-images-upload|' + Host).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "vc-image-upload",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "logo",
                      "card"
                    ]
                  },
                  "name": {
                    "type": "string"
                  },
                  "data": {
                    "type": "string",
                    "description": "base64 or data: URL"
                  }
                },
                "required": [
                  "kind",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stored",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "image": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_upload / invalid_image",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "method_not_allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?healthsummary=1": {
      "get": {
        "tags": [
          "monitoring"
        ],
        "operationId": "signalHealthSummary",
        "summary": "Trunk registration state and 24 h call counters of the tenant",
        "description": "Latest registration event per configured trunk (role, host, event, re-creates, timestamp; placeholder rows for configured trunks without events) plus inbound INVITE/answered and outbound attempt/answered counts for the last 24 hours. Unauthenticated read used by the overview pages.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "healthsummary",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ts": {
                      "type": "string"
                    },
                    "trunks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "role": {
                            "type": "string"
                          },
                          "host": {
                            "type": "string"
                          },
                          "event": {
                            "type": "string"
                          },
                          "recreates": {},
                          "ts": {}
                        },
                        "additionalProperties": true
                      }
                    },
                    "configuredCount": {
                      "type": "integer"
                    },
                    "inbound24h": {
                      "type": "object",
                      "properties": {
                        "invites": {
                          "type": "integer"
                        },
                        "answered": {
                          "type": "integer"
                        }
                      }
                    },
                    "outbound24h": {
                      "type": "object",
                      "properties": {
                        "attempts": {
                          "type": "integer"
                        },
                        "answered": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?stats=1": {
      "get": {
        "tags": [
          "monitoring"
        ],
        "operationId": "signalStats",
        "summary": "Live rooms, peers, office sessions and tenant status",
        "description": "Live conference rooms with peers (name, verification, IP), lock and breakout state, signed-in office users, recent sessions, tenant status (LIVE / PENDING / CLAIM-PENDING) and grace period. `history=1` adds the room history from the session logs when logging is on. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'stats|<Host>') (AdminSharedSecret must be at least 24 chars).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "stats",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          },
          {
            "name": "history",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "1 = include room history"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ts": {
                      "type": "string"
                    },
                    "totalRooms": {
                      "type": "integer"
                    },
                    "totalConnections": {
                      "type": "integer"
                    },
                    "activeBreakouts": {
                      "type": "integer"
                    },
                    "rooms": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "officeUsers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "recentSessions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "roomHistory": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "tenant": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized (empty body)"
          }
        }
      }
    },
    "/signal.ashx?trunklog=1": {
      "get": {
        "tags": [
          "monitoring"
        ],
        "operationId": "signalTrunkLog",
        "summary": "Trunk registration log of the tenant",
        "description": "Registration events per trunk, filtered to the trunks still configured. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'trunklog|<Host>') (AdminSharedSecret must be at least 24 chars).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "trunklog",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreLogEvents"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?diallog=1": {
      "get": {
        "tags": [
          "monitoring"
        ],
        "operationId": "signalDialLog",
        "summary": "Outbound dial log of the tenant",
        "description": "Dial attempts and their outcome. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'diallog|<Host>') (AdminSharedSecret must be at least 24 chars).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "diallog",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreLogEvents"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?inboundlog=1": {
      "get": {
        "tags": [
          "monitoring"
        ],
        "operationId": "signalInboundLog",
        "summary": "Inbound call log of the tenant",
        "description": "Inbound INVITEs and their routing outcome. A superuser on the primary tenant sees the rows of every tenant. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'inboundlog|<Host>') (AdminSharedSecret must be at least 24 chars).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "inboundlog",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreLogEvents"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?auditlog=1": {
      "get": {
        "tags": [
          "monitoring"
        ],
        "operationId": "signalAuditLog",
        "summary": "Identity and admin audit log of the tenant",
        "description": "Sign-ins, account and admin changes. Filters: event, user, since (ISO date), limit. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'auditlog|<Host>') (AdminSharedSecret must be at least 24 chars).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "auditlog",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreLogEvents"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?cdrlog=1": {
      "get": {
        "tags": [
          "monitoring"
        ],
        "operationId": "signalCdrLog",
        "summary": "Call detail records of the tenant",
        "description": "Call detail records with filters: date (YYYY-MM-DD), direction, trunk, free-text q, limit. Response also lists the available dates and trunks. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'cdrlog|<Host>') (AdminSharedSecret must be at least 24 chars).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "cdrlog",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "inbound",
                "outbound"
              ]
            }
          },
          {
            "name": "trunk",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreLogEvents"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?registrar=1": {
      "get": {
        "tags": [
          "monitoring"
        ],
        "operationId": "signalRegistrar",
        "summary": "Current SIP registrations (contacts) of the tenant's users",
        "description": "Contacts registered at the SIP bridge, filtered to this tenant. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'registrar|<Host>') (AdminSharedSecret must be at least 24 chars).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "registrar",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "contacts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "filteredByTenant": {},
                    "droppedCrossTenant": {}
                  }
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "bridge unreachable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "bridge not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?recordings-list=1": {
      "get": {
        "tags": [
          "recordings-transcripts"
        ],
        "operationId": "signalRecordingsList",
        "summary": "List the tenant's call recordings",
        "description": "Recording files with call id, size and labels. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'recordings|<Host>') (AdminSharedSecret must be at least 24 chars).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "recordings-list",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ts": {
                      "type": "string"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "rootExists": {
                      "type": "boolean"
                    },
                    "countAll": {
                      "type": "integer"
                    },
                    "countReturned": {
                      "type": "integer"
                    },
                    "totalBytes": {
                      "type": "integer"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?recording=<callId>": {
      "get": {
        "tags": [
          "recordings-transcripts"
        ],
        "operationId": "signalRecordingStream",
        "summary": "Play or download one call recording (WAV)",
        "description": "Streams the recording; `download=1` adds Content-Disposition attachment. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'recording|<Host>') (AdminSharedSecret must be at least 24 chars).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "recording",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Call id"
          },
          {
            "name": "download",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Audio",
            "content": {
              "audio/wav": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "bad call id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?recording-label-set=1": {
      "post": {
        "tags": [
          "recordings-transcripts"
        ],
        "operationId": "signalRecordingLabelSet",
        "summary": "Set or clear the label of a recording",
        "description": "Free-text label shown in the recordings list. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'recording-label-set|<Host>') (AdminSharedSecret must be at least 24 chars).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "recording-label-set",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          },
          {
            "name": "callId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved"
          },
          "400": {
            "description": "bad input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?transcript-label-set=1": {
      "post": {
        "tags": [
          "recordings-transcripts"
        ],
        "operationId": "signalTranscriptLabelSet",
        "summary": "Set or clear the label of a transcript",
        "description": "Free-text label shown in the transcripts list. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'transcript-label-set|<Host>') (AdminSharedSecret must be at least 24 chars).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "transcript-label-set",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          },
          {
            "name": "file",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Transcript file name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved"
          },
          "400": {
            "description": "bad input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?list-transcripts=1": {
      "get": {
        "tags": [
          "recordings-transcripts"
        ],
        "operationId": "signalListTranscripts",
        "summary": "List the tenant's call transcripts",
        "description": "Transcript files with source and tag. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "list-transcripts",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "file": {
                            "type": "string"
                          },
                          "path": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string"
                          },
                          "tag": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "dirs": {},
                    "errors": {}
                  }
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?get-transcript=<file>": {
      "get": {
        "tags": [
          "recordings-transcripts"
        ],
        "operationId": "signalGetTranscript",
        "summary": "Read one transcript",
        "description": "Returns the stored transcript JSON. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "get-transcript",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Transcript file name (max 200 chars)"
          }
        ],
        "responses": {
          "200": {
            "description": "Transcript",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "invalid file",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "read failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?create-transcript-share=1": {
      "post": {
        "tags": [
          "recordings-transcripts"
        ],
        "operationId": "signalCreateTranscriptShare",
        "summary": "Create a public share link for a transcript",
        "description": "Mints a token link anyone can open without signing in; optional expiry in hours (no expiry when omitted). Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "create-transcript-share",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string"
                  },
                  "ttlHours": {
                    "type": "integer"
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Share link",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreShareLink"
                }
              }
            }
          },
          "400": {
            "description": "invalid_json / invalid_file",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "transcript_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?list-transcript-shares=1": {
      "get": {
        "tags": [
          "recordings-transcripts"
        ],
        "operationId": "signalListTranscriptShares",
        "summary": "List the public share links of transcripts",
        "description": "Active share links with creator and expiry. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "list-transcript-shares",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "shares": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?revoke-transcript-share=1": {
      "post": {
        "tags": [
          "recordings-transcripts"
        ],
        "operationId": "signalRevokeTranscriptShare",
        "summary": "Revoke a public share link of a transcript",
        "description": "The link stops working immediately. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "revoke-transcript-share",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string"
                  }
                },
                "required": [
                  "token"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Revoked"
          },
          "400": {
            "description": "invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?create-recording-share=1": {
      "post": {
        "tags": [
          "recordings-transcripts"
        ],
        "operationId": "signalCreateRecordingShare",
        "summary": "Create a public share link for a recording",
        "description": "Mints a token link anyone can open without signing in; optional expiry in hours (no expiry when omitted). Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "create-recording-share",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "callId": {
                    "type": "string"
                  },
                  "ttlHours": {
                    "type": "integer"
                  }
                },
                "required": [
                  "callId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Share link",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreShareLink"
                }
              }
            }
          },
          "400": {
            "description": "invalid_json / invalid_callid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "recording_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?list-recording-shares=1": {
      "get": {
        "tags": [
          "recordings-transcripts"
        ],
        "operationId": "signalListRecordingShares",
        "summary": "List the public share links of recordings",
        "description": "Active share links with creator and expiry. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "list-recording-shares",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "shares": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?revoke-recording-share=1": {
      "post": {
        "tags": [
          "recordings-transcripts"
        ],
        "operationId": "signalRevokeRecordingShare",
        "summary": "Revoke a public share link of a recording",
        "description": "The link stops working immediately. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "revoke-recording-share",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string"
                  }
                },
                "required": [
                  "token"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Revoked"
          },
          "400": {
            "description": "invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?get-shared-transcript=<token>": {
      "get": {
        "tags": [
          "recordings-transcripts"
        ],
        "operationId": "signalGetSharedTranscript",
        "summary": "Open a shared transcript by its public token",
        "description": "No sign-in; the token is the credential. 60 requests per minute per IP. Expired or revoked tokens answer 404.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "get-shared-transcript",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Share token"
          }
        ],
        "responses": {
          "200": {
            "description": "Transcript",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "500": {
            "description": "read_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?get-shared-recording=<token>": {
      "get": {
        "tags": [
          "recordings-transcripts"
        ],
        "operationId": "signalGetSharedRecording",
        "summary": "Metadata of a shared recording by its public token",
        "description": "No sign-in; the token is the credential. 60 requests per minute per IP.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "get-shared-recording",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Share token"
          }
        ],
        "responses": {
          "200": {
            "description": "Metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "callId": {
                      "type": "string"
                    },
                    "expiresUtc": {}
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          }
        }
      }
    },
    "/signal.ashx?stream-shared-recording=<token>": {
      "get": {
        "tags": [
          "recordings-transcripts"
        ],
        "operationId": "signalStreamSharedRecording",
        "summary": "Stream a shared recording by its public token (Range supported)",
        "description": "Audio stream for the share page; honours Range requests (206). 60 requests per minute per IP.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "stream-shared-recording",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Share token"
          },
          {
            "name": "Range",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Audio",
            "content": {
              "audio/wav": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "206": {
            "description": "Partial content",
            "content": {
              "audio/wav": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "416": {
            "description": "Range not satisfiable"
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "500": {
            "description": "read failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?cameras=1": {
      "get": {
        "tags": [
          "signaling"
        ],
        "operationId": "signalCameras",
        "summary": "List the tenant's configured cameras",
        "description": "Camera names and stream ids the office page can call. Any signed-in user.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "cameras",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "cameras": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "streamId": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?admin-check=1": {
      "get": {
        "tags": [
          "account"
        ],
        "operationId": "signalAdminCheck",
        "summary": "Check whether the caller is a tenant admin",
        "description": "Lets admin pages decide whether to render; answers 200 for admins and 401 otherwise.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "admin-check",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Admin",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "not an admin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?account=get": {
      "get": {
        "tags": [
          "account"
        ],
        "operationId": "signalAccountGet",
        "summary": "Read the signed-in user's account (role, profile, password state)",
        "description": "Profile claims, role, disabled flag, whether a password is set and the digest realm. Auth: the signed-in user's OIDC access token (self-service; acts only on the caller's own account).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "account",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "get"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string"
                    },
                    "disabled": {
                      "type": "boolean"
                    },
                    "profile": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "has_password": {
                      "type": "boolean"
                    },
                    "realm": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "bearer_required / invalid_token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "credentials_missing / user_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?account=profile": {
      "post": {
        "tags": [
          "account"
        ],
        "operationId": "signalAccountProfile",
        "summary": "Update the signed-in user's profile claims",
        "description": "Accepts OIDC standard claims (name, given_name, family_name, middle_name, nickname, profile, picture, website, phone_number, email, gender, birthdate YYYY-MM-DD or YYYY, zoneinfo, locale, address) and the caller-id preferences object sip_identity. Unknown keys are ignored; null removes a claim. Names and birthdate are locked after an identity-document check. Body cap 64 KB; 4096 chars per field. Auth: the signed-in user's OIDC access token (self-service; acts only on the caller's own account).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "account",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "profile"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "user": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_json, invalid_privacy, field_too_long, invalid_birthdate",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "invalid_token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "user_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "body_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?account=password": {
      "post": {
        "tags": [
          "account"
        ],
        "operationId": "signalAccountPassword",
        "summary": "Change (or first set) the signed-in user's password",
        "description": "New password as HA1 (MD5 of username:realm:password, realm = tenant host). `current_ha1` is required when a password exists, unless the session was established moments ago with a strong method. Auth: the signed-in user's OIDC access token (self-service; acts only on the caller's own account).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "account",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "password"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ha1": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{32}$"
                  },
                  "current_ha1": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{32}$"
                  }
                },
                "required": [
                  "ha1"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Changed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "first_set": {
                      "type": "boolean"
                    },
                    "wallet_recovery": {}
                  }
                }
              }
            }
          },
          "400": {
            "description": "missing_ha1, invalid_ha1, missing_current_ha1, invalid_current_ha1, new_equals_current",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "current_password_incorrect / invalid_token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?passkey=register-start": {
      "post": {
        "tags": [
          "account"
        ],
        "operationId": "signalPasskeyRegisterStart",
        "summary": "Start registering a passkey for the signed-in user",
        "description": "Returns PublicKeyCredentialCreationOptions for navigator.credentials.create(). Auth: the signed-in user's OIDC access token. 402 when passkeys are not enabled for the tenant.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "passkey",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "register-start"
              ]
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "credentialName": {
                    "type": "string"
                  },
                  "displayName": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Creation options",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "bearer_required / invalid_token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_licensed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?passkey=register-finish": {
      "post": {
        "tags": [
          "account"
        ],
        "operationId": "signalPasskeyRegisterFinish",
        "summary": "Finish registering a passkey with the attestation response",
        "description": "Verifies the attestation and stores the credential. Auth: the signed-in user's OIDC access token. 402 when passkeys are not enabled for the tenant.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "passkey",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "register-finish"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "WebAuthn registration response as produced by the page",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Registered",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "credentialId": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "algorithm": {},
                    "backedUp": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "verification error code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "invalid_token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "internal_error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?passkey=list": {
      "get": {
        "tags": [
          "account"
        ],
        "operationId": "signalPasskeyList",
        "summary": "List the signed-in user's passkeys",
        "description": "Name, created, last used, backup state and AAGUID per passkey. Auth: the signed-in user's OIDC access token. 402 when passkeys are not enabled for the tenant.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "passkey",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "list"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "passkeys": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "credentialId": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "lastUsedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "backedUp": {
                            "type": "boolean"
                          },
                          "aaguid": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "invalid_token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?passkey=delete": {
      "post": {
        "tags": [
          "account"
        ],
        "operationId": "signalPasskeyDelete",
        "summary": "Delete one of the signed-in user's passkeys",
        "description": "Removes the credential. Auth: the signed-in user's OIDC access token. 402 when passkeys are not enabled for the tenant.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "passkey",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "delete"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "credentialId": {
                    "type": "string"
                  }
                },
                "required": [
                  "credentialId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "removed": {}
                  }
                }
              }
            }
          },
          "400": {
            "description": "missing_credentialId",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "invalid_token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?totp=status": {
      "get": {
        "tags": [
          "account"
        ],
        "operationId": "signalTotpStatus",
        "summary": "TOTP enrolment state of the signed-in user",
        "description": "Whether TOTP is on, since when, and how many recovery codes are left. Auth: the signed-in user's OIDC access token. 402 when TOTP is not enabled for the tenant.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "totp",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "status"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean"
                    },
                    "enrolledAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "remainingRecoveryCodes": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "invalid_token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_licensed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?totp=enroll-start": {
      "post": {
        "tags": [
          "account"
        ],
        "operationId": "signalTotpEnrollStart",
        "summary": "Start TOTP enrolment (secret + otpauth URI)",
        "description": "Creates a pending secret; show it as QR code from otpauthUri, then confirm with enroll-finish. Auth: the signed-in user's OIDC access token. 402 when TOTP is not enabled for the tenant.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "totp",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "enroll-start"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pending secret",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "secretB32": {
                      "type": "string"
                    },
                    "otpauthUri": {
                      "type": "string"
                    },
                    "issuer": {
                      "type": "string"
                    },
                    "account": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "invalid_token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_licensed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "already_enrolled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?totp=enroll-finish": {
      "post": {
        "tags": [
          "account"
        ],
        "operationId": "signalTotpEnrollFinish",
        "summary": "Confirm TOTP enrolment with a code; returns recovery codes once",
        "description": "Activates TOTP when the code matches the pending secret and returns the plain recovery codes (shown only once). Auth: the signed-in user's OIDC access token. 402 when TOTP is not enabled for the tenant.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "totp",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "enroll-finish"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string"
                  }
                },
                "required": [
                  "code"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Enrolled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "recoveryCodes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad or missing code / no pending enrolment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "invalid_token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "feature_not_licensed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?totp=disable": {
      "post": {
        "tags": [
          "account"
        ],
        "operationId": "signalTotpDisable",
        "summary": "Switch TOTP off (requires a current code)",
        "description": "Disables the second factor. Auth: the signed-in user's OIDC access token. 402 when TOTP is not enabled for the tenant.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "totp",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "disable"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string"
                  }
                },
                "required": [
                  "code"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Disabled"
          },
          "400": {
            "description": "bad or missing code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "invalid_token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?totp=regenerate-recovery-codes": {
      "post": {
        "tags": [
          "account"
        ],
        "operationId": "signalTotpRegenerateRecoveryCodes",
        "summary": "Replace the recovery codes (requires a current code)",
        "description": "Old recovery codes stop working; the new ones are returned once. Auth: the signed-in user's OIDC access token. 402 when TOTP is not enabled for the tenant.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "totp",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "regenerate-recovery-codes"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string"
                  }
                },
                "required": [
                  "code"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "New codes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "recoveryCodes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad or missing code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "invalid_token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?totp=admin-reset": {
      "post": {
        "tags": [
          "tenant-users"
        ],
        "operationId": "signalTotpAdminReset",
        "summary": "Admin: remove TOTP from a user who lost the authenticator",
        "description": "Removes the user's TOTP enrolment so they can sign in with the password alone and enrol again. Auth: OIDC bearer with role admin or superuser.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "totp",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "admin-reset"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "target_user": {
                    "type": "string"
                  }
                },
                "required": [
                  "target_user"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reset"
          },
          "400": {
            "description": "missing or unknown target",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "invalid_token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden (admin role required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?credentials=list": {
      "get": {
        "tags": [
          "tenant-users"
        ],
        "operationId": "signalCredentialsList",
        "summary": "List the tenant's users (role, disabled, profile, wallet claims)",
        "description": "User directory of the tenant. Password hashes are shown only as a short stub. HMAC canonical: 'list|<Host>'. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature over the canonical string given per operation. 503 when AdminSharedSecret (>= 24 chars) is not configured.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "credentials",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "list"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "realm": {
                      "type": "string"
                    },
                    "users": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "user": {
                            "type": "string"
                          },
                          "ha1Stub": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string",
                            "enum": [
                              "siponly",
                              "user",
                              "poweruser",
                              "admin",
                              "guest"
                            ]
                          },
                          "disabled": {
                            "type": "boolean"
                          },
                          "profile": {
                            "type": "object",
                            "additionalProperties": true
                          },
                          "vc": {
                            "type": "object",
                            "additionalProperties": true
                          },
                          "vcPresentedAtUtc": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "read failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "credentials admin disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?credentials=put": {
      "post": {
        "tags": [
          "tenant-users"
        ],
        "operationId": "signalCredentialsPut",
        "summary": "Create or replace a user",
        "description": "Creates the user or replaces password and role. Fields: user, ha1 (32 hex), realm, role, optional pbkdf2. HMAC canonical: 'put|<Host>|<user>|<ha1>|<realm>|<role>'. Username: lowercase letters, digits and . _ - + @, max 254. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature over the canonical string given per operation. 503 when AdminSharedSecret (>= 24 chars) is not configured.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "credentials",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "put"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string"
                  },
                  "ha1": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{32}$"
                  },
                  "pbkdf2": {
                    "type": "string"
                  },
                  "realm": {
                    "type": "string"
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "siponly",
                      "user",
                      "poweruser",
                      "admin",
                      "guest"
                    ]
                  },
                  "disabled": {
                    "type": "boolean"
                  },
                  "profile": {
                    "type": "object",
                    "additionalProperties": true
                  }
                },
                "required": [
                  "user",
                  "ha1"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "realm": {
                      "type": "string"
                    },
                    "userCount": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "user not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "realm change rejected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "credentials admin disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?credentials=delete": {
      "post": {
        "tags": [
          "tenant-users"
        ],
        "operationId": "signalCredentialsDelete",
        "summary": "Delete a user",
        "description": "HMAC canonical: 'delete|<Host>|<user>|<ha1>|<realm>'. Username: lowercase letters, digits and . _ - + @, max 254. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature over the canonical string given per operation. 503 when AdminSharedSecret (>= 24 chars) is not configured.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "credentials",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "delete"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string"
                  },
                  "ha1": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{32}$"
                  },
                  "pbkdf2": {
                    "type": "string"
                  },
                  "realm": {
                    "type": "string"
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "siponly",
                      "user",
                      "poweruser",
                      "admin",
                      "guest"
                    ]
                  },
                  "disabled": {
                    "type": "boolean"
                  },
                  "profile": {
                    "type": "object",
                    "additionalProperties": true
                  }
                },
                "required": [
                  "user"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "realm": {
                      "type": "string"
                    },
                    "userCount": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "user not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "realm change rejected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "credentials admin disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?credentials=setrole": {
      "post": {
        "tags": [
          "tenant-users"
        ],
        "operationId": "signalCredentialsSetrole",
        "summary": "Change a user's role",
        "description": "Role one of siponly, user, poweruser, admin, guest (superuser is operator scope and cannot be set here). HMAC canonical: 'setrole|<Host>|<user>|<role>'. Username: lowercase letters, digits and . _ - + @, max 254. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature over the canonical string given per operation. 503 when AdminSharedSecret (>= 24 chars) is not configured.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "credentials",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "setrole"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string"
                  },
                  "ha1": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{32}$"
                  },
                  "pbkdf2": {
                    "type": "string"
                  },
                  "realm": {
                    "type": "string"
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "siponly",
                      "user",
                      "poweruser",
                      "admin",
                      "guest"
                    ]
                  },
                  "disabled": {
                    "type": "boolean"
                  },
                  "profile": {
                    "type": "object",
                    "additionalProperties": true
                  }
                },
                "required": [
                  "user",
                  "role"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "realm": {
                      "type": "string"
                    },
                    "userCount": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "user not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "realm change rejected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "credentials admin disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?credentials=setprofile": {
      "post": {
        "tags": [
          "tenant-users"
        ],
        "operationId": "signalCredentialsSetprofile",
        "summary": "Update a user's profile claims",
        "description": "`profile` is merged onto the stored profile: a posted key replaces, null/empty removes, missing keys stay. Portrait images are stored server-side. HMAC canonical: 'setprofile|<Host>|<user>|<sha256 hex of raw body>'. Username: lowercase letters, digits and . _ - + @, max 254. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature over the canonical string given per operation. 503 when AdminSharedSecret (>= 24 chars) is not configured.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "credentials",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "setprofile"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string"
                  },
                  "ha1": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{32}$"
                  },
                  "pbkdf2": {
                    "type": "string"
                  },
                  "realm": {
                    "type": "string"
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "siponly",
                      "user",
                      "poweruser",
                      "admin",
                      "guest"
                    ]
                  },
                  "disabled": {
                    "type": "boolean"
                  },
                  "profile": {
                    "type": "object",
                    "additionalProperties": true
                  }
                },
                "required": [
                  "user",
                  "profile"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "realm": {
                      "type": "string"
                    },
                    "userCount": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "user not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "realm change rejected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "credentials admin disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?credentials=setdisabled": {
      "post": {
        "tags": [
          "tenant-users"
        ],
        "operationId": "signalCredentialsSetdisabled",
        "summary": "Enable or disable a user",
        "description": "HMAC canonical: 'setdisabled|<Host>|<user>|true|false'. Username: lowercase letters, digits and . _ - + @, max 254. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature over the canonical string given per operation. 503 when AdminSharedSecret (>= 24 chars) is not configured.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "credentials",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "setdisabled"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string"
                  },
                  "ha1": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{32}$"
                  },
                  "pbkdf2": {
                    "type": "string"
                  },
                  "realm": {
                    "type": "string"
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "siponly",
                      "user",
                      "poweruser",
                      "admin",
                      "guest"
                    ]
                  },
                  "disabled": {
                    "type": "boolean"
                  },
                  "profile": {
                    "type": "object",
                    "additionalProperties": true
                  }
                },
                "required": [
                  "user",
                  "disabled"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "realm": {
                      "type": "string"
                    },
                    "userCount": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "user not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "realm change rejected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "credentials admin disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?credentials=setpassword": {
      "post": {
        "tags": [
          "tenant-users"
        ],
        "operationId": "signalCredentialsSetpassword",
        "summary": "Reset a user's password",
        "description": "Replaces only the HA1 (and optional pbkdf2); role and profile are kept. HMAC canonical: 'setpassword|<Host>|<user>|<ha1>'. Username: lowercase letters, digits and . _ - + @, max 254. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature over the canonical string given per operation. 503 when AdminSharedSecret (>= 24 chars) is not configured.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "credentials",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "setpassword"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string"
                  },
                  "ha1": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{32}$"
                  },
                  "pbkdf2": {
                    "type": "string"
                  },
                  "realm": {
                    "type": "string"
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "siponly",
                      "user",
                      "poweruser",
                      "admin",
                      "guest"
                    ]
                  },
                  "disabled": {
                    "type": "boolean"
                  },
                  "profile": {
                    "type": "object",
                    "additionalProperties": true
                  }
                },
                "required": [
                  "user",
                  "ha1"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "realm": {
                      "type": "string"
                    },
                    "userCount": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "user not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "realm change rejected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "credentials admin disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?virtualnumbers=list": {
      "get": {
        "tags": [
          "telephony-admin"
        ],
        "operationId": "signalVirtualNumbersList",
        "summary": "List the tenant's virtual numbers",
        "description": "Virtual numbers with their announcement text, AI assistant prompt and options. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'vnums-list|<Host>') (AdminSharedSecret must be at least 24 chars).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "virtualnumbers",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "list"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "virtualNumbers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "read failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "admin disabled / settings missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?virtualnumbers=write": {
      "post": {
        "tags": [
          "telephony-admin"
        ],
        "operationId": "signalVirtualNumbersWrite",
        "summary": "Replace the tenant's virtual number list",
        "description": "Replaces the whole list (max 200 entries; text max 4000 chars per number). Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'vnums-write|<Host>|<body length>') (AdminSharedSecret must be at least 24 chars).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "virtualnumbers",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "write"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "virtualNumbers": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "number": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "text": {
                          "type": "string"
                        },
                        "systemPrompt": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": true
                    }
                  }
                },
                "required": [
                  "virtualNumbers"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "invalid body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "admin disabled / settings missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?tenant-settings=list": {
      "get": {
        "tags": [
          "telephony-admin"
        ],
        "operationId": "signalTenantSettingsList",
        "summary": "Read the tenant's general settings",
        "description": "AI assistant settings (API key shown masked, model, maximum call duration) and issuer switches (status list, signed metadata, password grant). Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'tenant-settings-list|<Host>') (AdminSharedSecret must be at least 24 chars).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "tenant-settings",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "list"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "read failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "admin disabled / settings missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?tenant-settings=write": {
      "post": {
        "tags": [
          "telephony-admin"
        ],
        "operationId": "signalTenantSettingsWrite",
        "summary": "Change the tenant's general settings",
        "description": "Only posted keys change; an empty value clears a key. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'tenant-settings-write|<Host>|<body length>') (AdminSharedSecret must be at least 24 chars).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "tenant-settings",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "write"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Setting keys as returned by tenant-settings=list",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "invalid body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "admin disabled / settings missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?routing=list": {
      "get": {
        "tags": [
          "sip-admin"
        ],
        "operationId": "signalRoutingList",
        "summary": "List inbound DID routes",
        "description": "Inbound routes (Did, optional FromNumber, User) and the catch-all user. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'routing-list|<Host>') (AdminSharedSecret must be at least 24 chars).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "routing",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "list"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "routes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "catchallUser": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "read failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "admin disabled / settings missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?routing=write": {
      "post": {
        "tags": [
          "sip-admin"
        ],
        "operationId": "signalRoutingWrite",
        "summary": "Replace the inbound DID routing table",
        "description": "Replaces the whole table; a '*' catch-all row is kept. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'routing-write|<Host>|<body length>') (AdminSharedSecret must be at least 24 chars).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "routing",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "write"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "routes": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "Did": {
                          "type": "string"
                        },
                        "FromNumber": {
                          "type": "string"
                        },
                        "User": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "required": [
                  "routes"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "invalid body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "admin disabled / settings missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?outbound-routing=list": {
      "get": {
        "tags": [
          "sip-admin"
        ],
        "operationId": "signalOutboundRoutingList",
        "summary": "List outbound trunk-routing rules",
        "description": "Rules (Match prefix -> TrunkIds), the default trunk and the trunks available. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'outbound-routing-list|<Host>') (AdminSharedSecret must be at least 24 chars).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "outbound-routing",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "list"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "rules": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "defaultTrunkId": {
                      "type": "string"
                    },
                    "trunks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "read failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "admin disabled / settings missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?outbound-routing=write": {
      "post": {
        "tags": [
          "sip-admin"
        ],
        "operationId": "signalOutboundRoutingWrite",
        "summary": "Replace the outbound trunk-routing rules",
        "description": "Replaces rules and default trunk. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'outbound-routing-write|<Host>|<body length>') (AdminSharedSecret must be at least 24 chars).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "outbound-routing",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "write"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "rules": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "Match": {
                          "type": "string"
                        },
                        "TrunkIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "defaultTrunkId": {
                    "type": "string"
                  }
                },
                "required": [
                  "rules"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "invalid body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "admin disabled / settings missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?trunks=list": {
      "get": {
        "tags": [
          "sip-admin"
        ],
        "operationId": "signalTrunksList",
        "summary": "List the tenant's SIP trunks",
        "description": "Trunk definitions (host, port, transport, TLS/SRTP, registration, limits, caller-id options). Secrets are not echoed in clear. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'trunks-list|<Host>') (AdminSharedSecret must be at least 24 chars).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "trunks",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "list"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "read failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "admin disabled / settings missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?trunks=write": {
      "post": {
        "tags": [
          "sip-admin"
        ],
        "operationId": "signalTrunksWrite",
        "summary": "Replace the tenant's SIP trunk configuration",
        "description": "Replaces the trunk list. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'trunks-write|<Host>|<body length>') (AdminSharedSecret must be at least 24 chars).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "trunks",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "write"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "trunks": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                },
                "required": [
                  "trunks"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "invalid body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "admin disabled / settings missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?whitelist=write": {
      "post": {
        "tags": [
          "sip-admin"
        ],
        "operationId": "whitelistWrite",
        "summary": "Replace the PSTN number whitelist",
        "description": "Replaces the whole list; an empty list needs confirmEmpty: true. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'whitelist-write|<Host>|<body length>') (AdminSharedSecret must be at least 24 chars).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "whitelist",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "write"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "numbers": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "number": {
                          "type": "string"
                        },
                        "comment": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": true
                    }
                  },
                  "confirmEmpty": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "numbers"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved"
          },
          "400": {
            "description": "invalid body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?aliases=list": {
      "get": {
        "tags": [
          "sip-admin"
        ],
        "operationId": "signalAliasesList",
        "summary": "List dial aliases",
        "description": "Short names that dial a number, a room or a trunk. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'aliases-list|<Host>') (AdminSharedSecret must be at least 24 chars).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "aliases",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "list"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?aliases=add": {
      "post": {
        "tags": [
          "sip-admin"
        ],
        "operationId": "signalAliasesAdd",
        "summary": "Add a dial alias",
        "description": "Fields: alias (existing alias for edit/delete), name, number, room, trunk, comment. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'aliases-add|<Host>|<body length>') (AdminSharedSecret must be at least 24 chars).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "aliases",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "add"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "alias": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "number": {
                    "type": "string"
                  },
                  "room": {
                    "type": "string"
                  },
                  "trunk": {
                    "type": "string"
                  },
                  "comment": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "alias not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?aliases=edit": {
      "post": {
        "tags": [
          "sip-admin"
        ],
        "operationId": "signalAliasesEdit",
        "summary": "Edit a dial alias",
        "description": "Fields: alias (existing alias for edit/delete), name, number, room, trunk, comment. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'aliases-edit|<Host>|<body length>') (AdminSharedSecret must be at least 24 chars).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "aliases",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "edit"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "alias": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "number": {
                    "type": "string"
                  },
                  "room": {
                    "type": "string"
                  },
                  "trunk": {
                    "type": "string"
                  },
                  "comment": {
                    "type": "string"
                  }
                },
                "required": [
                  "alias"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "alias not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?aliases=delete": {
      "post": {
        "tags": [
          "sip-admin"
        ],
        "operationId": "signalAliasesDelete",
        "summary": "Delete a dial alias",
        "description": "Fields: alias (existing alias for edit/delete), name, number, room, trunk, comment. Auth: OIDC bearer of a tenant admin, or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'aliases-delete|<Host>|<body length>') (AdminSharedSecret must be at least 24 chars).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "aliases",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "delete"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "alias": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "number": {
                    "type": "string"
                  },
                  "room": {
                    "type": "string"
                  },
                  "trunk": {
                    "type": "string"
                  },
                  "comment": {
                    "type": "string"
                  }
                },
                "required": [
                  "alias"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "alias not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?acl=list": {
      "get": {
        "tags": [
          "sip-admin"
        ],
        "operationId": "signalAclList",
        "summary": "Read the bridge access-control list (SIP inbound / PSTN outbound)",
        "description": "Modes (allow/deny), implicit whitelist switches and entries of the bridge ACL. Auth: OIDC bearer of a superuser (or an admin of the primary tenant).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "operator",
        "parameters": [
          {
            "name": "acl",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "list"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ModeSipInbound": {
                      "type": "string"
                    },
                    "ModePstnOutbound": {
                      "type": "string"
                    },
                    "ImplicitWhitelistSipInbound": {
                      "type": "boolean"
                    },
                    "ImplicitWhitelistPstnOutbound": {
                      "type": "boolean"
                    },
                    "Entries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "403": {
            "description": "superuser required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "bridge-config-not-found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?acl=save": {
      "post": {
        "tags": [
          "sip-admin"
        ],
        "operationId": "signalAclSave",
        "summary": "Replace the bridge access-control list",
        "description": "Entries: Id, Kind, Scope, SubjectType, Subject, Comment, Disabled, ExpiresUtc. Auth: OIDC bearer of a superuser (or an admin of the primary tenant).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "operator",
        "parameters": [
          {
            "name": "acl",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "save"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ModeSipInbound": {
                    "type": "string",
                    "enum": [
                      "allow",
                      "deny"
                    ]
                  },
                  "ModePstnOutbound": {
                    "type": "string",
                    "enum": [
                      "allow",
                      "deny"
                    ]
                  },
                  "ImplicitWhitelistSipInbound": {
                    "type": "boolean"
                  },
                  "ImplicitWhitelistPstnOutbound": {
                    "type": "boolean"
                  },
                  "Entries": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved"
          },
          "400": {
            "description": "bad-json, bad-mode, bad-entries",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "superuser required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "bridge-config-not-found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?vnum-overview=1": {
      "get": {
        "tags": [
          "telephony-admin"
        ],
        "operationId": "signalVnumOverview",
        "summary": "Virtual numbers visible to the caller",
        "description": "Lists the tenant's virtual numbers filtered by their visibility for the caller's role (anonymous callers see public ones only). Optional bearer.",
        "security": [
          {},
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "vnum-overview",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string"
                    },
                    "virtualNumbers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "number": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "mode": {
                            "type": "string"
                          },
                          "visibility": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?vnum-edit=read": {
      "get": {
        "tags": [
          "telephony-admin"
        ],
        "operationId": "signalVnumEditRead",
        "summary": "Read one virtual number as its editor",
        "description": "For users listed as editors of the number (and admins).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "vnum-edit",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "read"
              ]
            }
          },
          {
            "name": "number",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "user": {
                      "type": "string"
                    },
                    "isAdmin": {
                      "type": "boolean"
                    },
                    "entry": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "missing_number",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "invalid_token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "not_an_editor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "vnum_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?vnum-edit=write": {
      "post": {
        "tags": [
          "telephony-admin"
        ],
        "operationId": "signalVnumEditWrite",
        "summary": "Update one virtual number as its editor",
        "description": "Editable fields: name (120), description (500), text (4000), leadInMs, maxSeconds (5-3600), loop, systemPrompt (100000), voice, language, visibility, editors (admins only), saveTranscripts, transcriptEmails, jitterWarmupMs and maximum AI call duration.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "vnum-edit",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "write"
              ]
            }
          },
          {
            "name": "number",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "entry": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_body / missing_number",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "invalid_token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "not_an_editor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "vnum_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "POST required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?outbound-ai-call=1": {
      "post": {
        "tags": [
          "telephony-admin"
        ],
        "operationId": "signalOutboundAiCall",
        "summary": "Place an outbound AI assistant call (admin console form)",
        "description": "Same operation as POST /api.ashx/v1/calls. Required: phone, email (for the result), systemPrompt (or number). Optional context (2 KB) and number (virtual number whose MCP tools and prompt the call uses). Optional: displayName, voice, language, maxSeconds (default 300), retries, retryDelayMinutes, scheduleAtUtc, jitterWarmupMs, model and an own API key. Body cap 200 KB. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "outbound-ai-call",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "phone": {
                    "type": "string"
                  },
                  "displayName": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "systemPrompt": {
                    "type": "string"
                  },
                  "voice": {
                    "type": "string"
                  },
                  "language": {
                    "type": "string"
                  },
                  "maxSeconds": {
                    "type": "integer"
                  },
                  "retries": {
                    "type": "integer"
                  },
                  "retryDelayMinutes": {
                    "type": "integer"
                  },
                  "scheduleAtUtc": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "jitterWarmupMs": {
                    "type": "integer"
                  },
                  "model": {
                    "type": "string"
                  },
                  "apiKey": {
                    "type": "string"
                  },
                  "context": {
                    "type": "string",
                    "maxLength": 2048,
                    "description": "Added to the prompt as 'Context for this call'."
                  },
                  "number": {
                    "type": "string",
                    "description": "Virtual number of the tenant: its MCP tools are offered on the call; its prompt is used when systemPrompt is empty."
                  }
                },
                "required": [
                  "phone",
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Queued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "body too large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "bridge error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "bridge not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?list-outbound-ai-calls=1": {
      "get": {
        "tags": [
          "telephony-admin"
        ],
        "operationId": "signalListOutboundAiCalls",
        "summary": "List outbound AI calls of the tenant",
        "description": "Queued, running and finished calls with outcome. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "list-outbound-ai-calls",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "ts": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "rows": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "bridge error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "bridge not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?cancel-outbound-ai-call=1": {
      "post": {
        "tags": [
          "telephony-admin"
        ],
        "operationId": "signalCancelOutboundAiCall",
        "summary": "Cancel a queued or running outbound AI call",
        "description": "Same operation as POST /api.ashx/v1/calls/{id}/hangup. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "cancel-outbound-ai-call",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "callId": {
                    "type": "string"
                  }
                },
                "required": [
                  "callId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cancelled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?delete-outbound-ai-record=1": {
      "post": {
        "tags": [
          "telephony-admin"
        ],
        "operationId": "signalDeleteOutboundAiRecord",
        "summary": "Delete the record of a finished outbound AI call",
        "description": "Removes the row from the call list. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "delete-outbound-ai-record",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "callId": {
                    "type": "string"
                  }
                },
                "required": [
                  "callId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?trunk-usage=1": {
      "get": {
        "tags": [
          "telephony-admin"
        ],
        "operationId": "signalTrunkUsage",
        "summary": "Per-trunk call counters and limits from the bridge",
        "description": "Rolling usage against each trunk's call caps. Auth: OIDC bearer of a superuser (or an admin of the primary tenant).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "operator",
        "parameters": [
          {
            "name": "trunk-usage",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Bridge answer",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "superuser required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "bridge error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "bridge not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?fraudguard-reset=1": {
      "post": {
        "tags": [
          "telephony-admin"
        ],
        "operationId": "signalFraudGuardReset",
        "summary": "Reset the outbound fraud guard after a lock-out",
        "description": "Clears the bridge's outbound fraud-guard state for the tenant; the reason is logged. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "fraudguard-reset",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reset",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "bridge error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "bridge not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?chat-email-config=1&op=get": {
      "get": {
        "tags": [
          "integrations-admin"
        ],
        "operationId": "signalChatEmailConfigGet",
        "summary": "Read the e-mail chat channel chat channel configuration",
        "description": "Returns the stored configuration JSON of the e-mail chat channel ({} when none). Auth: OIDC bearer of a tenant admin (role admin or superuser). Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "chat-email-config",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          },
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "get"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "500": {
            "description": "read-failed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?chat-email-config=1&op=save": {
      "post": {
        "tags": [
          "integrations-admin"
        ],
        "operationId": "signalChatEmailConfigSave",
        "summary": "Save the e-mail chat channel chat channel configuration",
        "description": "Replaces the configuration of the e-mail chat channel. Body must be a JSON object, max 128 KB. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "chat-email-config",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          },
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "save"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved"
          },
          "400": {
            "description": "bad-json / bad-allowedOrigins / too-many-origins",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "405": {
            "description": "method-not-allowed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "413": {
            "description": "payload-too-large",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?chat-widget-config=1&op=get": {
      "get": {
        "tags": [
          "integrations-admin"
        ],
        "operationId": "signalChatWidgetConfigGet",
        "summary": "Read the 'Chat with us' website widget chat channel configuration",
        "description": "Returns the stored configuration JSON of the 'Chat with us' website widget (incl. allowedOrigins, max 50) ({} when none). Auth: OIDC bearer of a tenant admin (role admin or superuser). Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "chat-widget-config",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          },
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "get"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "500": {
            "description": "read-failed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?chat-widget-config=1&op=save": {
      "post": {
        "tags": [
          "integrations-admin"
        ],
        "operationId": "signalChatWidgetConfigSave",
        "summary": "Save the 'Chat with us' website widget chat channel configuration",
        "description": "Replaces the configuration of the 'Chat with us' website widget (incl. allowedOrigins, max 50). Body must be a JSON object, max 128 KB. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "chat-widget-config",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          },
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "save"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved"
          },
          "400": {
            "description": "bad-json / bad-allowedOrigins / too-many-origins",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "405": {
            "description": "method-not-allowed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "413": {
            "description": "payload-too-large",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?list-webhooks=1": {
      "get": {
        "tags": [
          "integrations-admin"
        ],
        "operationId": "signalListWebhooks",
        "summary": "List the tenant's outgoing webhooks",
        "description": "Webhook subscriptions (secrets not shown). Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "list-webhooks",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CoreWebhook"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?create-webhook=1": {
      "post": {
        "tags": [
          "integrations-admin"
        ],
        "operationId": "signalCreateWebhook",
        "summary": "Create an outgoing webhook",
        "description": "URL must be https (http only for development) and must not point at this server. Events are event-type names (max 64 chars each). The signing secret is generated when omitted and returned once. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "create-webhook",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "maxLength": 500
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "active": {
                    "type": "boolean",
                    "default": true
                  },
                  "secret": {
                    "type": "string",
                    "maxLength": 256
                  }
                },
                "required": [
                  "url"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreWebhook"
                }
              }
            }
          },
          "400": {
            "description": "invalid_url / loopback_forbidden / invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?update-webhook=<id>": {
      "post": {
        "tags": [
          "integrations-admin"
        ],
        "operationId": "signalUpdateWebhook",
        "summary": "Change events or active flag of a webhook",
        "description": "Partial update. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "update-webhook",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Webhook id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "events": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "active": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?delete-webhook=<id>": {
      "post": {
        "tags": [
          "integrations-admin"
        ],
        "operationId": "signalDeleteWebhook",
        "summary": "Delete a webhook",
        "description": "Removes the subscription. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "delete-webhook",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Webhook id"
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted"
          },
          "400": {
            "description": "invalid id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?test-webhook=<id>": {
      "post": {
        "tags": [
          "integrations-admin"
        ],
        "operationId": "signalTestWebhook",
        "summary": "Send a signed test event to a webhook",
        "description": "Delivers a test event and reports the receiver's HTTP status, response body (truncated) and elapsed time. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "test-webhook",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Webhook id"
          }
        ],
        "responses": {
          "200": {
            "description": "Delivery result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "status": {
                      "type": "integer"
                    },
                    "elapsedMs": {
                      "type": "integer"
                    },
                    "responseBody": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "invalid id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?api-keys-list=1": {
      "get": {
        "tags": [
          "integrations-admin"
        ],
        "operationId": "signalListApiKeys",
        "summary": "List the tenant's personal API keys (prefix only)",
        "description": "Key metadata: id, name, prefix, active, created, last used. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "api-keys-list",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "prefix": {
                            "type": "string"
                          },
                          "active": {
                            "type": "boolean"
                          },
                          "createdAtUtc": {
                            "type": "string"
                          },
                          "createdBy": {
                            "type": "string"
                          },
                          "lastUsedUtc": {}
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?api-keys-create=1": {
      "post": {
        "tags": [
          "integrations-admin"
        ],
        "operationId": "signalCreateApiKey",
        "summary": "Create an ak_ API key (shown once)",
        "description": "Creates a key usable as Bearer on the v1 REST API and admin endpoints. The full key is returned only in this response. Requires an admin OIDC bearer (an API key cannot mint keys). Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "api-keys-create",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 100
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "prefix": {
                      "type": "string"
                    },
                    "key": {
                      "type": "string",
                      "description": "Full key, shown once"
                    },
                    "createdAtUtc": {
                      "type": "string"
                    },
                    "note": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "admin OIDC bearer required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?api-keys-revoke=<id>": {
      "post": {
        "tags": [
          "integrations-admin"
        ],
        "operationId": "signalRevokeApiKey",
        "summary": "Deactivate an API key",
        "description": "The key stops working; the record stays. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "api-keys-revoke",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Key id"
          }
        ],
        "responses": {
          "200": {
            "description": "Revoked"
          },
          "400": {
            "description": "invalid id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?api-keys-delete=<id>": {
      "post": {
        "tags": [
          "integrations-admin"
        ],
        "operationId": "signalDeleteApiKey",
        "summary": "Delete an API key record",
        "description": "Removes the key entirely. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "api-keys-delete",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Key id"
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted"
          },
          "400": {
            "description": "invalid id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?oidc-clients-delete=<client_id>": {
      "post": {
        "tags": [
          "integrations-admin"
        ],
        "operationId": "oidcClientsDelete",
        "summary": "Delete a registered OIDC client",
        "description": "The built-in client codeb-admin cannot be deleted. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "oidc-clients-delete",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "client_id"
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted"
          },
          "400": {
            "description": "invalid client_id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?oidc-clients-wallet-get=<client_id>": {
      "get": {
        "tags": [
          "integrations-admin"
        ],
        "operationId": "oidcClientsWalletGet",
        "summary": "Read the wallet-claim release policy of an OIDC client",
        "description": "Allow-list and default deny reason. A wallet-claim policy decides which EU Wallet (PID) claims are released to that relying-party client. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "oidc-clients-wallet-get",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "client_id"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "client_id": {
                      "type": "string"
                    },
                    "allow": {},
                    "deny_reason_default": {
                      "type": "string"
                    },
                    "effective_mode": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "invalid client_id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "read failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?oidc-clients-wallet-save=1": {
      "post": {
        "tags": [
          "integrations-admin"
        ],
        "operationId": "oidcClientsWalletSave",
        "summary": "Save the wallet-claim release policy of an OIDC client",
        "description": "Body cap 16 KB; allow-list cap 8 KB; codeb-admin is reserved. Unknown claims are reported in `rejected`. A wallet-claim policy decides which EU Wallet (PID) claims are released to that relying-party client. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "oidc-clients-wallet-save",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "client_id": {
                    "type": "string"
                  },
                  "allow": {
                    "description": "Claims released to the client"
                  },
                  "deny_reason_default": {
                    "type": "string"
                  }
                },
                "required": [
                  "client_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "saved": {
                      "type": "boolean"
                    },
                    "client_id": {
                      "type": "string"
                    },
                    "rejected": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "effective_mode": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?oidc-clients-wallet-delete=<client_id>": {
      "post": {
        "tags": [
          "integrations-admin"
        ],
        "operationId": "oidcClientsWalletDelete",
        "summary": "Remove the wallet-claim policy of an OIDC client (back to default)",
        "description": "The client falls back to the tenant default. A wallet-claim policy decides which EU Wallet (PID) claims are released to that relying-party client. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "oidc-clients-wallet-delete",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "client_id"
          }
        ],
        "responses": {
          "200": {
            "description": "Removed"
          },
          "400": {
            "description": "invalid client_id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?sfu-mode=1": {
      "post": {
        "tags": [
          "media-admin"
        ],
        "operationId": "signalSfuMode",
        "summary": "Force a conference room to SFU, mesh or automatic media routing",
        "description": "Applies to one room and notifies the bridge; the reason is logged. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "sfu-mode",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "room": {
                    "type": "string"
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "sfu",
                      "mesh",
                      "auto"
                    ]
                  },
                  "reason": {
                    "type": "string",
                    "maxLength": 200
                  }
                },
                "required": [
                  "room",
                  "mode"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Applied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "room": {
                      "type": "string"
                    },
                    "mode": {
                      "type": "string"
                    },
                    "previousMode": {
                      "type": "string"
                    },
                    "forceMode": {},
                    "dispatched": {},
                    "bridge": {}
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "dispatch failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?sfu-status=1": {
      "get": {
        "tags": [
          "media-admin"
        ],
        "operationId": "signalSfuStatus",
        "summary": "Media routing state of the tenant's rooms",
        "description": "Per-room mode and peer counts plus bridge SFU status. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "sfu-status",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "sfuEnabled": {
                      "type": "boolean"
                    },
                    "perRoomState": {},
                    "perRoomCount": {},
                    "bridge": {},
                    "asOfUtc": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?sfu-config=1": {
      "get": {
        "tags": [
          "media-admin"
        ],
        "operationId": "signalSfuConfig",
        "summary": "SFU settings in effect for the tenant",
        "description": "Read-only view of the SFU thresholds and switches. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "sfu-config",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "settings": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "asOfUtc": {
                      "type": "string"
                    },
                    "note": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?sfu-tenant-enable=1": {
      "post": {
        "tags": [
          "media-admin"
        ],
        "operationId": "signalSfuTenantEnable",
        "summary": "Enable or disable SFU routing for the tenant",
        "description": "Writes the tenant switch; the reason is logged. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "sfu-tenant-enable",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "reason": {
                    "type": "string"
                  }
                },
                "required": [
                  "enabled"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "setKey": {
                      "type": "string"
                    },
                    "setValue": {}
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?ice-status=1": {
      "get": {
        "tags": [
          "media-admin"
        ],
        "operationId": "signalIceStatus",
        "summary": "ICE policy of the tenant (mode, TURN relay advertising)",
        "description": "Current per-tenant ICE mode and TURN-relay advertising with the allowed choices. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "ice-status",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "perTenantMode": {},
                    "perTenantAdvertiseTurnRelay": {},
                    "choices": {},
                    "note": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?ice-tenant-set=1": {
      "post": {
        "tags": [
          "media-admin"
        ],
        "operationId": "signalIceTenantSet",
        "summary": "Set the tenant's ICE policy",
        "description": "`mode`: disabled, lite-optional or null (inherit the bridge default). `advertiseTurnRelay`: boolean or null (inherit). Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "ice-tenant-set",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mode": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "disabled",
                      "lite-optional",
                      null
                    ]
                  },
                  "advertiseTurnRelay": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "reason": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "wroteMode": {},
                    "wroteAdvertiseTurnRelay": {},
                    "perTenantMode": {},
                    "perTenantAdvertiseTurnRelay": {}
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?sip-ws-status=1": {
      "get": {
        "tags": [
          "media-admin"
        ],
        "operationId": "signalSipWsStatus",
        "summary": "SIP-over-WebSocket listener status and tenant coverage",
        "description": "Bridge SIP-WS listener state and which tenants are covered by its certificate. Auth: OIDC bearer of a superuser (or an admin of the primary tenant).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "operator",
        "parameters": [
          {
            "name": "sip-ws-status",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "coveredTenants": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "uncoveredTenants": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?onboard=1": {
      "post": {
        "tags": [
          "platform-operator"
        ],
        "operationId": "signalOnboardTenant",
        "summary": "Onboard a new tenant domain",
        "description": "Creates the tenant (domain, display name, admin e-mail) on the bridge; the admin receives a claim link. Auth: OIDC bearer of a superuser (or an admin of the primary tenant).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "operator",
        "parameters": [
          {
            "name": "onboard",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "domain": {
                    "type": "string"
                  },
                  "displayName": {
                    "type": "string"
                  },
                  "adminEmail": {
                    "type": "string",
                    "format": "email"
                  }
                },
                "required": [
                  "domain",
                  "adminEmail"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "superuser required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "bridge error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "bridge not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?list-tenants=1": {
      "get": {
        "tags": [
          "platform-operator"
        ],
        "operationId": "signalListTenants",
        "summary": "List all tenants of the platform",
        "description": "Tenant list from the bridge. Auth: OIDC bearer of a superuser (or an admin of the primary tenant).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "operator",
        "parameters": [
          {
            "name": "list-tenants",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "superuser required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "bridge error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "bridge not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?create-tenant-user=1": {
      "post": {
        "tags": [
          "platform-operator"
        ],
        "operationId": "signalCreateTenantUser",
        "summary": "Create a user in another tenant",
        "description": "Creates or replaces a user (username, password, role, email) in the named tenant. Auth: OIDC bearer of a superuser (or an admin of the primary tenant).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "operator",
        "parameters": [
          {
            "name": "create-tenant-user",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tenant": {
                    "type": "string"
                  },
                  "username": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "password": {
                    "type": "string"
                  },
                  "role": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  }
                },
                "required": [
                  "tenant",
                  "username",
                  "password"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "username": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string"
                    },
                    "replaced": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "superuser required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "tenant not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "write failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?acquire-cert=1": {
      "post": {
        "tags": [
          "platform-operator"
        ],
        "operationId": "signalAcquireCert",
        "summary": "Request a TLS certificate for a tenant domain",
        "description": "Asks the bridge to obtain a certificate for the tenant host (ACME). Auth: OIDC bearer of a superuser (or an admin of the primary tenant).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "operator",
        "parameters": [
          {
            "name": "acquire-cert",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tenant": {
                    "type": "string"
                  },
                  "adminEmail": {
                    "type": "string",
                    "format": "email"
                  },
                  "keyType": {
                    "type": "string"
                  }
                },
                "required": [
                  "tenant"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "superuser required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "bridge error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "bridge not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?list-weblogs=1": {
      "get": {
        "tags": [
          "platform-operator"
        ],
        "operationId": "signalListWeblogs",
        "summary": "List the web server log files of the tenant's site",
        "description": "Available log files of the hosting site. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "list-weblogs",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?get-weblog=<file>": {
      "get": {
        "tags": [
          "platform-operator"
        ],
        "operationId": "signalGetWeblog",
        "summary": "Read one web server log file as rows",
        "description": "Parsed rows of a log file, tail-limited; rows of other tenants are filtered out unless the caller is a superuser. Auth: OIDC bearer of a tenant admin (role admin or superuser).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "get-weblog",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Log file name"
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tail",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Number of rows from the end"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "file": {
                      "type": "string"
                    },
                    "fields": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "rows": {
                      "type": "array",
                      "items": {}
                    },
                    "totalRows": {
                      "type": "integer"
                    },
                    "tenantFilterApplied": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required / bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "read failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/chat.ashx?op=list-users": {
      "get": {
        "tags": [
          "chat"
        ],
        "operationId": "chatListUsers",
        "summary": "List the tenant's users you can chat with",
        "description": "Directory for starting chats. Not available to invited guests. Auth: OIDC bearer, or the signed invite-session cookie set by op=invite-redeem (invited guests are limited to their one thread). Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "list-users"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "self": {
                      "type": "string"
                    },
                    "users": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "403": {
            "description": "guest-blocked",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/chat.ashx?op=get-thread": {
      "get": {
        "tags": [
          "chat"
        ],
        "operationId": "chatGetThread",
        "summary": "Read a direct-message or group thread",
        "description": "Pass `with` (peer login) for a DM or `groupId` for a group; `sinceMs` returns only newer messages. Up to 500 messages. Auth: OIDC bearer, or the signed invite-session cookie set by op=invite-redeem (invited guests are limited to their one thread). Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "get-thread"
              ]
            }
          },
          {
            "name": "with",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "groupId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sinceMs",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Thread",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "peerLogin": {
                      "type": "string"
                    },
                    "peerName": {
                      "type": "string"
                    },
                    "pairKey": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "messages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "bad-peer / self-dm",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "403": {
            "description": "not-a-participant",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "404": {
            "description": "peer-not-found / group-not-found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/chat.ashx?op=mark-read": {
      "post": {
        "tags": [
          "chat"
        ],
        "operationId": "chatMarkRead",
        "summary": "Mark a thread as read",
        "description": "Resets the caller's unread counter of the DM (`with`) or group (`groupId`). Auth: OIDC bearer, or the signed invite-session cookie set by op=invite-redeem (invited guests are limited to their one thread). Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "mark-read"
              ]
            }
          },
          {
            "name": "with",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "groupId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "unread": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad-peer",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "404": {
            "description": "peer-not-found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "405": {
            "description": "method-not-allowed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/chat.ashx?op=unread-count": {
      "get": {
        "tags": [
          "chat"
        ],
        "operationId": "chatUnreadCount",
        "summary": "Unread message counters of the caller",
        "description": "Total plus per-DM and per-group counters. Auth: OIDC bearer, or the signed invite-session cookie set by op=invite-redeem (invited guests are limited to their one thread). Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "unread-count"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "unread": {
                      "type": "integer"
                    },
                    "dms": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "groups": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/chat.ashx?op=ws-ticket": {
      "post": {
        "tags": [
          "chat"
        ],
        "operationId": "chatWsTicket",
        "summary": "Mint a short-lived ticket for the chat WebSocket",
        "description": "Returns a single-use ticket and the wss:// URL of /chat-ws.ashx. GET works as well. Not available to invited guests. Auth: OIDC bearer, or the signed invite-session cookie set by op=invite-redeem (invited guests are limited to their one thread). Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "ws-ticket"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ticket",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ticket": {
                      "type": "string"
                    },
                    "wsUrl": {
                      "type": "string"
                    },
                    "ttlSeconds": {
                      "type": "integer"
                    },
                    "expiresUtc": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "403": {
            "description": "guest-blocked",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/chat.ashx?op=ws-health": {
      "get": {
        "tags": [
          "chat"
        ],
        "operationId": "chatWsHealth",
        "summary": "WebSocket session counters",
        "description": "Caller's open sessions and global session/ticket counters. Auth: OIDC bearer, or the signed invite-session cookie set by op=invite-redeem (invited guests are limited to their one thread). Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "ws-health"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "mySessions": {
                      "type": "integer"
                    },
                    "totalUsers": {
                      "type": "integer"
                    },
                    "totalSessions": {
                      "type": "integer"
                    },
                    "outstandingTickets": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/chat.ashx?op=create-group": {
      "post": {
        "tags": [
          "chat"
        ],
        "operationId": "chatCreateGroup",
        "summary": "Create a group chat",
        "description": "Name 1-64 chars; participants are tenant logins (the creator is added; max 50). The creator becomes group admin. Group admin operations share a per-user bucket of 10 with refill of 1 every 6 s (429 + Retry-After). Auth: OIDC bearer, or the signed invite-session cookie set by op=invite-redeem (invited guests are limited to their one thread). Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "create-group"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "participants": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "name",
                  "participants"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "participants": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "admins": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "missing-name, bad-name, bad-participant, too-many-participants, too-few-participants",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "404": {
            "description": "peer-not-found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "405": {
            "description": "method-not-allowed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          }
        }
      }
    },
    "/chat.ashx?op=list-group-members": {
      "get": {
        "tags": [
          "chat"
        ],
        "operationId": "chatListGroupMembers",
        "summary": "List the members of a group",
        "description": "Members with display name and admin flag; caller must be a member. Auth: OIDC bearer, or the signed invite-session cookie set by op=invite-redeem (invited guests are limited to their one thread). Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "list-group-members"
              ]
            }
          },
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "members": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "login": {
                            "type": "string"
                          },
                          "displayName": {
                            "type": "string"
                          },
                          "isAdmin": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad-group-id",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "403": {
            "description": "not-a-participant",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "404": {
            "description": "group-not-found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/chat.ashx?op=add-member": {
      "post": {
        "tags": [
          "chat"
        ],
        "operationId": "chatAddMember",
        "summary": "Add a member to a group (group admins)",
        "description": "Max 50 members. Group admin operations share a per-user bucket of 10 with refill of 1 every 6 s (429 + Retry-After). Auth: OIDC bearer, or the signed invite-session cookie set by op=invite-redeem (invited guests are limited to their one thread). Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "add-member"
              ]
            }
          },
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "login": {
                    "type": "string"
                  }
                },
                "required": [
                  "login"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "added": {
                      "type": "string"
                    },
                    "alreadyMember": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad-group-id, bad-login, too-many-participants",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "403": {
            "description": "not-an-admin",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "404": {
            "description": "group-not-found / peer-not-found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          }
        }
      }
    },
    "/chat.ashx?op=remove-member": {
      "post": {
        "tags": [
          "chat"
        ],
        "operationId": "chatRemoveMember",
        "summary": "Remove a member from a group (group admins)",
        "description": "Admins may remove others. Group admin operations share a per-user bucket of 10 with refill of 1 every 6 s (429 + Retry-After). Auth: OIDC bearer, or the signed invite-session cookie set by op=invite-redeem (invited guests are limited to their one thread). Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "remove-member"
              ]
            }
          },
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "login": {
                    "type": "string"
                  }
                },
                "required": [
                  "login"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "removed": {
                      "type": "string"
                    },
                    "notMember": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad-group-id / bad-login",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "403": {
            "description": "not-a-participant / not-an-admin",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "404": {
            "description": "group-not-found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          }
        }
      }
    },
    "/chat.ashx?op=leave-group": {
      "post": {
        "tags": [
          "chat"
        ],
        "operationId": "chatLeaveGroup",
        "summary": "Leave a group",
        "description": "If the last admin leaves, the next member becomes admin. Auth: OIDC bearer, or the signed invite-session cookie set by op=invite-redeem (invited guests are limited to their one thread). Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "leave-group"
              ]
            }
          },
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "left": {
                      "type": "boolean"
                    },
                    "notMember": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad-group-id",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/chat.ashx?op=rename-group": {
      "post": {
        "tags": [
          "chat"
        ],
        "operationId": "chatRenameGroup",
        "summary": "Rename a group (group admins)",
        "description": "Name 1-64 chars. Group admin operations share a per-user bucket of 10 with refill of 1 every 6 s (429 + Retry-After). Auth: OIDC bearer, or the signed invite-session cookie set by op=invite-redeem (invited guests are limited to their one thread). Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "rename-group"
              ]
            }
          },
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 64
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "name": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad-group-id / bad-name",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "403": {
            "description": "not-an-admin",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "404": {
            "description": "group-not-found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          }
        }
      }
    },
    "/chat.ashx?op=delete-message": {
      "post": {
        "tags": [
          "chat"
        ],
        "operationId": "chatDeleteMessage",
        "summary": "Delete one of your own messages (within 24 hours)",
        "description": "Replaces the message with a tombstone and notifies the other participants. Thread by `with` or `groupId`. Auth: OIDC bearer, or the signed invite-session cookie set by op=invite-redeem (invited guests are limited to their one thread). Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "delete-message"
              ]
            }
          },
          {
            "name": "msgId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "with",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "groupId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "description": "bad-msg-id, bad-peer, bad-group-id, self-dm",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "403": {
            "description": "not-sender / not-a-participant",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "404": {
            "description": "not-found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "410": {
            "description": "too-old",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "500": {
            "description": "write-fail",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/chat.ashx?op=meeting-send": {
      "post": {
        "tags": [
          "chat"
        ],
        "operationId": "chatMeetingSend",
        "summary": "Archive one of your in-meeting chat lines",
        "description": "Stores the caller's outgoing in-meeting message in their personal per-room, per-day archive (idempotent by clientMsgId). Body max 4000 chars; rate limited. Auth: OIDC bearer, or the signed invite-session cookie set by op=invite-redeem (invited guests are limited to their one thread). Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "meeting-send"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "room": {
                    "type": "string",
                    "description": "a-z0-9_-"
                  },
                  "body": {
                    "type": "string",
                    "maxLength": 4000
                  },
                  "clientMsgId": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{4,64}$"
                  },
                  "tsMs": {
                    "type": "integer"
                  },
                  "senderName": {
                    "type": "string"
                  }
                },
                "required": [
                  "room",
                  "body",
                  "clientMsgId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stored",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "id": {
                      "type": "string"
                    },
                    "tsUtcMs": {
                      "type": "integer"
                    },
                    "room": {
                      "type": "string"
                    },
                    "dupe": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad-room, empty-body, bad-clientMsgId",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "413": {
            "description": "body-too-large",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          }
        }
      }
    },
    "/chat.ashx?op=meeting-list": {
      "get": {
        "tags": [
          "chat"
        ],
        "operationId": "chatMeetingList",
        "summary": "List your archived meeting chats (rooms and days)",
        "description": "Rooms with day buckets and message counts, newest first. Auth: OIDC bearer, or the signed invite-session cookie set by op=invite-redeem (invited guests are limited to their one thread). Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "meeting-list"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "rooms": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "room": {
                            "type": "string"
                          },
                          "days": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "day": {
                                  "type": "string"
                                },
                                "n": {
                                  "type": "integer"
                                },
                                "lastTsMs": {
                                  "type": "integer"
                                }
                              }
                            }
                          },
                          "n": {
                            "type": "integer"
                          },
                          "lastTsMs": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/chat.ashx?op=meeting-thread": {
      "get": {
        "tags": [
          "chat"
        ],
        "operationId": "chatMeetingThread",
        "summary": "Read your archived meeting chat for one room and day",
        "description": "`day` YYYY-MM-DD. Auth: OIDC bearer, or the signed invite-session cookie set by op=invite-redeem (invited guests are limited to their one thread). Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "meeting-thread"
              ]
            }
          },
          {
            "name": "room",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "day",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "self": {
                      "type": "string"
                    },
                    "room": {
                      "type": "string"
                    },
                    "day": {
                      "type": "string"
                    },
                    "messages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad-room / bad-day",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/chat.ashx?op=invite-create": {
      "post": {
        "tags": [
          "chat"
        ],
        "operationId": "chatInviteCreateGuest",
        "summary": "Invite an external guest into a DM or group (single-use link)",
        "description": "Creates a single-use invitation link for an outside person, bound to one DM peer or one group of which the caller is a member. ttl_hours default 168, max 720. 5 per hour per inviter; at most 1000 open invitations per tenant. The key in the URL is shown only in this response. Guests cannot invite. Auth: OIDC bearer, or the signed invite-session cookie set by op=invite-redeem (invited guests are limited to their one thread). Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "invite-create"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "display_name": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "target": {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "dm",
                          "group"
                        ]
                      },
                      "peer": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "kind"
                    ]
                  },
                  "ttl_hours": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 720
                  }
                },
                "required": [
                  "display_name",
                  "target"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "invite_id": {
                      "type": "string"
                    },
                    "api_key": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "display_name": {
                      "type": "string"
                    },
                    "target": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "expires_at": {
                      "type": "string"
                    },
                    "expires_in_hours": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad-body, bad-display-name, bad-target",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "403": {
            "description": "forbidden / not-a-member",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "404": {
            "description": "peer-not-found / group-not-found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "503": {
            "description": "invite-cap",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/chat.ashx?op=invite-list": {
      "get": {
        "tags": [
          "chat"
        ],
        "operationId": "chatInviteListGuest",
        "summary": "List guest invitations (own; all for admins)",
        "description": "Key hints only, never the key. Auth: OIDC bearer, or the signed invite-session cookie set by op=invite-redeem (invited guests are limited to their one thread). Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "invite-list"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "invites": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "sees_all": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/chat.ashx?op=invite-revoke": {
      "post": {
        "tags": [
          "chat"
        ],
        "operationId": "chatInviteRevokeGuest",
        "summary": "Revoke a guest invitation (inviter or admin)",
        "description": "The link stops working. Auth: OIDC bearer, or the signed invite-session cookie set by op=invite-redeem (invited guests are limited to their one thread). Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "invite-revoke"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "invite_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "invite_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "invite_id": {
                      "type": "string"
                    },
                    "already_revoked": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad-invite-id",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "404": {
            "description": "not-found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/chat.ashx?op=invite-redeem": {
      "post": {
        "tags": [
          "chat"
        ],
        "operationId": "chatInviteRedeem",
        "summary": "Redeem a guest invitation and receive an invite-session cookie",
        "description": "Anonymous. Validates invite_id + key from the invitation URL, marks it used, adds a pseudo-user to the target thread and sets a signed HttpOnly session cookie (codeb_chat_invite_<invite_id>) that authorises the other chat ops for that thread. 10 attempts per minute per IP.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "invite-redeem"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "invite_id": {
                    "type": "string"
                  },
                  "k": {
                    "type": "string",
                    "description": "Key from the invitation URL"
                  }
                },
                "required": [
                  "invite_id",
                  "k"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Redeemed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "invite_id": {
                      "type": "string"
                    },
                    "login": {
                      "type": "string"
                    },
                    "display_name": {
                      "type": "string"
                    },
                    "thread": {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string"
                        },
                        "pairKey": {
                          "type": "string"
                        },
                        "peer": {
                          "type": "string"
                        },
                        "groupId": {
                          "type": "string"
                        }
                      }
                    },
                    "expires_at": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad-body / missing-fields",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "404": {
            "description": "invalid-or-expired",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "405": {
            "description": "method-not-allowed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "410": {
            "description": "expired, revoked, already-used",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          }
        }
      }
    },
    "/chat.ashx?op=external-inject": {
      "post": {
        "tags": [
          "chat"
        ],
        "operationId": "chatExternalInject",
        "summary": "Server-to-server: inject an external message into a channel group",
        "description": "For gateways (SMS, ticketing, recorders, other chat systems): posts a message from an external party into the per-channel group of the tenant, routed to the channel's configured users. Channel must be registered in the external-inject configuration. Body or mediaUrl required; body max 4000 chars.",
        "security": [
          {
            "externalInjectSecret": []
          }
        ],
        "x-codeb-audience": "operator",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "external-inject"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channel": {
                    "type": "string",
                    "pattern": "^[a-z0-9-]{1,32}$"
                  },
                  "remoteId": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "remoteName": {
                    "type": "string"
                  },
                  "body": {
                    "type": "string"
                  },
                  "sourceMsgId": {
                    "type": "string"
                  },
                  "mediaUrl": {
                    "type": "string",
                    "format": "uri"
                  },
                  "contentType": {
                    "type": "string"
                  }
                },
                "required": [
                  "channel",
                  "remoteId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Injected",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "messageId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad-body, bad-channel, no-routing-users, bad-remoteId, empty-message",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "403": {
            "description": "not-configured",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "404": {
            "description": "unknown-channel",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "405": {
            "description": "method-not-allowed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "413": {
            "description": "body-too-large",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "500": {
            "description": "inject-failed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/chat.ashx?op=external-inject-config-get": {
      "get": {
        "tags": [
          "chat"
        ],
        "operationId": "chatExternalInjectConfigGet",
        "summary": "Read the external-inject configuration (secret masked)",
        "description": "Channels (display label, routing users) and the masked shared secret. Auth: OIDC bearer with role admin, superadmin or superuser.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "external-inject-config-get"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "configured": {
                      "type": "boolean"
                    },
                    "secretMasked": {
                      "type": "string"
                    },
                    "channels": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/chat.ashx?op=external-inject-config-set": {
      "post": {
        "tags": [
          "chat"
        ],
        "operationId": "chatExternalInjectConfigSet",
        "summary": "Change the external-inject configuration",
        "description": "Set `secret` (16-256 chars [A-Za-z0-9._-]) or `__rotate__` to generate one (returned once as secretPlaintext); `channels` maps channel ids to {displayLabel, routingUsers}. Auth: OIDC bearer with role admin, superadmin or superuser.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "external-inject-config-set"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "secret": {
                    "type": "string"
                  },
                  "channels": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "properties": {
                        "displayLabel": {
                          "type": "string"
                        },
                        "routingUsers": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "configured": {
                      "type": "boolean"
                    },
                    "secretMasked": {
                      "type": "string"
                    },
                    "secretPlaintext": {
                      "type": "string",
                      "description": "Only when just generated"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "bad-body / bad-secret",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "405": {
            "description": "method-not-allowed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/chat-invite.ashx?op=send-email": {
      "post": {
        "tags": [
          "chat"
        ],
        "operationId": "inviteSendEmail",
        "summary": "Create a chat or meeting invitation and e-mail it",
        "description": "Same as op=create, and additionally writes the invitation e-mail to the server's mail pickup. Auth: OIDC bearer. Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "send-email"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channel": {
                    "type": "string"
                  },
                  "threadKey": {
                    "type": "string"
                  },
                  "inviteeEmail": {
                    "type": "string",
                    "format": "email"
                  },
                  "inviteeDisplayName": {
                    "type": "string"
                  },
                  "scope": {
                    "type": "string",
                    "enum": [
                      "chat",
                      "meeting"
                    ],
                    "default": "chat"
                  }
                },
                "required": [
                  "channel",
                  "threadKey",
                  "inviteeEmail"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sent",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "nonce": {
                      "type": "string"
                    },
                    "hotlink": {
                      "type": "string"
                    },
                    "expiresUtc": {
                      "type": "string"
                    },
                    "pickupDir": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad-body, missing-email, missing-channel, missing-thread, bad-scope",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "405": {
            "description": "method-not-allowed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "500": {
            "description": "pickup-fail",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/chat-invite.ashx?op=accept": {
      "post": {
        "tags": [
          "chat"
        ],
        "operationId": "inviteAccept",
        "summary": "Accept a chat invitation and start an anonymous session",
        "description": "Anonymous. Consumes the signed invitation token (single use) and returns the anonymous session (also set as cookie codeb-anon-session).",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "accept"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "t": {
                    "type": "string",
                    "description": "Invitation token"
                  },
                  "displayName": {
                    "type": "string"
                  }
                },
                "required": [
                  "t"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Session",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sessionId": {
                      "type": "string"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "channel": {
                      "type": "string"
                    },
                    "threadKey": {
                      "type": "string"
                    },
                    "scope": {
                      "type": "string"
                    },
                    "displayName": {
                      "type": "string"
                    },
                    "expiresUtc": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad-body / missing-token",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "bad-invite",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "405": {
            "description": "method-not-allowed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "409": {
            "description": "already-consumed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/chat-invite.ashx?op=rotate-hmac": {
      "post": {
        "tags": [
          "chat"
        ],
        "operationId": "inviteRotateHmac",
        "summary": "Rotate the tenant's invitation signing secret",
        "description": "All outstanding invitation tokens become invalid at once. Auth: OIDC bearer with role admin, superadmin or superuser.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "rotate-hmac"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Rotated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "rotated": {
                      "type": "boolean"
                    },
                    "secretLen": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "500": {
            "description": "rotate-fail",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/chat-widget.ashx?op=send": {
      "post": {
        "tags": [
          "chat-widget"
        ],
        "operationId": "widgetSend",
        "summary": "Send a visitor message from the website widget",
        "description": "Requires the widget session (cookie or bearer) and an Origin on the tenant's allow-list matching the session. Rate limited per session per hour (tenant setting). Errors are application/problem+json; CORS for allow-listed origins.",
        "security": [
          {
            "chatWidgetSession": []
          }
        ],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "send"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "threadKey": {
                    "type": "string"
                  },
                  "body": {
                    "type": "string"
                  }
                },
                "required": [
                  "body"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stored",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "messageId": {
                      "type": "string"
                    },
                    "timestampUtc": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad-body / empty-body",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "no-session",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "403": {
            "description": "widget-disabled, origin-not-allowed, origin-drift, tenant-drift, thread-drift",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "405": {
            "description": "method-not-allowed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          }
        }
      }
    },
    "/chat-widget.ashx?op=poll": {
      "get": {
        "tags": [
          "chat-widget"
        ],
        "operationId": "widgetPoll",
        "summary": "Poll new messages of the visitor's thread",
        "description": "Returns messages after `sinceUtc`. Same session and origin rules as op=send.",
        "security": [
          {
            "chatWidgetSession": []
          }
        ],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "poll"
              ]
            }
          },
          {
            "name": "threadKey",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sinceUtc",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "messages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "serverUtc": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "no-session",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "403": {
            "description": "widget-disabled, origin-not-allowed, tenant-drift, thread-drift",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/chat-email.ashx?op=get-messages": {
      "get": {
        "tags": [
          "chat-email"
        ],
        "operationId": "emailGetMessages",
        "summary": "Read the messages of one e-mail thread",
        "description": "Messages of the thread. Auth: OIDC bearer of a tenant admin. Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "get-messages"
              ]
            }
          },
          {
            "name": "thread",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "messages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "missing-thread",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/chat-email.ashx?op=send": {
      "post": {
        "tags": [
          "chat-email"
        ],
        "operationId": "emailSend",
        "summary": "Send an e-mail reply from the inbox",
        "description": "Sends via the local mail pickup; `thread` defaults to `to`. Auth: OIDC bearer of a tenant admin. Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "send"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "thread": {
                    "type": "string"
                  },
                  "to": {
                    "type": "string",
                    "format": "email"
                  },
                  "subject": {
                    "type": "string"
                  },
                  "body": {
                    "type": "string"
                  }
                },
                "required": [
                  "to",
                  "body"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sent",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad-body, missing-to, empty-body",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "405": {
            "description": "method-not-allowed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "500": {
            "description": "send-fail",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/chat-email.ashx?op=poll-inbox": {
      "post": {
        "tags": [
          "chat-email"
        ],
        "operationId": "emailPollInbox",
        "summary": "Import new mails from the inbox drop folder now",
        "description": "Processes the drop folder immediately instead of waiting for the poll interval. Auth: OIDC bearer of a tenant admin. Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "poll-inbox"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "processed": {
                      "type": "integer"
                    },
                    "failed": {
                      "type": "integer"
                    },
                    "skipped": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "405": {
            "description": "method-not-allowed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/chat-email.ashx?op=mark-read": {
      "post": {
        "tags": [
          "chat-email"
        ],
        "operationId": "emailMarkRead",
        "summary": "Mark an e-mail thread as read",
        "description": "Clears the unread flag. Auth: OIDC bearer of a tenant admin. Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "mark-read"
              ]
            }
          },
          {
            "name": "thread",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "missing-thread",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "405": {
            "description": "method-not-allowed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/chat-email.ashx?op=delete-thread": {
      "delete": {
        "tags": [
          "chat-email"
        ],
        "operationId": "emailDeleteThread",
        "summary": "Delete an e-mail thread (superuser)",
        "description": "POST is accepted as well. Auth: OIDC bearer of a superuser. Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "operator",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "delete-thread"
              ]
            }
          },
          {
            "name": "thread",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "missing-thread",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "405": {
            "description": "method-not-allowed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/chat-email.ashx?op=config": {
      "get": {
        "tags": [
          "chat-email"
        ],
        "operationId": "emailConfigGet",
        "summary": "Read the e-mail channel configuration",
        "description": "Secrets are reported only as present/absent. Auth: OIDC bearer of a tenant admin. Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "config"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean"
                    },
                    "dryRun": {
                      "type": "boolean"
                    },
                    "hasWebhookVerifyToken": {
                      "type": "boolean"
                    },
                    "anonRateLimitPerHour": {
                      "type": "integer"
                    },
                    "anonSessionIdleHours": {
                      "type": "integer"
                    },
                    "requireAnonCaptcha": {
                      "type": "boolean"
                    },
                    "smtpPickupDir": {
                      "type": "string"
                    },
                    "smtpFromAddress": {
                      "type": "string"
                    },
                    "smtpFromDisplay": {
                      "type": "string"
                    },
                    "inboxDropFolder": {
                      "type": "string"
                    },
                    "inboxPollIntervalSeconds": {
                      "type": "integer"
                    },
                    "allowedFromDomains": {}
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "405": {
            "description": "method-not-allowed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "chat-email"
        ],
        "operationId": "emailConfigPut",
        "summary": "Change the e-mail channel configuration",
        "description": "Only posted fields change. Auth: OIDC bearer of a tenant admin. Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "config"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "dryRun": {
                    "type": "boolean"
                  },
                  "smtpPickupDir": {
                    "type": "string"
                  },
                  "smtpFromAddress": {
                    "type": "string"
                  },
                  "smtpFromDisplay": {
                    "type": "string"
                  },
                  "inboxDropFolder": {
                    "type": "string"
                  },
                  "inboxPollIntervalSeconds": {
                    "type": "integer"
                  },
                  "allowedFromDomains": {
                    "type": "string",
                    "description": "Comma-separated"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad-body",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/pms.ashx?op=config": {
      "get": {
        "tags": [
          "pms"
        ],
        "operationId": "pmsConfig",
        "summary": "Is the property-management inbox enabled for this tenant?",
        "description": "Enabled flag, badge text and a host hint of the configured portal (no credentials). Auth: OIDC bearer.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "config"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "provider": {
                      "type": "string"
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "badge": {
                      "type": "string"
                    },
                    "baseUrlHint": {
                      "type": "string"
                    },
                    "build": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/pms.ashx?op=thread": {
      "get": {
        "tags": [
          "pms"
        ],
        "operationId": "pmsThread",
        "summary": "Read one guest conversation from the property-management portal",
        "description": "Proxies the conversation from the configured portal. Auth: OIDC bearer of a signed-in operator; 60 requests per minute per operator. 503 when the property-management integration is not configured. Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "thread"
              ]
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{1,19}$"
            },
            "description": "Conversation id (digits)"
          }
        ],
        "responses": {
          "200": {
            "description": "Conversation (as returned by the portal)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "bad-id",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            }
          },
          "502": {
            "description": "upstream-error / bad-upstream",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "503": {
            "description": "not-configured",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/pms.ashx?op=admin-get": {
      "get": {
        "tags": [
          "pms"
        ],
        "operationId": "pmsAdminGet",
        "summary": "Admin: read the property-management integration config",
        "description": "Stored configuration (or a template when none exists). Auth: OIDC bearer with admin role. Errors are application/problem+json.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "admin-get"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "string"
                    },
                    "exists": {
                      "type": "boolean"
                    },
                    "config": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "parseError": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "500": {
            "description": "read-error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/pms.ashx?op=admin-save": {
      "post": {
        "tags": [
          "pms"
        ],
        "operationId": "pmsAdminSave",
        "summary": "Admin: save the property-management integration config",
        "description": "baseUrl must be https (http for development) and must not target loopback, link-local or private addresses. Credentials left empty keep the stored ones. Body max 64 KB. Auth: admin role.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "admin-save"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "baseUrl": {
                    "type": "string",
                    "format": "uri"
                  },
                  "auth": {
                    "type": "object",
                    "properties": {
                      "mode": {
                        "type": "string",
                        "enum": [
                          "cookie",
                          "bearer"
                        ]
                      },
                      "cookie": {
                        "type": "string"
                      },
                      "bearer": {
                        "type": "string"
                      }
                    }
                  },
                  "timeoutMs": {
                    "type": "integer"
                  },
                  "badge": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "enabled": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad-json, bad-baseurl, ssrf-blocked",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "405": {
            "description": "method-not-allowed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "413": {
            "description": "body-too-large",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "500": {
            "description": "write-error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/pms.ashx?op=admin-test": {
      "post": {
        "tags": [
          "pms"
        ],
        "operationId": "pmsAdminTest",
        "summary": "Admin: test the connection to the property-management portal",
        "description": "Calls the portal with the posted (or saved) configuration and reports the upstream status and the portal user. Auth: admin role.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "admin-test"
              ]
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "upstreamStatus": {
                      "type": "integer"
                    },
                    "upstreamContentType": {
                      "type": "string"
                    },
                    "upstreamUser": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad-json / no-config",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          },
          "405": {
            "description": "method-not-allowed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProblem"
                }
              }
            }
          }
        }
      }
    },
    "/api.ashx/v1/inbound-routes/{did}": {
      "get": {
        "tags": [
          "v1-rest"
        ],
        "operationId": "v1GetInboundRoute",
        "summary": "Get one inbound route by DID",
        "description": "Returns the route (camelCase keys). Auth: Bearer OIDC access token of a tenant admin, or an ak_ API key. Errors: {error, error_description}.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "did",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "URL-encoded DID, max 64"
          }
        ],
        "responses": {
          "200": {
            "description": "Route",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "did": {
                      "type": "string"
                    },
                    "fromNumber": {
                      "type": "string"
                    },
                    "user": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "invalid_did",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "v1-rest"
        ],
        "operationId": "v1UpdateInboundRoute",
        "summary": "Change the target user of an inbound route",
        "description": "Only `User` changes. Use ?fromNumber= to address a caller-specific row. Body max 8 KiB. Auth: Bearer OIDC access token of a tenant admin, or an ak_ API key. Errors: {error, error_description}.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "did",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fromNumber",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Select the row with this FromNumber"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "User": {
                    "type": "string",
                    "maxLength": 64
                  }
                },
                "required": [
                  "User"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated route",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "invalid_did, from_too_long, invalid_body, invalid_json, missing_user, user_too_long",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "write_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "v1-rest"
        ],
        "operationId": "v1DeleteInboundRoute",
        "summary": "Delete an inbound route",
        "description": "The '*' catch-all row cannot be deleted. Auth: Bearer OIDC access token of a tenant admin, or an ak_ API key. Errors: {error, error_description}.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "did",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deleted": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_did / cannot_delete_catchall",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "write_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api.ashx/v1/outbound-routes/{match}": {
      "get": {
        "tags": [
          "v1-rest"
        ],
        "operationId": "v1GetOutboundRoute",
        "summary": "Get one outbound routing rule by Match",
        "description": "Returns the rule. Auth: Bearer OIDC access token of a tenant admin, or an ak_ API key. Errors: {error, error_description}.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "match",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "URL-encoded number prefix, max 64"
          }
        ],
        "responses": {
          "200": {
            "description": "Rule",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "match": {
                      "type": "string"
                    },
                    "trunkIds": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "invalid_match",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "v1-rest"
        ],
        "operationId": "v1UpdateOutboundRoute",
        "summary": "Change the trunks of an outbound routing rule",
        "description": "Body field names are PascalCase. Body max 8 KiB; trunk ids max 64 chars each. Auth: Bearer OIDC access token of a tenant admin, or an ak_ API key. Errors: {error, error_description}.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "match",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "TrunkIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 64
                    }
                  }
                },
                "required": [
                  "TrunkIds"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated rule",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "invalid_match, invalid_body, invalid_json, missing_trunkids, trunkid_too_long",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "write_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "v1-rest"
        ],
        "operationId": "v1DeleteOutboundRoute",
        "summary": "Delete an outbound routing rule",
        "description": "Removes the rule. Auth: Bearer OIDC access token of a tenant admin, or an ak_ API key. Errors: {error, error_description}.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "match",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deleted": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_match",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "write_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/rp-cert.ashx?reload-keys": {
      "post": {
        "tags": [
          "rp-cert"
        ],
        "operationId": "rpCertReloadKeys",
        "summary": "Drop the cached RP CA key so it is re-read from disk",
        "description": "Maintenance helper after replacing the CA material. Auth: OIDC bearer with role admin (checked by introspection).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "reload-keys",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "action": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "method_not_allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/csc/v2/credentials/pin": {
      "post": {
        "tags": [
          "csc-signing"
        ],
        "operationId": "cscCredentialsPin",
        "summary": "Set or change the signed-in user's Sign PIN (SCAL 2 PIN factor)",
        "description": "Needs the user's own sign-in token (wallet signing tokens and tokens of deleted guest accounts are refused). The first PIN needs only new_pin; changing it needs current_pin as well, and a wrong current PIN counts toward the lock (5 wrong in a row lock for 15 minutes). A new PIN has 6-12 digits; all-same digits and plain ascending or descending runs are refused. Only a salted PBKDF2-SHA256 hash is stored.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "new_pin"
                ],
                "properties": {
                  "new_pin": {
                    "type": "string",
                    "pattern": "^[0-9]{6,12}$"
                  },
                  "current_pin": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "PIN set",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "const": "ok"
                    },
                    "pin_set": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_request (the new PIN does not meet the rules) or invalid_pin (wrong current PIN)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "access_denied / credential_locked (Retry-After), or a token that may not set a PIN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "description": "server_error / pin_store_unavailable (the store is unreadable; fails closed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/emrtd-relay.ashx?p=admin-self-invite": {
      "post": {
        "tags": [
          "emrtd"
        ],
        "operationId": "emrtdAdminSelfInvite",
        "summary": "E-mail the instructions to open an account in CodeB Wallet (self-service)",
        "description": "Admin. Sends a step-by-step e-mail (English or German) on how to open a document-checked guest account alone in CodeB Wallet: install the app (Google Play, myeudi.app), open https://myeudi.app/open/account, read the passport or ID card, confirm the e-mail address with a code. The mail carries no token and opens nothing by itself; the self_service release rule applies unchanged. Refused for an address that already belongs to an account. Limits: 30 per admin and hour, 200 per site and day, one per address every 10 minutes.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "For the greeting"
                  },
                  "lang": {
                    "type": "string",
                    "enum": [
                      "en",
                      "de"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sent",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "const": "sent"
                    },
                    "email": {
                      "type": "string"
                    },
                    "lang": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_email or invalid JSON"
          },
          "401": {
            "description": "Admin sign-in required"
          },
          "409": {
            "description": "email_in_use: the address already belongs to an account"
          },
          "429": {
            "description": "rate_limited, daily_cap or recently_sent (Retry-After)"
          },
          "500": {
            "description": "mail_failed or server_error"
          },
          "503": {
            "description": "self_service_off or temporarily_unavailable"
          }
        }
      }
    },
    "/site-guard.ashx": {
      "get": {
        "tags": [
          "tenant-admin"
        ],
        "operationId": "siteGuardBrowserConfig",
        "summary": "Site protection: browser switches",
        "description": "Public. The browser deterrents switched on for this site (read by js/site-guard.js). exempt=true when the request carries the access token of a signed-in admin and admins are exempt. Without admin=1 only GET.",
        "responses": {
          "200": {
            "description": "Browser switches",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "browser": {
                      "type": "object",
                      "properties": {
                        "consoleWarning": {
                          "type": "boolean"
                        },
                        "blockContextMenu": {
                          "type": "boolean"
                        },
                        "blockShortcuts": {
                          "type": "boolean"
                        },
                        "detectDebugger": {
                          "type": "boolean"
                        },
                        "detectWindowSize": {
                          "type": "boolean"
                        },
                        "detectConsole": {
                          "type": "boolean"
                        },
                        "blankPage": {
                          "type": "boolean"
                        },
                        "reportTrips": {
                          "type": "boolean"
                        }
                      }
                    },
                    "exempt": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "tenant-admin"
        ],
        "operationId": "siteGuardTripReport",
        "summary": "Site protection: developer tools detected",
        "description": "Browser report (navigator.sendBeacon) when developer tools were detected. Logged only when the site logs detections; at most 10 per address in 10 minutes. Always 204.",
        "parameters": [
          {
            "name": "trip",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          },
          {
            "name": "r",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "debugger",
                "size",
                "console"
              ]
            }
          },
          {
            "name": "p",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^/[A-Za-z0-9._/-]{0,120}$"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Received"
          },
          "400": {
            "description": "Bad report"
          }
        }
      }
    },
    "/site-guard.ashx?admin=1": {
      "get": {
        "tags": [
          "tenant-admin"
        ],
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "operationId": "siteGuardSettingsGet",
        "summary": "Site protection settings",
        "parameters": [
          {
            "name": "admin",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "description": "Admin. All site protection settings of this site (App_Data/<host>/site-guard.json; missing: everything off), the caller's address and how many tool requests were refused since the server started. The tool rule covers web pages only (/ and .html, optionally scripts, styles, images, fonts, videos); APIs (.ashx, /.well-known/, extensionless API routes, .json, robots.txt, sitemap*.xml, llms*.txt, ai.txt, security.txt, humans.txt, the wallet logo images in /img/, /images/ and /vc-images/) always work with every client. Tool patterns that would match web browsers are refused.",
        "responses": {
          "200": {
            "description": "Settings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "consoleWarning": {
                      "type": "boolean"
                    },
                    "blockContextMenu": {
                      "type": "boolean"
                    },
                    "blockShortcuts": {
                      "type": "boolean"
                    },
                    "detectDebugger": {
                      "type": "boolean"
                    },
                    "detectWindowSize": {
                      "type": "boolean"
                    },
                    "detectConsole": {
                      "type": "boolean"
                    },
                    "blankPage": {
                      "type": "boolean"
                    },
                    "reportTrips": {
                      "type": "boolean"
                    },
                    "exemptAdmins": {
                      "type": "boolean"
                    },
                    "blockTools": {
                      "type": "boolean"
                    },
                    "blockEmptyUserAgent": {
                      "type": "boolean"
                    },
                    "toolScope": {
                      "type": "string",
                      "enum": [
                        "pages",
                        "pages-assets"
                      ]
                    },
                    "toolPatterns": {
                      "type": "array",
                      "maxItems": 20,
                      "items": {
                        "type": "string",
                        "maxLength": 64
                      }
                    },
                    "allowIps": {
                      "type": "array",
                      "maxItems": 20,
                      "items": {
                        "type": "string",
                        "description": "IP address or IPv4 range (a.b.c.d/n)"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Admin sign-in required"
          },
          "429": {
            "description": "Too many failed admin calls"
          }
        }
      },
      "post": {
        "tags": [
          "tenant-admin"
        ],
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "operationId": "siteGuardSettingsSet",
        "summary": "Save site protection settings",
        "parameters": [
          {
            "name": "admin",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "description": "Admin. Every key optional; keys not sent keep their value. Unknown keys and wrong types are refused. Takes effect within 5 seconds.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "consoleWarning": {
                    "type": "boolean"
                  },
                  "blockContextMenu": {
                    "type": "boolean"
                  },
                  "blockShortcuts": {
                    "type": "boolean"
                  },
                  "detectDebugger": {
                    "type": "boolean"
                  },
                  "detectWindowSize": {
                    "type": "boolean"
                  },
                  "detectConsole": {
                    "type": "boolean"
                  },
                  "blankPage": {
                    "type": "boolean"
                  },
                  "reportTrips": {
                    "type": "boolean"
                  },
                  "exemptAdmins": {
                    "type": "boolean"
                  },
                  "blockTools": {
                    "type": "boolean"
                  },
                  "blockEmptyUserAgent": {
                    "type": "boolean"
                  },
                  "toolScope": {
                    "type": "string",
                    "enum": [
                      "pages",
                      "pages-assets"
                    ]
                  },
                  "toolPatterns": {
                    "type": "array",
                    "maxItems": 20,
                    "items": {
                      "type": "string",
                      "maxLength": 64
                    }
                  },
                  "allowIps": {
                    "type": "array",
                    "maxItems": 20,
                    "items": {
                      "type": "string",
                      "description": "IP address or IPv4 range (a.b.c.d/n)"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved settings"
          },
          "400": {
            "description": "Invalid setting"
          },
          "401": {
            "description": "Admin sign-in required"
          }
        }
      }
    },
    "/emrtd-relay.ashx?p=admin-wpn-limits": {
      "get": {
        "tags": [
          "emrtd"
        ],
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "operationId": "emrtdAdminWpnLimitsGet",
        "summary": "Wallet Provider limits",
        "description": "Admin. This site's native Wallet Provider rate limits per hour: wallet attestations per wallet instance key and per network, nonces per network. Order per value: this site's setting, else App_Data/_shared/emrtd/config.json (walletProviderMintsPerKeyPerHour / walletProviderMintsPerNetworkPerHour / walletProviderNoncesPerNetworkPerHour), else the test-phase defaults 120 / 600 / 1200.",
        "responses": {
          "200": {
            "description": "Effective limits per hour",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "mintsPerKey": {
                      "type": "object",
                      "properties": {
                        "value": {
                          "type": "integer"
                        },
                        "server": {
                          "type": "integer"
                        },
                        "site": {
                          "type": "boolean"
                        }
                      }
                    },
                    "mintsPerNetwork": {
                      "type": "object",
                      "properties": {
                        "value": {
                          "type": "integer"
                        },
                        "server": {
                          "type": "integer"
                        },
                        "site": {
                          "type": "boolean"
                        }
                      }
                    },
                    "noncesPerNetwork": {
                      "type": "object",
                      "properties": {
                        "value": {
                          "type": "integer"
                        },
                        "server": {
                          "type": "integer"
                        },
                        "site": {
                          "type": "boolean"
                        }
                      }
                    },
                    "min": {
                      "type": "integer"
                    },
                    "max": {
                      "type": "integer"
                    },
                    "enabled": {
                      "type": "boolean",
                      "description": "the native Wallet Provider runs on this site"
                    },
                    "minAppVersionCode": {
                      "type": "object",
                      "properties": {
                        "value": {
                          "type": "integer"
                        },
                        "server": {
                          "type": "integer"
                        },
                        "site": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Admin sign-in required"
          }
        }
      },
      "post": {
        "tags": [
          "emrtd"
        ],
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "operationId": "emrtdAdminWpnLimitsSet",
        "summary": "Wallet Provider limits: set",
        "description": "Admin. Sets this site's limits (1..10000 each); null = the server value; all null removes the site setting. [WPN-MINVER 2026-10-18] Also min_app_version_code (0..2100000000; 0 = off on this site, null = the server value walletProviderMinAppVersionCode): the lowest CodeB Wallet version code the provider serves (426 app_update_required). Sent alone it changes only the minimum; the three limits change only when at least one of them is sent.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mints_per_key": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10000,
                    "nullable": true
                  },
                  "mints_per_network": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10000,
                    "nullable": true
                  },
                  "nonces_per_network": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10000,
                    "nullable": true
                  },
                  "min_app_version_code": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0,
                    "maximum": 2100000000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Effective limits per hour",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "mintsPerKey": {
                      "type": "object",
                      "properties": {
                        "value": {
                          "type": "integer"
                        },
                        "server": {
                          "type": "integer"
                        },
                        "site": {
                          "type": "boolean"
                        }
                      }
                    },
                    "mintsPerNetwork": {
                      "type": "object",
                      "properties": {
                        "value": {
                          "type": "integer"
                        },
                        "server": {
                          "type": "integer"
                        },
                        "site": {
                          "type": "boolean"
                        }
                      }
                    },
                    "noncesPerNetwork": {
                      "type": "object",
                      "properties": {
                        "value": {
                          "type": "integer"
                        },
                        "server": {
                          "type": "integer"
                        },
                        "site": {
                          "type": "boolean"
                        }
                      }
                    },
                    "min": {
                      "type": "integer"
                    },
                    "max": {
                      "type": "integer"
                    },
                    "enabled": {
                      "type": "boolean",
                      "description": "the native Wallet Provider runs on this site"
                    },
                    "minAppVersionCode": {
                      "type": "object",
                      "properties": {
                        "value": {
                          "type": "integer"
                        },
                        "server": {
                          "type": "integer"
                        },
                        "site": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A value outside 1..10000"
          },
          "401": {
            "description": "Admin sign-in required"
          }
        }
      }
    },
    "/emrtd-relay.ashx?p=admin-dtc": {
      "get": {
        "tags": [
          "emrtd"
        ],
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "operationId": "emrtdAdminDtcGet",
        "summary": "DTC chip data: hold time",
        "description": "Admin. How long the chip files (DG1, DG2, SOD) of a reading with DTC consent are held in memory for the Photo ID (ICAO DTC type 1). The server's appSetting WebPhone:Dtc:HoldMinutes (1..1440, else 1440 = 24 hours, test phase) is the ceiling; the site setting can only shorten it (capped = true when a longer site value was lowered).",
        "responses": {
          "200": {
            "description": "Current hold time",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "hold_minutes": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 1440
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "site",
                        "appSetting",
                        "default"
                      ]
                    },
                    "capped": {
                      "type": "boolean"
                    },
                    "ceiling_minutes": {
                      "type": "integer"
                    },
                    "default_minutes": {
                      "type": "integer"
                    },
                    "max_minutes": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Admin sign-in required"
          }
        }
      },
      "post": {
        "tags": [
          "emrtd"
        ],
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "operationId": "emrtdAdminDtcSet",
        "summary": "DTC chip data: set the hold time",
        "description": "Admin. Sets the site's hold time (1..1440 minutes); null removes the site setting (back to the default). Readings already held keep their time.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "hold_minutes": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 1,
                    "maximum": 1440
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current hold time",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "hold_minutes": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 1440
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "site",
                        "appSetting",
                        "default"
                      ]
                    },
                    "default_minutes": {
                      "type": "integer"
                    },
                    "max_minutes": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Admin sign-in required"
          },
          "400": {
            "description": "hold_minutes must be 1 to 1440, or null"
          },
          "500": {
            "description": "server_error"
          }
        }
      }
    },
    "/vci.ashx?pid-read": {
      "post": {
        "tags": [
          "eu-wallet-issuer"
        ],
        "operationId": "pidSigninRead",
        "summary": "Start the passport / ID card reading of a PID sign-in",
        "description": "Part of the PID sign-in with a passport / ID card reading inside the OpenID4VCI authorisation (handover CODEB-WALLET-PID-PREFILL-VCI-2026-10-17). Bound to the browser that started it (HttpOnly cookie codeb_pidflow, SameSite=Lax); same-origin JSON POSTs only. Document-checked accounts and a test PID: designed to follow ETSI TS 119 461 v2.1.1 and ARF 3.0, not certified, no face comparison. Creates a reading session (kind signin, 15 minutes) for the flow and sets cookie codeb_emrtd for /wallet/emrtd/status. The wallet opens app_link (App Link) on the same phone, or the page shows it as a QR code; after the reading the wallet's 'Back to sign-in' opens continue_url.",
        "parameters": [
          {
            "name": "pid-read",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "f": {
                    "type": "string",
                    "description": "Flow id from the chooser page"
                  }
                },
                "required": [
                  "f"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reading started",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sid": {
                      "type": "string"
                    },
                    "app_link": {
                      "type": "string",
                      "format": "uri"
                    },
                    "continue_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "expires_in": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "cross-site request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "next": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "flow unknown, expired or not this browser's",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "next": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "the flow cannot start a reading (message)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "next": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "JSON expected",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "next": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "too many readings from this network or for this flow",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "next": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "reading service busy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "next": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?pid-continue": {
      "get": {
        "tags": [
          "eu-wallet-issuer"
        ],
        "operationId": "pidSigninContinue",
        "summary": "Continue the PID sign-in after the reading (single use)",
        "description": "Part of the PID sign-in with a passport / ID card reading inside the OpenID4VCI authorisation (handover CODEB-WALLET-PID-PREFILL-VCI-2026-10-17). Bound to the browser that started it (HttpOnly cookie codeb_pidflow, SameSite=Lax); same-origin JSON POSTs only. Document-checked accounts and a test PID: designed to follow ETSI TS 119 461 v2.1.1 and ARF 3.0, not certified, no face comparison. The first call with this browser's cookie after a genuine reading gets the authorization code (302 to the wallet's redirect_uri), or, for a new document, the new account (address confirmed before); every later call 'Sign-in continued'; another browser 'Continue on the device where you started signing in'.",
        "parameters": [
          {
            "name": "pid-continue",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          },
          {
            "name": "s",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{16,64}$"
            },
            "description": "Continue token (also the wallet's returnUrl)"
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to the wallet with code (or error=access_denied when the PID is on hold)"
          },
          "200": {
            "description": "Page: waiting, e-mail step, message, sign-in continued, other device",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "bad token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "next": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "unknown or expired",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?pid-code": {
      "post": {
        "tags": [
          "eu-wallet-issuer"
        ],
        "operationId": "pidSigninCode",
        "summary": "PID sign-in, signed out: mail a 6-digit code for the new account's address (before the reading)",
        "description": "Part of the PID sign-in with a passport / ID card reading inside the OpenID4VCI authorisation (handover CODEB-WALLET-PID-PREFILL-VCI-2026-10-17). Bound to the browser that started it (HttpOnly cookie codeb_pidflow, SameSite=Lax); same-origin JSON POSTs only. Document-checked accounts and a test PID: designed to follow ETSI TS 119 461 v2.1.1 and ARF 3.0, not certified, no face comparison. The address of the new guest account is confirmed BEFORE the reading, so the reading request the wallet shows names the account it opens (masked). At most 3 requests per flow and 3 codes per address and hour; the address must not be a login or another account's e-mail. Existing guest account: when the document already belongs to an enabled guest account, the person may give that account's address instead; the page answers every address alike (\"we sent a code\") and never tells whether an account exists. After the code is confirmed the flow continues only with that account and only with its own document, and a fresh reading is always required. Any other account continues after the normal sign-in.",
        "parameters": [
          {
            "name": "pid-code",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "f": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  }
                },
                "required": [
                  "f",
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "code_sent",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid e-mail",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "next": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "cross-site request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "next": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "flow unknown / other browser",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "next": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "e-mail in use, not this flow's step, or the flow ended (see next)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "next": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "too many codes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "next": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?pid-verify": {
      "post": {
        "tags": [
          "eu-wallet-issuer"
        ],
        "operationId": "pidSigninVerify",
        "summary": "PID sign-in, signed out: confirm the address with the mailed code",
        "description": "Part of the PID sign-in with a passport / ID card reading inside the OpenID4VCI authorisation (handover CODEB-WALLET-PID-PREFILL-VCI-2026-10-17). Bound to the browser that started it (HttpOnly cookie codeb_pidflow, SameSite=Lax); same-origin JSON POSTs only. Document-checked accounts and a test PID: designed to follow ETSI TS 119 461 v2.1.1 and ARF 3.0, not certified, no face comparison. Five wrong codes end the flow. After this the reading can start; the account (login = the address, no password, chip attributes read-only) opens only after a genuine reading under the release rule self_service (genuine chip, attested phone with issuance-key proof, document not expired, one account per document and phone, limits per network and day). Its PID can only be collected with the issuance key of the phone that read the document. Existing guest account: when the document already belongs to an enabled guest account, the person may give that account's address instead; the page answers every address alike (\"we sent a code\") and never tells whether an account exists. After the code is confirmed the flow continues only with that account and only with its own document, and a fresh reading is always required. Any other account continues after the normal sign-in.",
        "parameters": [
          {
            "name": "pid-verify",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "f": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "code": {
                    "type": "string",
                    "pattern": "^[0-9]{6}$"
                  }
                },
                "required": [
                  "f",
                  "email",
                  "code"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "email_ok",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "email_ok"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "account": {
                      "type": "string",
                      "description": "masked address"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "code missing, wrong or expired",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "next": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "cross-site request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "next": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "flow unknown / other browser",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "next": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "the flow ended (see next)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "next": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?pid-signin": {
      "get": {
        "tags": [
          "eu-wallet-issuer"
        ],
        "operationId": "pidSigninNormal",
        "summary": "PID sign-in: use the normal sign-in instead of the reading",
        "description": "Part of the PID sign-in with a passport / ID card reading inside the OpenID4VCI authorisation (handover CODEB-WALLET-PID-PREFILL-VCI-2026-10-17). Bound to the browser that started it (HttpOnly cookie codeb_pidflow, SameSite=Lax); same-origin JSON POSTs only. Document-checked accounts and a test PID: designed to follow ETSI TS 119 461 v2.1.1 and ARF 3.0, not certified, no face comparison. Continues the saved authorisation request with the site's own sign-in (once).",
        "parameters": [
          {
            "name": "pid-signin",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          },
          {
            "name": "f",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "To the sign-in (or, signed in, to the wallet)"
          },
          "200": {
            "description": "Already continued / other device",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "unknown flow",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?pid-skip": {
      "get": {
        "tags": [
          "eu-wallet-issuer"
        ],
        "operationId": "pidSigninSkip",
        "summary": "PID sign-in (signed in, account without a document): continue without reading",
        "description": "Part of the PID sign-in with a passport / ID card reading inside the OpenID4VCI authorisation (handover CODEB-WALLET-PID-PREFILL-VCI-2026-10-17). Bound to the browser that started it (HttpOnly cookie codeb_pidflow, SameSite=Lax); same-origin JSON POSTs only. Document-checked accounts and a test PID: designed to follow ETSI TS 119 461 v2.1.1 and ARF 3.0, not certified, no face comparison. Same result as before this feature: the code for the signed-in account (once).",
        "parameters": [
          {
            "name": "pid-skip",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          },
          {
            "name": "f",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "To the wallet with the code"
          },
          "200": {
            "description": "Already continued / other device",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "not offered for this flow",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "next": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "unknown flow",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/wallet-backup.ashx?action=save&slot=codeb-wallet-migration": {
      "post": {
        "tags": [
          "wallet-backend"
        ],
        "operationId": "walletSlotSave",
        "summary": "Store (replace) the app's encrypted migration object",
        "description": "[ACCOUNT-APIS 2026-10-17] Named backup slot for the CodeB Wallet app, separate from the web wallet vault (which is unchanged). Keyed by account only (user + tenant, not the OIDC client), so the app and the web wallet never overwrite each other. The server stores the encrypted object as sent and never decrypts it. Same auth and limit as the vault (60 requests per user per hour across all backup actions). Body: a JWE (compact serialization, or the JSON serialization with ciphertext), at most 1 MB. Only the site's own sign-in access tokens issued to the wallet clients (aud codeb-admin or codeb-wallet-app); other clients and the narrow web-wallet session token get 403 client_not_allowed.",
        "security": [
          {
            "walletSessionToken": []
          },
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "slot",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "codeb-wallet-migration"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/jose": {
              "schema": {
                "type": "string"
              }
            },
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stored",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "slot": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "bytes": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "error: empty_body, not_jwe, invalid_slot",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Bearer missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "blob_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "client_not_allowed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wallet-backup.ashx?action=load&slot=codeb-wallet-migration": {
      "get": {
        "tags": [
          "wallet-backend"
        ],
        "operationId": "walletSlotLoad",
        "summary": "Read the app's encrypted migration object",
        "description": "[ACCOUNT-APIS 2026-10-17] Named backup slot for the CodeB Wallet app, separate from the web wallet vault (which is unchanged). Keyed by account only (user + tenant, not the OIDC client), so the app and the web wallet never overwrite each other. The server stores the encrypted object as sent and never decrypts it. Same auth and limit as the vault (60 requests per user per hour across all backup actions). Only the site's own sign-in access tokens issued to the wallet clients (aud codeb-admin or codeb-wallet-app); other clients and the narrow web-wallet session token get 403 client_not_allowed.",
        "security": [
          {
            "walletSessionToken": []
          },
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "slot",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "codeb-wallet-migration"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The stored object",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "slot": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "bytes": {
                      "type": "integer"
                    },
                    "jwe": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Bearer missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "client_not_allowed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wallet-backup.ashx?action=delete&slot=codeb-wallet-migration": {
      "post": {
        "tags": [
          "wallet-backend"
        ],
        "operationId": "walletSlotDelete",
        "summary": "Delete the app's migration object",
        "description": "[ACCOUNT-APIS 2026-10-17] Named backup slot for the CodeB Wallet app, separate from the web wallet vault (which is unchanged). Keyed by account only (user + tenant, not the OIDC client), so the app and the web wallet never overwrite each other. The server stores the encrypted object as sent and never decrypts it. Same auth and limit as the vault (60 requests per user per hour across all backup actions). Body {\"confirm\":\"delete\"}. Only the site's own sign-in access tokens issued to the wallet clients (aud codeb-admin or codeb-wallet-app); other clients and the narrow web-wallet session token get 403 client_not_allowed.",
        "security": [
          {
            "walletSessionToken": []
          },
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          },
          {
            "name": "slot",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "codeb-wallet-migration"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "confirm": {
                    "type": "string",
                    "enum": [
                      "delete"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deleted (existed tells whether there was one)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "slot": {
                      "type": "string"
                    },
                    "existed": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "confirm_required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Bearer missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "client_not_allowed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wallet-provider/nonce": {
      "post": {
        "tags": [
          "wallet-provider"
        ],
        "operationId": "nativeProviderNonce",
        "summary": "Single-use provider nonce (5 minutes)",
        "description": "[ACCOUNT-APIS 2026-10-17] Wallet Provider for the native CodeB Wallet app (Android), signed with its own key (x5c; published in /.well-known/wallet-provider.jwt under native_app_provider). No account needed. Runs on hosts listed in the server configuration (default phone.codeb.io); not certified. 32 random bytes, base64url. Limit per network per hour: 1200 (test-phase default, config.json walletProviderNoncesPerNetworkPerHour). [WPN-KEYATT 2026-10-18] supports (when switched on in the server configuration): android_challenge_key_attestation = the provider checks android.challengeKeyAttestation; android_key_attestation_only = it issues on that chain alone when the Play Integrity token is missing or not accepted.",
        "security": [],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "responses": {
          "200": {
            "description": "Nonce",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "nonce": {
                      "type": "string"
                    },
                    "supports": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "android_challenge_key_attestation",
                          "android_key_attestation_only"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wallet-provider/wallet-instance-attestation/jwk": {
      "post": {
        "tags": [
          "wallet-provider"
        ],
        "operationId": "nativeProviderWia",
        "summary": "Wallet Instance Attestation for an attested app key",
        "description": "[ACCOUNT-APIS 2026-10-17] Wallet Provider for the native CodeB Wallet app (Android), signed with its own key (x5c; published in /.well-known/wallet-provider.jwt under native_app_provider). No account needed. Runs on hosts listed in the server configuration (default phone.codeb.io); not certified. Checks: Android Key Attestation chain to a Google hardware attestation root, challenge = the provider nonce (its ASCII text or the 32 bytes it encodes), leaf key = the submitted key, package com.codeb.wallet with the Play signing certificate, TEE or StrongBox, verified boot, key generated in the hardware (imported keys refused), Google attestation revocation list; Play Integrity with requestHash = SHA-256(UTF-8(nonce) + RFC 7638 thumbprint of the first key) as base64url or hex, PLAY_RECOGNIZED, MEETS_DEVICE_INTEGRITY, 5 minutes. Limits per hour (test-phase defaults, config.json walletProviderMintsPerNetworkPerHour / walletProviderMintsPerKeyPerHour): 600 attestations per network, 120 per key. Result: oauth-client-attestation+jwt, 1 hour, sub codeb-wallet-app, cnf.jwk, wallet_name, wallet_version, wallet_link, wallet_solution_certification_information \"not certified\", client_status (status list /wallet-provider/status/wia, 90 days). Test builds signed with the upload certificate (only when the server allows them) carry codeb_test_build: true. [WPN-KEYATT 2026-10-18] Without Play Integrity: android.challengeKeyAttestation = Android Key Attestation chain (leaf first) of a fresh EC P-256 signing key whose attestationChallenge is the 32 raw bytes of SHA-256(UTF-8(nonce + RFC 7638 thumbprint of the first key)). Checked strictly on its own: Google root, revocation list for every certificate, TEE or StrongBox (both levels), locked and verified boot (other operating systems with self-signed boot are not supported), attestation version >= 3 (both chains), key generated in the hardware, package com.codeb.wallet with exactly the Play signing certificate (both chains), OS / vendor patch level not older than 12 months (configurable; 403 outdated), same verified-boot key and state as the first key chain; without a passing Play token also a remotely provisioned attestation key (certificate valid <= 90 days). Play token passes: issued (a failing challenge chain is ignored). Token missing or not accepted: issued on the challenge chain when key-only is on, else 403 challenge_attestation_failed (chain sent) or integrity_failed. The result carries codeb_device_integrity: play_integrity | key_attestation. [WPN-MINVER 2026-10-18] When the server sets a minimum CodeB Wallet version (walletProviderMinAppVersionCode, off by default), the version comes from the accepted Play Integrity verdict (appIntegrity.versionCode) and / or the fresh challenge key (attestationApplicationId), the lower one counting; too old or unknown -> 426 app_update_required (temporary for the app, never 403). [QA-1018] Without a passing Play token the wallet key chain must also come from a remotely provisioned attestation key; when the server does not check challenge chains, a sent chain is ignored. Play Integrity not set up on the server -> 503 integrity_unavailable.",
        "security": [],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jwk": {
                    "type": "object"
                  },
                  "android": {
                    "type": "object",
                    "properties": {
                      "keyAttestation": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "playIntegrityToken": {
                        "type": "string",
                        "description": "optional when the nonce answer lists android_key_attestation_only and a challenge chain is sent"
                      },
                      "nonce": {
                        "type": "string"
                      },
                      "challengeKeyAttestation": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "Android Key Attestation chain of a fresh key, challenge = raw request hash (see description)"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Attestation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "walletInstanceAttestation": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, invalid_nonce",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "attestation_failed, integrity_failed, instance_revoked, device_revoked, key_storage_revoked, challenge_attestation_failed, outdated / wallet_revoked: this wallet instance was revoked (by its holder or the provider)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Content-Type must be application/json",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "integrity_unavailable (Play Integrity not configured)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "426": {
            "description": "app_update_required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wallet-provider/key-attestation/jwk-set": {
      "post": {
        "tags": [
          "wallet-provider"
        ],
        "operationId": "nativeProviderKeyAttestation",
        "summary": "Key attestation for 1 to 10 attested app keys",
        "description": "[ACCOUNT-APIS 2026-10-17] Wallet Provider for the native CodeB Wallet app (Android), signed with its own key (x5c; published in /.well-known/wallet-provider.jwt under native_app_provider). No account needed. Runs on hosts listed in the server configuration (default phone.codeb.io); not certified. Checks: Android Key Attestation chain to a Google hardware attestation root, challenge = the provider nonce (its ASCII text or the 32 bytes it encodes), leaf key = the submitted key, package com.codeb.wallet with the Play signing certificate, TEE or StrongBox, verified boot, key generated in the hardware (imported keys refused), Google attestation revocation list; Play Integrity with requestHash = SHA-256(UTF-8(nonce) + RFC 7638 thumbprint of the first key) as base64url or hex, PLAY_RECOGNIZED, MEETS_DEVICE_INTEGRITY, 5 minutes. Limits per hour (test-phase defaults, config.json walletProviderMintsPerNetworkPerHour / walletProviderMintsPerKeyPerHour): 600 attestations per network, 120 per key. One chain per key; the weakest key decides key_storage (android_tee or android_strongbox: only what the chain proves, no ISO 18045 level). Result: key-attestation+jwt (OpenID4VCI 1.0 appendix D), 31 days, attested_keys, key_storage, nonce (the issuer c_nonce when given), key_storage_status (status list /wallet-provider/status/ks). [WPN-KEYATT 2026-10-18] Without Play Integrity: android.challengeKeyAttestation = Android Key Attestation chain (leaf first) of a fresh EC P-256 signing key whose attestationChallenge is the 32 raw bytes of SHA-256(UTF-8(nonce + RFC 7638 thumbprint of the first key)). Checked strictly on its own: Google root, revocation list for every certificate, TEE or StrongBox (both levels), locked and verified boot (other operating systems with self-signed boot are not supported), attestation version >= 3 (both chains), key generated in the hardware, package com.codeb.wallet with exactly the Play signing certificate (both chains), OS / vendor patch level not older than 12 months (configurable; 403 outdated), same verified-boot key and state as the first key chain; without a passing Play token also a remotely provisioned attestation key (certificate valid <= 90 days). Play token passes: issued (a failing challenge chain is ignored). Token missing or not accepted: issued on the challenge chain when key-only is on, else 403 challenge_attestation_failed (chain sent) or integrity_failed. The result carries codeb_device_integrity: play_integrity | key_attestation. [WPN-MINVER 2026-10-18] When the server sets a minimum CodeB Wallet version (walletProviderMinAppVersionCode, off by default), the version comes from the accepted Play Integrity verdict (appIntegrity.versionCode) and / or the fresh challenge key (attestationApplicationId), the lower one counting; too old or unknown -> 426 app_update_required (temporary for the app, never 403). [QA-1018] Without a passing Play token the wallet key chain must also come from a remotely provisioned attestation key; when the server does not check challenge chains, a sent chain is ignored. Play Integrity not set up on the server -> 503 integrity_unavailable.",
        "security": [],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "nonce": {
                    "type": "string"
                  },
                  "jwkSet": {
                    "type": "object"
                  },
                  "android": {
                    "type": "object",
                    "properties": {
                      "keyAttestations": {
                        "type": "array",
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "playIntegrityToken": {
                        "type": "string",
                        "description": "optional when the nonce answer lists android_key_attestation_only and a challenge chain is sent"
                      },
                      "providerNonce": {
                        "type": "string"
                      },
                      "challengeKeyAttestation": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "Android Key Attestation chain of a fresh key, challenge = raw request hash (see description)"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Attestation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "keyAttestation": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, invalid_nonce",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "attestation_failed, integrity_failed, instance_revoked, device_revoked, key_storage_revoked, challenge_attestation_failed, outdated / wallet_revoked: this wallet instance was revoked (by its holder or the provider)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Content-Type must be application/json",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "integrity_unavailable (Play Integrity not configured)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "426": {
            "description": "app_update_required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wallet-provider/status/wia": {
      "get": {
        "tags": [
          "wallet-provider"
        ],
        "operationId": "nativeProviderStatusWIA",
        "summary": "Status list token: wallet instances (client_status)",
        "description": "[ACCOUNT-APIS 2026-10-17] Wallet Provider for the native CodeB Wallet app (Android), signed with its own key (x5c; published in /.well-known/wallet-provider.jwt under native_app_provider). No account needed. Runs on hosts listed in the server configuration (default phone.codeb.io); not certified. draft-ietf-oauth-status-list, 1 bit per entry, revoked = 1. Public, cache 5 minutes.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "responses": {
          "200": {
            "description": "statuslist+jwt",
            "content": {
              "application/statuslist+jwt": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/wallet-provider/status/ks": {
      "get": {
        "tags": [
          "wallet-provider"
        ],
        "operationId": "nativeProviderStatusKS",
        "summary": "Status list token: key storage types (index 0 android_tee, 1 android_strongbox)",
        "description": "[ACCOUNT-APIS 2026-10-17] Wallet Provider for the native CodeB Wallet app (Android), signed with its own key (x5c; published in /.well-known/wallet-provider.jwt under native_app_provider). No account needed. Runs on hosts listed in the server configuration (default phone.codeb.io); not certified. draft-ietf-oauth-status-list, 1 bit per entry, revoked = 1. Public, cache 5 minutes.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "responses": {
          "200": {
            "description": "statuslist+jwt",
            "content": {
              "application/statuslist+jwt": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/wallet-provider/revoke": {
      "post": {
        "tags": [
          "wallet-provider"
        ],
        "operationId": "nativeProviderRevoke",
        "summary": "Revoke or restore a wallet instance or a key storage type",
        "description": "[ACCOUNT-APIS 2026-10-17] Wallet Provider for the native CodeB Wallet app (Android), signed with its own key (x5c; published in /.well-known/wallet-provider.jwt under native_app_provider). No account needed. Runs on hosts listed in the server configuration (default phone.codeb.io); not certified. Admin bearer (role admin or superuser). Body {\"instance\":\"<RFC 7638 thumbprint of the instance key>\"} or {\"device\":\"<SHA-256 hex of the attestation chain's first intermediate key>\"} or {\"key_storage\":\"android_tee|android_strongbox\"}, optional \"revoked\": false to restore.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "list": {
                      "type": "string"
                    },
                    "idx": {
                      "type": "integer"
                    },
                    "revoked": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?signin-cards": {
      "get": {
        "tags": [
          "eu-wallet-issuer"
        ],
        "operationId": "signinCardsList",
        "summary": "The signed-in member's sign-in cards",
        "description": "[SIGNIN-CARD 2026-10-17] The CodeB sign-in card (credential type urn:aloaha:vc:site-login) a signed-in member adds to a wallet with POST /vci.ashx?self-offer {\"vct\":\"urn:aloaha:vc:site-login\"} and presents at /logineu.html?card=1 (GET /oidc.ashx?action=vp-start&query=signin-card) to sign in to the same account. Possession factor bound to the wallet key; not an identity check. At most 10 active cards per account (409 too_many_signin_cards). Bearer = the member's access token.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "member",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "responses": {
          "200": {
            "description": "Cards, newest first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "cards": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "created_utc": {
                            "type": "string"
                          },
                          "collected": {
                            "type": "boolean"
                          },
                          "revoked": {
                            "type": "boolean"
                          },
                          "expired_uncollected": {
                            "type": "boolean"
                          },
                          "active": {
                            "type": "boolean"
                          }
                        }
                      }
                    },
                    "max_active": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "invalid_token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?signin-card-revoke": {
      "post": {
        "tags": [
          "eu-wallet-issuer"
        ],
        "operationId": "signinCardRevoke",
        "summary": "Revoke one of the member's sign-in cards",
        "description": "[SIGNIN-CARD 2026-10-17] The CodeB sign-in card (credential type urn:aloaha:vc:site-login) a signed-in member adds to a wallet with POST /vci.ashx?self-offer {\"vct\":\"urn:aloaha:vc:site-login\"} and presents at /logineu.html?card=1 (GET /oidc.ashx?action=vp-start&query=signin-card) to sign in to the same account. Possession factor bound to the wallet key; not an identity check. At most 10 active cards per account (409 too_many_signin_cards). Bearer = the member's access token. Revokes the card's offer, its refresh copies and their status-list entries; the card no longer signs in.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "member",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "64 hex, from the list"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Revoked",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "id": {
                      "type": "string"
                    },
                    "revoked": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "invalid_token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found (not the caller's card)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "status_list_write_failed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/card-rollout.ashx?p=nonce": {
      "post": {
        "tags": [
          "smartcard-rollout"
        ],
        "operationId": "gidsNonce",
        "summary": "KSP: single-use nonce for the proof of possession",
        "description": "Valid 5 minutes, bound to the signed-in user. Bearer access token of the site's own sign-in (aud codeb-admin or codeb-wallet-app), checked by introspection. The feature is off until an administrator switches it on (403 feature_off). Test use; not certified.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "user",
        "parameters": [
          {
            "name": "p",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "nonce": {
                      "type": "string"
                    },
                    "expires_in": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "feature_off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "too_many_requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [],
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/card-rollout.ashx?p=start": {
      "post": {
        "tags": [
          "smartcard-rollout"
        ],
        "operationId": "gidsStart",
        "summary": "KSP: start the hand-over of a certificate to CodeB Wallet",
        "description": "The KSP proves it holds the certificate's key: pop = signature of the container key over ASCII \"CodeB-KSP-rollout\" || nonce || SHA-256(certificate DER); RSA PKCS#1 v1.5 or PSS with SHA-256, ECDSA P-256 / P-384 with SHA-256 as r||s (as CNG signs) or DER. End-entity certificates with digital signature only; RSA 2048-4096, EC P-256 / P-384. At most 3 open hand-overs per user; each ends after 10 minutes. The answer's phone_link carries the pickup code in the URL fragment; the KSP shows it as a QR code. Bearer access token of the site's own sign-in (aud codeb-admin or codeb-wallet-app), checked by introspection. The feature is off until an administrator switches it on (403 feature_off). Test use; not certified. Ownership (owner rule): the certificate's SAN UPN must equal the signed-in account's login name; a certificate without UPN must carry an RFC 822 e-mail equal to the account's verified e-mail (from userinfo). No other fallback (403 not_your_certificate).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "user",
        "parameters": [
          {
            "name": "p",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rollout_id": {
                      "type": "string"
                    },
                    "pickup_code": {
                      "type": "string"
                    },
                    "phone_link": {
                      "type": "string",
                      "format": "uri"
                    },
                    "expires_utc": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "waiting_phone",
                        "ready_for_key",
                        "ready_for_phone",
                        "collected",
                        "done",
                        "failed",
                        "expired",
                        "cancelled"
                      ]
                    },
                    "ksp_secret": {
                      "type": "string",
                      "description": "Only for the KSP: required on status (header X-CodeB-Rollout-Secret) and deliver. Never shown to the phone."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "400": {
            "description": "invalid_certificate / certificate_expired / unsupported_key / invalid_nonce / invalid_proof",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "feature_off / not_your_certificate",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "too_many_open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "certificate",
                  "nonce",
                  "pop"
                ],
                "properties": {
                  "certificate": {
                    "type": "string",
                    "description": "DER, base64url"
                  },
                  "nonce": {
                    "type": "string"
                  },
                  "pop": {
                    "type": "string",
                    "description": "base64url"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/card-rollout.ashx?p=status": {
      "get": {
        "tags": [
          "smartcard-rollout"
        ],
        "operationId": "gidsStatus",
        "summary": "KSP: state of its hand-over; the phone's attested wrapping key",
        "description": "From ready_for_key on, wrapping_key carries the RSA public key (SubjectPublicKeyInfo DER, base64url), key_storage (android_strongbox / android_tee) and the Android key attestation chain, so the KSP can verify it itself before it wraps the key. Bearer access token of the site's own sign-in (aud codeb-admin or codeb-wallet-app), checked by introspection. The feature is off until an administrator switches it on (403 feature_off). Test use; not certified. The KSP must verify the key chain itself (Google root, the challenge it computes from rollout_id and pickup code, CodeB Wallet package and signature, verified boot, purpose WRAP_KEY, origin generated, leaf key = spki) and should show the wrapping key's fingerprint for the user to compare with the phone.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "user",
        "parameters": [
          {
            "name": "p",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-CodeB-Rollout-Secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ksp_secret from start"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rollout_id": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "waiting_phone",
                        "ready_for_key",
                        "ready_for_phone",
                        "collected",
                        "done",
                        "failed",
                        "expired",
                        "cancelled"
                      ]
                    },
                    "expires_utc": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "wrapping_key": {
                      "type": "object",
                      "properties": {
                        "spki": {
                          "type": "string"
                        },
                        "key_storage": {
                          "type": "string"
                        },
                        "key_chain": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/card-rollout.ashx?p=deliver": {
      "post": {
        "tags": [
          "smartcard-rollout"
        ],
        "operationId": "gidsDeliver",
        "summary": "KSP: deliver the key wrapped for the phone",
        "description": "wrapped_key: Android SecureKeyWrapper (DER, base64url, at most 16 KB) built by the KSP for the phone's attested wrapping key. The server cannot read it and keeps it only until the phone collects it. Bearer access token of the site's own sign-in (aud codeb-admin or codeb-wallet-app), checked by introspection. The feature is off until an administrator switches it on (403 feature_off). Test use; not certified.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "user",
        "parameters": [
          {
            "name": "p",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "400": {
            "description": "invalid_wrapped_key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "wrong_state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "rollout_id",
                  "wrapped_key",
                  "ksp_secret"
                ],
                "properties": {
                  "rollout_id": {
                    "type": "string"
                  },
                  "wrapped_key": {
                    "type": "string"
                  },
                  "ksp_secret": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/card-rollout.ashx?p=info": {
      "post": {
        "tags": [
          "smartcard-rollout"
        ],
        "operationId": "gidsInfo",
        "summary": "Wallet: what is handed over, and the attestation challenge",
        "description": "The wallet must be signed in as the same account. attestation_challenge = SHA-256(\"CodeB-GIDS-wrap\" \\n rollout_id \\n code), base64url. Bearer access token of the site's own sign-in (aud codeb-admin or codeb-wallet-app), checked by introspection. The feature is off until an administrator switches it on (403 feature_off). Test use; not certified.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "user",
        "parameters": [
          {
            "name": "p",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "rollout_id",
                  "code"
                ],
                "properties": {
                  "rollout_id": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/card-rollout.ashx?p=wrapping-key": {
      "post": {
        "tags": [
          "smartcard-rollout"
        ],
        "operationId": "gidsWrappingKey",
        "summary": "Wallet: the attested RSA wrapping key",
        "description": "keyChain: Android key attestation certificates (base64url, leaf first) of an RSA >= 2048 key with purpose WRAP_KEY in StrongBox or TEE, created with the challenge from p=info; the same checks as the wallet relay (key generated in the hardware, Google root, revocation, verified boot, CodeB Wallet package and signature). Bearer access token of the site's own sign-in (aud codeb-admin or codeb-wallet-app), checked by introspection. The feature is off until an administrator switches it on (403 feature_off). Test use; not certified. Optional playIntegrityToken: requestHash = SHA-256(\"codeb-emrtd-relay|1|gids-wrap|\" + base64url(challenge) + \"|\" + base64url(SHA-256(leaf certificate))), required when the site requires Play Integrity. The app should compute the challenge itself from rollout_id and code.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "user",
        "parameters": [
          {
            "name": "p",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "400": {
            "description": "attestation_failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "wrong_state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "rollout_id",
                  "code",
                  "keyChain"
                ],
                "properties": {
                  "rollout_id": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  },
                  "keyChain": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "playIntegrityToken": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/card-rollout.ashx?p=collect": {
      "post": {
        "tags": [
          "smartcard-rollout"
        ],
        "operationId": "gidsCollect",
        "summary": "Wallet: collect the wrapped key and the certificate (once)",
        "description": " Bearer access token of the site's own sign-in (aud codeb-admin or codeb-wallet-app), checked by introspection. The feature is off until an administrator switches it on (403 feature_off). Test use; not certified.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "user",
        "parameters": [
          {
            "name": "p",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rollout_id": {
                      "type": "string"
                    },
                    "wrapped_key": {
                      "type": "string"
                    },
                    "certificate": {
                      "type": "string"
                    },
                    "key_alg": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "not_ready / wrong_state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "rollout_id",
                  "code"
                ],
                "properties": {
                  "rollout_id": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/card-rollout.ashx?p=done": {
      "post": {
        "tags": [
          "smartcard-rollout"
        ],
        "operationId": "gidsDone",
        "summary": "Wallet: report the import; the server deletes the wrapped key",
        "description": " Bearer access token of the site's own sign-in (aud codeb-admin or codeb-wallet-app), checked by introspection. The feature is off until an administrator switches it on (403 feature_off). Test use; not certified.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "user",
        "parameters": [
          {
            "name": "p",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "wrong_state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "rollout_id",
                  "code",
                  "ok"
                ],
                "properties": {
                  "rollout_id": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  },
                  "ok": {
                    "type": "boolean"
                  },
                  "reason": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/card-rollout.ashx?p=admin-list": {
      "get": {
        "tags": [
          "smartcard-rollout"
        ],
        "operationId": "gidsAdminList",
        "summary": "Admin: switch state and every hand-over (no key material)",
        "description": "Newest first. Bearer access token of the site's own sign-in (aud codeb-admin or codeb-wallet-app), checked by introspection. The feature is off until an administrator switches it on (403 feature_off). Test use; not certified.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "p",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean"
                    },
                    "rollouts": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/card-rollout.ashx?p=admin-policy": {
      "post": {
        "tags": [
          "smartcard-rollout"
        ],
        "operationId": "gidsAdminPolicy",
        "summary": "Admin: switch the hand-over and / or PKI cards on or off for this site",
        "description": " Bearer access token of the site's own sign-in (aud codeb-admin or codeb-wallet-app), checked by introspection. The feature is off until an administrator switches it on (403 feature_off). Test use; not certified.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "p",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "description": "Hand-over of Windows certificates to phones."
                  },
                  "empty_cards": {
                    "type": "boolean",
                    "description": "Issuing PKI cards (read/write and read-only) on this site."
                  }
                },
                "minProperties": 1
              }
            }
          }
        }
      }
    },
    "/card-rollout.ashx?p=admin-cancel": {
      "post": {
        "tags": [
          "smartcard-rollout"
        ],
        "operationId": "gidsAdminCancel",
        "summary": "Admin: cancel an open hand-over (deletes the wrapped key)",
        "description": " Bearer access token of the site's own sign-in (aud codeb-admin or codeb-wallet-app), checked by introspection. The feature is off until an administrator switches it on (403 feature_off). Test use; not certified.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "p",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "400": {
            "description": "invalid_id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "wrong_state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx?smartcard-offer": {
      "post": {
        "tags": [
          "pki-cards"
        ],
        "operationId": "vciPkiCardOffer",
        "summary": "Issue an empty PKI card to a member",
        "description": "Offers one PKI card to a member, either straight into the CodeB Wallet linked to the member's account (invite wallet: the wallet-provider inbox; only that linked wallet can redeem it, with this site's own wallet attestation) or as a sign-in invitation (invite signin): card_type gids = read/write PKI card (mdoc io.codeb.pkicard.rw.1 + SD-JWT VC https://<host>/vc/pkicard-rw/1.0; Windows enrols the certificate onto the phone), piv = read-only PKI card (io.codeb.pkicard.ro.1 + /vc/pkicard-ro/1.0; the CodeB PC software sets it up once). Collected once (by the linked wallet, or by the member signing in), with a hardware key attestation; no refresh token; status list entry for revocation (?revoke-offer). The server makes the card's admin / management key (and the read-only card's PUK); the wallet fetches them once through /vci.ashx/card-secrets. Off until an administrator switches PKI cards on (card-rollout.ashx?p=admin-policy {empty_cards:true}); 403 feature_off otherwise. Tested in closed groups. Admin auth: OIDC bearer with role admin (checked by introspection), or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'vci-smartcard-offer|' + Host).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "smartcard-offer",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user",
                  "card_type"
                ],
                "properties": {
                  "user": {
                    "type": "string",
                    "description": "Login of an enabled account on this site."
                  },
                  "card_type": {
                    "type": "string",
                    "enum": [
                      "gids",
                      "piv"
                    ],
                    "description": "gids = read/write PKI card, piv = read-only PKI card."
                  },
                  "valid_from": {
                    "type": "string",
                    "format": "date-time",
                    "description": "ISO 8601; default now, never back-dated, at most 90 days ahead."
                  },
                  "valid_until": {
                    "type": "string",
                    "format": "date-time",
                    "description": "ISO 8601; or use days."
                  },
                  "days": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1096,
                    "default": 365
                  },
                  "invite_days": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 30,
                    "default": 14
                  },
                  "invite": {
                    "type": "string",
                    "enum": [
                      "wallet",
                      "signin"
                    ],
                    "default": "signin",
                    "description": "wallet = straight into the CodeB Wallet(s) linked to the member's account (no link, no QR code); signin = sign-in invitation. Never a one-time link."
                  },
                  "email": {
                    "type": "boolean",
                    "description": "E-mail the invitation (or, with invite wallet, a notice with the link that only the linked wallet can use) to the member."
                  },
                  "fallback": {
                    "type": "string",
                    "enum": [
                      "signin",
                      "none"
                    ],
                    "default": "signin",
                    "description": "With invite wallet and no linked wallet: signin = make a sign-in invitation instead (delivery_fallback in the answer); none = 409 no_linked_wallet."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Card offered",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "offer_id": {
                      "type": "string"
                    },
                    "user": {
                      "type": "string"
                    },
                    "vct": {
                      "type": "string"
                    },
                    "doctype": {
                      "type": "string",
                      "enum": [
                        "io.codeb.pkicard.rw.1",
                        "io.codeb.pkicard.ro.1"
                      ]
                    },
                    "expires_utc": {
                      "type": "string",
                      "format": "date-time",
                      "description": "End of the invitation (never after the card's end)."
                    },
                    "invite": {
                      "type": "string",
                      "enum": [
                        "wallet",
                        "signin"
                      ]
                    },
                    "claims": {
                      "type": "object",
                      "description": "The card claims as issued (mdoc namespace = doctype, SD-JWT VC https://<host>/vc/pkicard-rw/1.0 or /vc/pkicard-ro/1.0). Secrets are never claims.",
                      "properties": {
                        "card_type": {
                          "type": "string",
                          "enum": [
                            "gids",
                            "piv"
                          ]
                        },
                        "card_id": {
                          "type": "string",
                          "pattern": "^[0-9a-f]{32}$",
                          "description": "The card's card_id claim (32 hex digits)."
                        },
                        "holder_login": {
                          "type": "string"
                        },
                        "valid_from": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "valid_until": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "admin_key_ref": {
                          "type": "string",
                          "description": "Opaque reference, never the key."
                        }
                      }
                    },
                    "offer_uri": {
                      "type": "string",
                      "format": "uri"
                    },
                    "deep_link": {
                      "type": "string"
                    },
                    "web_link": {
                      "type": "string",
                      "format": "uri"
                    },
                    "email": {
                      "type": "object",
                      "properties": {
                        "sent": {
                          "type": "boolean"
                        },
                        "to": {
                          "type": "string"
                        },
                        "reason": {
                          "type": "string"
                        }
                      }
                    },
                    "collect": {
                      "type": "string"
                    },
                    "delivery": {
                      "type": "string",
                      "const": "wallet",
                      "description": "Present when the card was put into the wallet inbox."
                    },
                    "delivered_to": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Device names of the linked wallets."
                    },
                    "delivered_count": {
                      "type": "integer"
                    },
                    "delivery_warning": {
                      "type": "string"
                    },
                    "delivery_fallback": {
                      "type": "string",
                      "description": "The member has no linked wallet: a sign-in invitation was made instead."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_json / invalid_user / user_disabled / invalid_access_card / invalid_days / invalid_request / status_list_off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "user_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error (the issuer cannot sign under its IACA at the moment)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "feature_off (PKI cards are switched off on this site)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "no_linked_wallet (invite wallet, fallback none)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable: the wallet store could not be read"
          }
        }
      }
    },
    "/vci.ashx?smartcards": {
      "get": {
        "tags": [
          "pki-cards"
        ],
        "operationId": "vciPkiCards",
        "summary": "List the PKI cards of this site",
        "description": "Every PKI card offer (at most 5000) with its claims, state (collected, delivered, certificate serial + issuer when the phone reported them) and revocation. Admin auth: OIDC bearer with role admin (checked by introspection), or X-CodeB-Admin-Signature = hex HMAC-SHA256(AdminSharedSecret, 'vci-smartcard-list|' + Host).",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "smartcards",
            "in": "query",
            "required": true,
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            },
            "description": "Selector flag (present, value ignored)."
          }
        ],
        "responses": {
          "200": {
            "description": "Cards",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "cards": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "offer_id": {
                            "type": "string"
                          },
                          "user": {
                            "type": "string"
                          },
                          "created_utc": {
                            "type": "string"
                          },
                          "issued": {
                            "type": "boolean"
                          },
                          "invite_expires_utc": {
                            "type": "string"
                          },
                          "revoked": {
                            "type": "boolean"
                          },
                          "revoked_reason": {
                            "type": "string"
                          },
                          "card_type": {
                            "type": "string",
                            "enum": [
                              "gids",
                              "piv"
                            ]
                          },
                          "card_id": {
                            "type": "string",
                            "pattern": "^[0-9a-f]{32}$",
                            "description": "The card's card_id claim (32 hex digits)."
                          },
                          "valid_from": {
                            "type": "string"
                          },
                          "valid_until": {
                            "type": "string"
                          },
                          "state": {
                            "type": "object",
                            "description": "Collection / delivery state and the reported certificate (serial, issuer); never a secret."
                          },
                          "last_error": {
                            "type": "string"
                          },
                          "invite": {
                            "type": "string",
                            "enum": [
                              "wallet",
                              "signin"
                            ]
                          },
                          "wallet_delivery": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "description": "invite wallet: per linked wallet {wallet (8 hex), device_name, state waiting|accepted|declined|collected|collected_elsewhere|withdrawn, state_utc, seen_utc (first time the app fetched it)}.",
                            "items": {
                              "type": "object"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx/card-secrets": {
      "post": {
        "tags": [
          "pki-cards"
        ],
        "operationId": "vciPkiCardSecrets",
        "security": [],
        "summary": "Wallet: the card's admin / management key (+ read-only card PUK), once",
        "description": "Authorised by a DPoP proof (htm POST; the server checks htu as https://<host>/vci.ashx?card-secrets, the normalised form of this path) of the wallet key that COLLECTED the card, within 24 hours of the collection; no access token. Body {card_id, epk}: epk is a one-time P-256 public JWK; the answer is a JWE (ECDH-ES + A256GCM) to that key, delivered once (409 already_delivered afterwards). When the proof carries epk_jkt (RFC 7638 thumbprint), it must match body.epk, else 401 invalid_dpop_proof. Revocation is re-checked right before delivery.",
        "parameters": [
          {
            "name": "DPoP",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "card_id",
                  "epk"
                ],
                "properties": {
                  "card_id": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{32}$",
                    "description": "The card's card_id claim (32 hex digits)."
                  },
                  "epk": {
                    "type": "object",
                    "description": "One-time EC P-256 public JWK."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JWE compact (application/jwt) with {card_id, card_type, admin_key | management_key, puk (read-only card)}",
            "content": {
              "application/jwt": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request / invalid_json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "invalid_dpop_proof",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "not_collected / no_holder_key / already_delivered",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "delivery_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/card-rollout.ashx?p=card-key": {
      "post": {
        "tags": [
          "pki-cards"
        ],
        "operationId": "pkiCardKey",
        "summary": "PC software: the read-only PKI card's management key for its own member",
        "description": "Bearer access token of the site's own sign-in; only the member the card was issued to, only for a read-only PKI card (piv), only while it is usable. Owner reads are capped and logged. Used by the CodeB PC software for the one-time set-up of the card (GENERATE, CSR, PUT DATA).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "user",
        "parameters": [
          {
            "name": "p",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "card_id"
                ],
                "properties": {
                  "card_id": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{32}$",
                    "description": "The card's card_id claim (32 hex digits)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "card_id": {
                      "type": "string",
                      "pattern": "^[0-9a-f]{32}$",
                      "description": "The card's card_id claim (32 hex digits)."
                    },
                    "card_type": {
                      "type": "string"
                    },
                    "management_key": {
                      "type": "string",
                      "description": "base64url, 24 bytes"
                    },
                    "management_key_hex": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "feature_off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "card not usable (revoked, ended, not yet valid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "slow_down / too many reads",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/card-rollout.ashx?p=card-cert": {
      "post": {
        "tags": [
          "pki-cards"
        ],
        "operationId": "pkiCardCert",
        "summary": "Report the certificate written onto a PKI card (serial + issuer only)",
        "description": "Bearer access token of the card's member. Stores only the certificate serial number and issuer (shown to the administrator); never the certificate's other content.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "user",
        "parameters": [
          {
            "name": "p",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "card_id",
                  "serial",
                  "issuer"
                ],
                "properties": {
                  "card_id": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{32}$",
                    "description": "The card's card_id claim (32 hex digits)."
                  },
                  "serial": {
                    "type": "string"
                  },
                  "issuer": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "card_id": {
                      "type": "string",
                      "pattern": "^[0-9a-f]{32}$",
                      "description": "The card's card_id claim (32 hex digits)."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "card not usable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/card-rollout.ashx?p=admin-card-secret": {
      "post": {
        "tags": [
          "pki-cards"
        ],
        "operationId": "pkiAdminCardSecret",
        "summary": "Admin: read a PKI card's admin / management key or the read-only card's PUK",
        "description": "Bearer access token with role admin. what: admin_key (read/write card: admin key; read-only card: management key) or puk (read-only card). Every read is logged and kept in the card's log.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "p",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "card_id",
                  "what"
                ],
                "properties": {
                  "card_id": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{32}$",
                    "description": "The card's card_id claim (32 hex digits)."
                  },
                  "what": {
                    "type": "string",
                    "enum": [
                      "admin_key",
                      "puk"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "card_id": {
                      "type": "string",
                      "pattern": "^[0-9a-f]{32}$",
                      "description": "The card's card_id claim (32 hex digits)."
                    },
                    "card_type": {
                      "type": "string"
                    },
                    "admin_key": {
                      "type": "string",
                      "description": "read/write card, base64url"
                    },
                    "admin_key_hex": {
                      "type": "string"
                    },
                    "management_key": {
                      "type": "string",
                      "description": "read-only card, base64url"
                    },
                    "management_key_hex": {
                      "type": "string"
                    },
                    "puk": {
                      "type": "string",
                      "description": "read-only card, what=puk"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx/access-pkoc": {
      "post": {
        "tags": [
          "eu-wallet-issuer"
        ],
        "operationId": "vciAccessPkoc",
        "security": [],
        "summary": "Wallet: register the PKOC key of an access card",
        "description": "DPoP proof of the wallet key that collected the access card, within 24 hours of the collection. Body {credential_id, pkoc_public_key, pkoc_key_chain[]}; the key must be generated in hardware and attested for the challenge SHA-256('CodeB-PKOC\\n' + credential_id). 200 also when the same key is sent again; 409 already_set (the card ID never changes).",
        "parameters": [
          {
            "name": "DPoP",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "credential_id",
                  "pkoc_public_key",
                  "pkoc_key_chain"
                ],
                "properties": {
                  "credential_id": {
                    "type": "string"
                  },
                  "pkoc_public_key": {
                    "type": "string"
                  },
                  "pkoc_key_chain": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK (also when the same key is sent again)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_request / invalid_key_chain",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "invalid_dpop_proof",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "card_revoked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "already_set",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "too_late",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vci.ashx/card-signing-key": {
      "post": {
        "tags": [
          "pki-cards"
        ],
        "operationId": "vciPkiCardSigningKey",
        "security": [],
        "summary": "Wallet: the member's remote-signing key for the read-only PKI card (slot 9C), once",
        "description": "A read-only PKI card is never empty: right after the collection the wallet fetches the member's remote-signing credential (the server creates it when it does not exist yet) and imports it into the card's digital-signature slot (9C). Authorised by a DPoP proof (htm POST; htu https://<host>/vci.ashx?card-signing-key) of the wallet key that COLLECTED the card, within 24 hours of the collection; no access token. Body {card_id, wrapping_key, key_chain}: wrapping_key is the SPKI (DER, base64url) of an RSA key of at least 2048 bits with purpose WRAP_KEY in the phone's secure hardware; key_chain is its Android key attestation (leaf first) with challenge SHA-256(ASCII \"CodeB-SIGNKEY\\n\" + card_id + \"\\n\" + jkt), jkt = RFC 7638 thumbprint (base64url) of the DPoP key that collected the card and signs this call's proof. The answer carries wrapped_key, an Android SecureKeyWrapper (RSA-OAEP SHA-256 / MGF1 SHA-1 transport key, AES-256-GCM, PKCS#8 P-256 key, key description PURPOSE SIGN, DIGEST NONE + SHA-256, NO_AUTH_REQUIRED, UNLOCKED_DEVICE_REQUIRED) for KeyStore ImportWrappedKey. Delivered once per card (409 already_delivered afterwards). The server keeps its own copy of the key: it is the same key that signs remotely for this member. A self-signed certificate is shown by relying parties as an unknown signer; it is not a qualified or advanced certificate. Never the site-wide signing credential. The DPoP proof must carry wk_jkt = the RFC 7638 thumbprint (base64url) of the RSA wrapping key (members e, kty, n), else 400 invalid_request. After a 200 the card may ask again only with the same attested wrapping key, the same collecting key and while the member's certificate is unchanged (a lost answer): the key is wrapped again to that hardware key; anything else gives 409 already_delivered.",
        "parameters": [
          {
            "name": "DPoP",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "card_id",
                  "wrapping_key",
                  "key_chain"
                ],
                "properties": {
                  "card_id": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{32}$",
                    "description": "The card's card_id claim (32 hex digits); read-only cards only."
                  },
                  "wrapping_key": {
                    "type": "string",
                    "description": "SubjectPublicKeyInfo (DER, base64url) of the attested RSA wrapping key."
                  },
                  "key_chain": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Android key attestation certificates of the wrapping key (base64 / base64url DER, leaf first)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The certificate and the wrapped key (Cache-Control: no-store)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "card_id": {
                      "type": "string"
                    },
                    "slot": {
                      "type": "string",
                      "enum": [
                        "9C"
                      ]
                    },
                    "certificate": {
                      "type": "string",
                      "description": "Member's signing certificate, DER base64url"
                    },
                    "chain": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Issuer certificates (empty for a self-signed certificate)"
                    },
                    "wrapped_key": {
                      "type": "string",
                      "description": "SecureKeyWrapper DER, base64url"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_request / invalid_json / invalid_key_chain",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "invalid_dpop_proof",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "card_revoked / card_ended / not_collected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "method_not_allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "not_collected / no_holder_key / already_delivered / signing_key_not_exportable / no_member_credential / signing_key_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "delivery_expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/wrpac-ca.ashx?ca": {
      "get": {
        "tags": [
          "wrpac-ca"
        ],
        "operationId": "wrpacCaCert",
        "security": [],
        "summary": "CA certificate",
        "description": "DER (application/pkix-cert); &format=pem for PEM.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pkix-cert": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "not_found: no CA on this site yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/wrpac-ca.ashx?crl": {
      "get": {
        "tags": [
          "wrpac-ca"
        ],
        "operationId": "wrpacCrl",
        "security": [],
        "summary": "Certificate revocation list",
        "description": "DER CRL, rebuilt at once after every revocation and at least every 12 h; nextUpdate +24 h. With `ca=<SHA-256 prefix of a replaced CA, 16-64 hex>`: the final CRL that CA signed when it was replaced (all its certificates revoked, cessationOfOperation; nextUpdate = its notAfter); 404 when there is none.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pkix-crl": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "not_found: no CA on this site yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "ca",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{16,64}$"
            },
            "description": "SHA-256 prefix of a replaced CA: its final CRL"
          }
        ]
      }
    },
    "/wrpac-ca.ashx?info": {
      "get": {
        "tags": [
          "wrpac-ca"
        ],
        "operationId": "wrpacInfo",
        "security": [],
        "summary": "CA facts",
        "description": "Subject, SHA-256, key module and protection (software today), policy OIDs, whether the ETSI NCP-l-eudiwrp policy is asserted (false while the key is in software), CA / CRL / CPS URLs.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "not_found: no CA on this site yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/wrpac-ca.ashx?rps": {
      "get": {
        "tags": [
          "wrpac-ca"
        ],
        "operationId": "wrpacRegister",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "summary": "Admin: relying-party register",
        "description": "This site's register (not a national register) with certificate counts.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request / invalid_json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "conflict: registration not valid / no contact",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "ca_key_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/wrpac-ca.ashx?certs": {
      "get": {
        "tags": [
          "wrpac-ca"
        ],
        "operationId": "wrpacCerts",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "summary": "Admin: issued certificates",
        "description": "Optional &rp_id= filter.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request / invalid_json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "conflict: registration not valid / no contact",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "ca_key_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/wrpac-ca.ashx?rp": {
      "post": {
        "tags": [
          "wrpac-ca"
        ],
        "operationId": "wrpacRegisterSave",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "summary": "Admin: register or update a relying party",
        "description": "Fields per CIR (EU) 2025/848 Annex I. org_id: any identifier from an official record (VAT number, company number, LEI, ...; the ETSI EN 319 412-1 form such as VATMT-12345678 is recommended); country ISO 3166-1 alpha-2 (EL for Greece); at least one contact (support_url, email, phone). [WRPRC-OWN] Optional privacy_policy, info_uri and supervisory_email / supervisory_phone / supervisory_uri go into the registration certificate (ETSI TS 119 475 Table 7), where wallets find the contacts for deletion requests (support_uri) and for reports to the data protection authority (supervisory_authority). [WRP-INTERMEDIARY 2026-10-20] uses_intermediary (bool, Annex I point 14) + oidc_client_id (the relying party's OIDC client on this site's Relying Party Gateway; required with uses_intermediary, unique): wallet sign-ins through the gateway for that client then carry this relying party's own registration certificate (sub / name = the relying party; intermediary {sub, sname} and act.sub = this site, ETSI TS 119 475 Table 10 / GEN-5.2.4-09) under this site's access certificate (registrar codeb).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request / invalid_json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "conflict: registration not valid / no contact",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "ca_key_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "official_name",
                  "org_id",
                  "country"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "official_name": {
                    "type": "string"
                  },
                  "trade_name": {
                    "type": "string"
                  },
                  "org_id": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string"
                  },
                  "support_url": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "services": {
                    "type": "string"
                  },
                  "intended_use": {
                    "type": "string"
                  },
                  "public_body": {
                    "type": "boolean"
                  },
                  "entitlements": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "privacy_policy": {
                    "type": "string",
                    "description": "https URL of the privacy policy (registration certificate claim privacy_policy)"
                  },
                  "info_uri": {
                    "type": "string",
                    "description": "https URL with information about the relying party (info_uri)"
                  },
                  "supervisory_email": {
                    "type": "string",
                    "description": "data protection authority: e-mail (supervisory_authority.email)"
                  },
                  "supervisory_phone": {
                    "type": "string",
                    "description": "data protection authority: phone, international form (supervisory_authority.phone)"
                  },
                  "supervisory_uri": {
                    "type": "string",
                    "description": "data protection authority: https URL (supervisory_authority.uri)"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wrpac-ca.ashx?rp-status": {
      "post": {
        "tags": [
          "wrpac-ca"
        ],
        "operationId": "wrpacRegisterStatus",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "summary": "Admin: suspend, cancel or reactivate a registration",
        "description": "suspended / cancelled revokes all certificates of the relying party at once (TS 119 411-8 REV-6.3.9-04); a cancelled registration cannot be reactivated.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request / invalid_json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "conflict: registration not valid / no contact",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "ca_key_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "status"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "valid",
                      "suspended",
                      "cancelled"
                    ]
                  },
                  "reason": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wrpac-ca.ashx?issue": {
      "post": {
        "tags": [
          "wrpac-ca"
        ],
        "operationId": "wrpacIssue",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "summary": "Admin: issue an access certificate",
        "description": "From a PKCS#10 request (ECDSA P-256, proof of possession checked); only for a valid registration; content from the register; validity up to 825 days.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request / invalid_json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "conflict: registration not valid / no contact",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "ca_key_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "rp_id",
                  "csr"
                ],
                "properties": {
                  "rp_id": {
                    "type": "string"
                  },
                  "csr": {
                    "type": "string"
                  },
                  "days": {
                    "type": "integer"
                  },
                  "instance": {
                    "type": "string"
                  },
                  "dns": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wrpac-ca.ashx?issue-own-verifier": {
      "post": {
        "tags": [
          "wrpac-ca"
        ],
        "operationId": "wrpacIssueOwnVerifier",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "summary": "Admin: this site's verifier certificate",
        "description": "Key made and kept on the server; OpenID4VP sessions started with registrar=codeb sign their request objects with it (x509_hash client id).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request / invalid_json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "conflict: registration not valid / no contact",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "ca_key_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "rp_id"
                ],
                "properties": {
                  "rp_id": {
                    "type": "string"
                  },
                  "days": {
                    "type": "integer"
                  },
                  "dns": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wrpac-ca.ashx?revoke": {
      "post": {
        "tags": [
          "wrpac-ca"
        ],
        "operationId": "wrpacRevoke",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "summary": "Admin: revoke a certificate",
        "description": "Published in the CRL at once.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request / invalid_json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "conflict: registration not valid / no contact",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "ca_key_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "serial"
                ],
                "properties": {
                  "serial": {
                    "type": "string"
                  },
                  "reason": {
                    "type": "string",
                    "enum": [
                      "unspecified",
                      "keyCompromise",
                      "affiliationChanged",
                      "superseded",
                      "cessationOfOperation",
                      "privilegeWithdrawn"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wrpac-ca.ashx?settings": {
      "get": {
        "tags": [
          "wrpac-ca"
        ],
        "operationId": "wrpacSettingsGet",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "summary": "Admin: CA name settings",
        "description": "The operator's legal name, organisation identifier and country used in the CA certificate; locked (and the CA subject and its SHA-256 ca_sha256 shown) once the CA exists. can_replace_ca: true for a superuser when the CA exists and its key is a software key (POST ?replace-ca).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "wrpac-ca"
        ],
        "operationId": "wrpacSettingsSave",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "summary": "Admin: set the CA name (before the CA exists)",
        "description": "organization 1-64 characters; organization_identifier optional, any one-line identifier up to 64 characters (VAT number such as VATMT-12345678, company number, ...); country ISO 3166-1 alpha-2 (EL for Greece). 409 once the CA exists (its name is part of the CA certificate; a superuser can replace the CA with POST ?replace-ca). Takes precedence over Wrpac:CaOrganization / Wrpac:CaOrganizationIdentifier / Wrpac:CaCountry in web.config.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "organization",
                  "country"
                ],
                "properties": {
                  "organization": {
                    "type": "string"
                  },
                  "organization_identifier": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "conflict: the CA already exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/wallet-provider/revoke-self": {
      "post": {
        "tags": [
          "wallet-provider"
        ],
        "operationId": "nativeProviderRevokeSelf",
        "summary": "Holder: revoke this wallet from the phone (no account)",
        "description": "The app revokes its own wallet instance with a proof signed by the instance key. No sign-in. Wallet Provider of the native CodeB Wallet app (Android); runs on the hosts listed in the server configuration (default phone.codeb.io); designed to follow the wallet-unit revocation of ARF 3.0, not certified. Holder proof: compact JWS, protected header {alg: ES256, typ: wallet-revoke+jwt, jwk: the wallet instance public key (EC P-256, public members only)}; payload {aud: https://<host>/wallet-provider/<operation>, iat (within 300 s of the server time), jti (at least 16 random bytes, base64url, accepted once within 10 minutes), exp (optional)}. The instance id is the RFC 7638 thumbprint (base64url) of that key, the same id the wallet instance attestation is bound to. Extra payload claim reason: user_request (default) | lost | other. Effect: the instance's bit is set in the WIA status list; its wallet instance attestation and key attestation requests answer 403 {\"error\":\"wallet_revoked\"}; the issuer refuses PAR and token requests of that instance (403 wallet_revoked); the credentials this site issued to the instance since the issuer records the instance key are revoked in the issuer's status list (older ones cannot be matched and stay valid until they expire or the issuer revokes them). Idempotent: revoking again answers 200 with the first revoked_at. It cannot be undone by the holder. Limits: 30 per hour per network, body at most 16 KB, Content-Type application/json. The answer carries credentials_revoked: false when withdrawing the documents is still in progress (the server retries; my-wallets shows credentials_pending).",
        "security": [],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "proof": {
                    "type": "string",
                    "description": "compact JWS, see the description"
                  }
                },
                "required": [
                  "proof"
                ]
              },
              "example": {
                "proof": "eyJhbGciOiJFUzI1NiIsInR5cCI6IndhbGxldC1yZXZva2Urand0IiwiandrIjp7Imt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4IjoiLi4uIiwieSI6Ii4uLiJ9fQ.eyJhdWQiOiJodHRwczovL3Bob25lLmV4YW1wbGUuY29tL3dhbGxldC1wcm92aWRlci9yZXZva2Utc2VsZiIsImlhdCI6MTc5MjQyNDAwMCwianRpIjoiUTN3eF9KZ1BpbDF1N2Z0SzB2N2JNdyIsInJlYXNvbiI6Imxvc3QifQ.c2lnbmF0dXJl"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Revoked (or already revoked)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "revoked": {
                      "type": "boolean"
                    },
                    "instance": {
                      "type": "string",
                      "description": "RFC 7638 thumbprint of the instance key"
                    },
                    "revoked_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "credentials_revoked": {
                      "type": "boolean",
                      "description": "false when the documents issued to the wallet could not be withdrawn yet; the wallet itself is revoked and the withdrawal is retried automatically"
                    }
                  },
                  "required": [
                    "revoked",
                    "instance",
                    "revoked_at"
                  ]
                },
                "example": {
                  "revoked": true,
                  "instance": "kXc4mQ0y2u0r7wQeJ1x9pVhB3Ls8aT6nYf5dE2gH4jI",
                  "revoked_at": "2026-10-19T14:05:00Z"
                }
              }
            }
          },
          "400": {
            "description": "invalid_proof (with the reason: alg, typ, jwk, signature, aud, iat, jti, reason) or invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "unknown_instance: this provider never attested that key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "method_not_allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "invalid_request: body too large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "invalid_request: Content-Type must be application/json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited / slow_down",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable: store not readable (fails closed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/wallet-provider/link": {
      "post": {
        "tags": [
          "wallet-provider"
        ],
        "operationId": "nativeProviderLink",
        "summary": "Holder: link this wallet to the signed-in account (for revocation from the web)",
        "description": "Links the wallet instance that signs the proof to the signed-in account, so that the holder can later revoke it from the account page (lost or stolen phone). One wallet can be linked to up to 10 accounts on the same site (each link needs that account's sign-in); linking another account adds it and keeps the others with their waiting cards. A revocation stops the wallet for all its accounts. Wallet Provider of the native CodeB Wallet app (Android); runs on the hosts listed in the server configuration (default phone.codeb.io); designed to follow the wallet-unit revocation of ARF 3.0, not certified. Authorization: Bearer access token of this site's account sign-in (client codeb-admin, i.e. the website, or codeb-wallet-app, the CodeB Wallet app), introspected; 401 invalid_token with WWW-Authenticate otherwise. Limits: 120 per hour per network and 60 per hour per account. Holder proof: compact JWS, protected header {alg: ES256, typ: wallet-revoke+jwt, jwk: the wallet instance public key (EC P-256, public members only)}; payload {aud: https://<host>/wallet-provider/<operation>, iat (within 300 s of the server time), jti (at least 16 random bytes, base64url, accepted once within 10 minutes), exp (optional)}. The instance id is the RFC 7638 thumbprint (base64url) of that key, the same id the wallet instance attestation is bound to. For this operation typ may also be wallet-link+jwt and aud is https://<host>/wallet-provider/link. device_name (at most 60 characters, shown to the holder) is taken from the proof payload, else from the body. At most 10 wallets per account; an instance belongs to one account (linking it from another account moves it). The account is stored only as a hash; no user name is written next to the instance.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "proof": {
                    "type": "string",
                    "description": "compact JWS"
                  },
                  "device_name": {
                    "type": "string",
                    "description": "at most 60 characters; the proof's device_name claim wins",
                    "maxLength": 60
                  }
                },
                "required": [
                  "proof"
                ]
              },
              "example": {
                "proof": "eyJ...<compact JWS>...",
                "device_name": "Pixel 8 (work)"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Linked",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "linked": {
                      "type": "boolean"
                    },
                    "instance": {
                      "type": "string"
                    },
                    "device_name": {
                      "type": "string"
                    },
                    "linked_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "linked": true,
                  "instance": "kXc4mQ0y2u0r7wQeJ1x9pVhB3Ls8aT6nYf5dE2gH4jI",
                  "device_name": "Pixel 8 (work)",
                  "linked_at": "2026-10-19T13:58:12Z"
                }
              }
            }
          },
          "400": {
            "description": "invalid_proof / invalid_request (device_name longer than 60 characters)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "invalid_token: bearer missing, invalid or expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "wallet_revoked: this instance was revoked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "unknown_instance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "too_many_wallets: at most 10 per account; revoke one first; too_many_accounts: the wallet is linked to 10 accounts on this site already",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "invalid_request: Content-Type must be application/json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited / slow_down",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/wallet-provider/my-wallets": {
      "get": {
        "tags": [
          "wallet-provider"
        ],
        "operationId": "nativeProviderMyWallets",
        "summary": "Holder: the wallets linked to the signed-in account",
        "description": "Lists the wallet instances linked to the account (newest link first), revoked ones included. GET and POST answer the same; no body. Authorization: Bearer access token of this site's account sign-in (client codeb-admin, i.e. the website, or codeb-wallet-app, the CodeB Wallet app), introspected; 401 invalid_token with WWW-Authenticate otherwise. Limits: 120 per hour per network and 60 per hour per account. Shown on the account page under \"Your wallets\".",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "responses": {
          "200": {
            "description": "Linked wallets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "wallets": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "instance": {
                            "type": "string",
                            "description": "wallet instance id (RFC 7638 thumbprint)"
                          },
                          "instance_short": {
                            "type": "string",
                            "description": "first 8 characters, for display"
                          },
                          "device_name": {
                            "type": "string"
                          },
                          "linked_utc": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "last_wia_utc": {
                            "type": "string",
                            "description": "last wallet instance attestation (recorded at most once an hour)",
                            "format": "date-time"
                          },
                          "revoked": {
                            "type": "boolean"
                          },
                          "revoked_utc": {
                            "type": "string",
                            "description": "only when revoked",
                            "format": "date-time"
                          },
                          "documents": {
                            "type": "integer",
                            "description": "number of credentials this site issued to the instance (as recorded by the issuer)"
                          },
                          "credentials_pending": {
                            "type": "boolean",
                            "description": "revoked wallet whose documents are still being withdrawn (retried on this call)"
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "wallets"
                  ]
                },
                "example": {
                  "wallets": [
                    {
                      "instance": "kXc4mQ0y2u0r7wQeJ1x9pVhB3Ls8aT6nYf5dE2gH4jI",
                      "instance_short": "kXc4mQ0y",
                      "device_name": "Pixel 8 (work)",
                      "linked_utc": "2026-10-19T13:58:12Z",
                      "last_wia_utc": "2026-10-19T14:01:40Z",
                      "revoked": false,
                      "documents": 3
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "invalid_token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited / slow_down",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "wallet-provider"
        ],
        "operationId": "nativeProviderMyWalletsPost",
        "summary": "Holder: the wallets linked to the signed-in account (POST form)",
        "description": "Lists the wallet instances linked to the account (newest link first), revoked ones included. GET and POST answer the same; no body. Authorization: Bearer access token of this site's account sign-in (client codeb-admin, i.e. the website, or codeb-wallet-app, the CodeB Wallet app), introspected; 401 invalid_token with WWW-Authenticate otherwise. Limits: 120 per hour per network and 60 per hour per account. Shown on the account page under \"Your wallets\".",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "responses": {
          "200": {
            "description": "Linked wallets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "wallets": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "instance": {
                            "type": "string",
                            "description": "wallet instance id (RFC 7638 thumbprint)"
                          },
                          "instance_short": {
                            "type": "string",
                            "description": "first 8 characters, for display"
                          },
                          "device_name": {
                            "type": "string"
                          },
                          "linked_utc": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "last_wia_utc": {
                            "type": "string",
                            "description": "last wallet instance attestation (recorded at most once an hour)",
                            "format": "date-time"
                          },
                          "revoked": {
                            "type": "boolean"
                          },
                          "revoked_utc": {
                            "type": "string",
                            "description": "only when revoked",
                            "format": "date-time"
                          },
                          "documents": {
                            "type": "integer",
                            "description": "number of credentials this site issued to the instance (as recorded by the issuer)"
                          },
                          "credentials_pending": {
                            "type": "boolean",
                            "description": "revoked wallet whose documents are still being withdrawn (retried on this call)"
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "wallets"
                  ]
                },
                "example": {
                  "wallets": [
                    {
                      "instance": "kXc4mQ0y2u0r7wQeJ1x9pVhB3Ls8aT6nYf5dE2gH4jI",
                      "instance_short": "kXc4mQ0y",
                      "device_name": "Pixel 8 (work)",
                      "linked_utc": "2026-10-19T13:58:12Z",
                      "last_wia_utc": "2026-10-19T14:01:40Z",
                      "revoked": false,
                      "documents": 3
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "invalid_token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited / slow_down",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/wallet-provider/revoke-mine": {
      "post": {
        "tags": [
          "wallet-provider"
        ],
        "operationId": "nativeProviderRevokeMine",
        "summary": "Holder: revoke a linked wallet from the web account (lost or stolen phone)",
        "description": "Revokes one of the wallet instances linked to the signed-in account; same effect as revoke-self. Wallet Provider of the native CodeB Wallet app (Android); runs on the hosts listed in the server configuration (default phone.codeb.io); designed to follow the wallet-unit revocation of ARF 3.0, not certified. Authorization: Bearer access token of this site's account sign-in (client codeb-admin, i.e. the website, or codeb-wallet-app, the CodeB Wallet app), introspected; 401 invalid_token with WWW-Authenticate otherwise. Limits: 120 per hour per network and 60 per hour per account. Body {instance, reason?}: instance from my-wallets; reason user_request | lost | other, default lost. Effect: the instance's bit is set in the WIA status list; its wallet instance attestation and key attestation requests answer 403 {\"error\":\"wallet_revoked\"}; the issuer refuses PAR and token requests of that instance (403 wallet_revoked); the credentials this site issued to the instance since the issuer records the instance key are revoked in the issuer's status list (older ones cannot be matched and stay valid until they expire or the issuer revokes them). Idempotent: revoking again answers 200 with the first revoked_at. It cannot be undone by the holder. The answer carries credentials_revoked: false when withdrawing the documents is still in progress (the server retries; my-wallets shows credentials_pending).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "instance": {
                    "type": "string",
                    "description": "43-character instance id from my-wallets",
                    "pattern": "^[A-Za-z0-9_-]{43}$"
                  },
                  "reason": {
                    "type": "string",
                    "enum": [
                      "user_request",
                      "lost",
                      "other"
                    ],
                    "default": "lost"
                  }
                },
                "required": [
                  "instance"
                ]
              },
              "example": {
                "instance": "kXc4mQ0y2u0r7wQeJ1x9pVhB3Ls8aT6nYf5dE2gH4jI",
                "reason": "lost"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Revoked (or already revoked)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "revoked": {
                      "type": "boolean"
                    },
                    "instance": {
                      "type": "string",
                      "description": "RFC 7638 thumbprint of the instance key"
                    },
                    "revoked_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "credentials_revoked": {
                      "type": "boolean",
                      "description": "false when the documents issued to the wallet could not be withdrawn yet; the wallet itself is revoked and the withdrawal is retried automatically"
                    }
                  },
                  "required": [
                    "revoked",
                    "instance",
                    "revoked_at"
                  ]
                },
                "example": {
                  "revoked": true,
                  "instance": "kXc4mQ0y2u0r7wQeJ1x9pVhB3Ls8aT6nYf5dE2gH4jI",
                  "revoked_at": "2026-10-19T14:05:00Z"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request (instance or reason)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "invalid_token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "unknown_instance: no such wallet linked to this account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "invalid_request: Content-Type must be application/json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited / slow_down",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/wallet-provider/inbox": {
      "post": {
        "tags": [
          "wallet-provider"
        ],
        "operationId": "nativeProviderInbox",
        "summary": "Wallet: cards waiting in this wallet's inbox (no link, no QR code)",
        "description": "The CodeB Wallet asks which cards the issuer of this site put into its inbox (assignment with invite wallet). Call it when the app starts and in the background every few hours (poll_after_seconds). For each item the app shows the card name and issuer and asks the holder to add it; on Add it calls inbox-ack (accepted) and then collects the card with the usual OpenID4VCI pre-authorized code flow from credential_offer_uri, sending its wallet instance attestation (OAuth-Client-Attestation + PoP) at the token endpoint: only the linked wallets can redeem these offers. Items disappear when collected (also on another linked phone), withdrawn by the issuer or expired. Holder proof: compact JWS, protected header {alg: ES256, typ: wallet-inbox+jwt, jwk: the wallet instance public key (the key its wallet instance attestation is bound to)}; payload {aud: https://<host>/wallet-provider/<operation>, iat (within 300 s), jti (at least 16 random bytes, base64url, once within 10 minutes)}. Only a known, not revoked wallet instance that is linked to an account on this site has an inbox (409 not_linked otherwise). Limits: 120 per hour per network, body at most 16 KB.",
        "security": [],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "proof"
                ],
                "properties": {
                  "proof": {
                    "type": "string",
                    "description": "JWS typ wallet-inbox+jwt, aud https://<host>/wallet-provider/inbox"
                  }
                }
              },
              "example": {
                "proof": "eyJhbGciOiJFUzI1NiIsInR5cCI6IndhbGxldC1pbmJveCtqd3QiLCJqd2siOnsuLi59fQ..."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "credential_offer_uri": {
                            "type": "string",
                            "format": "uri"
                          },
                          "card_name": {
                            "type": "string"
                          },
                          "issuer_name": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "expires_at": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "poll_after_seconds": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_proof / invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "wallet_revoked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "unknown_instance / unknown_item",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "not_linked (no account linked to this wallet) / not_waiting",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "body too large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Content-Type must be application/json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/wallet-provider/inbox-ack": {
      "post": {
        "tags": [
          "wallet-provider"
        ],
        "operationId": "nativeProviderInboxAck",
        "summary": "Wallet: the holder accepted or declined a card from the inbox",
        "description": "Records the holder's decision. The decision is part of the signed proof: payload claims item (the inbox item id) and action (accepted | declined). accepted answers the credential_offer_uri to collect now; declined hides the item (the issuer's admin page shows it). 409 not_waiting when the item was already collected, withdrawn or expired. Holder proof: compact JWS, protected header {alg: ES256, typ: wallet-inbox+jwt, jwk: the wallet instance public key (the key its wallet instance attestation is bound to)}; payload {aud: https://<host>/wallet-provider/<operation>, iat (within 300 s), jti (at least 16 random bytes, base64url, once within 10 minutes)}. Only a known, not revoked wallet instance that is linked to an account on this site has an inbox (409 not_linked otherwise). Limits: 120 per hour per network, body at most 16 KB.",
        "security": [],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "$ref": "#/components/parameters/host"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "proof"
                ],
                "properties": {
                  "proof": {
                    "type": "string",
                    "description": "JWS typ wallet-inbox+jwt, aud https://<host>/wallet-provider/inbox-ack, payload also item + action"
                  }
                }
              },
              "example": {
                "proof": "eyJhbGciOiJFUzI1NiIsInR5cCI6IndhbGxldC1pbmJveCtqd3QiLCJqd2siOnsuLi59fQ..."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "accepted",
                        "declined"
                      ]
                    },
                    "credential_offer_uri": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_proof / invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "wallet_revoked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "unknown_instance / unknown_item",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "not_linked (no account linked to this wallet) / not_waiting",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "body too large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Content-Type must be application/json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sign-request.ashx?op=card-prepare": {
      "post": {
        "tags": [
          "sign-request"
        ],
        "operationId": "signRequestCardPrepare",
        "summary": "Signature card: prepare the PDF signature and get the hash the card signs",
        "description": "Step 1 of 2. For a signature card read by CodeB Wallet over NFC whose signing key cannot produce a PDF signature itself (the national eID card): the server builds the PDF signature, the phone only lets the card sign one hash. The PDF never leaves the server. Both calls need the signer's account access token (Authorization: Bearer, as the requester API) AND a DPoP proof; the session is bound to the account and to the DPoP key. JSON body at most 200 KB (card-finish: 64 KB). Limits: 30 per minute per IP; per hour 60 prepares / 120 finishes per IP and 30 / 60 per account. request_id is the step id from the request object link (?r=) or the request id (when the account is the requester signing its own step, or the invited e-mail address of the active step). certificate = the card's signing certificate (DER, base64url; RSA 2048-4096, keyUsage nonRepudiation, valid now; for a qes request it must state a qualified signature (qcStatements), self-signed is refused); chain = up to 4 issuing CA certificates (DER, base64url). The server adds an incremental update with an invisible signature field (SubFilter ETSI.CAdES.detached) to the PDF of this step and builds the CMS signed attributes (content-type, message-digest, ESS signing-certificate-v2, CMS algorithm protection). hash = SHA-256 of the DER signed attributes: the card signs it with RSASSA-PKCS1-v1_5 (the card adds the DigestInfo). The session lives 600 s; at most 3 open sessions per account. Several documents in one request: one session per document (document = n); the step completes when every document is signed. The DPoP proof must carry ath = base64url(SHA-256(access token)). The card certificate must chain to the national eID card CA certificates installed on the server (see eidmt-status) with keyUsage nonRepudiation and must pass the revocation check (OCSP / CRL, fails closed): otherwise 400 certificate_refused or 503 revocation_unavailable; with no CA installed card-prepare answers 503 not_configured. Visible signature field: when the requester placed a field for this signer, the server signs into that field (no invisible field) and draws the appearance: the image on the left (at most 45 % of the width), right of it \"Digitally signed by\", the name from the certificate (letters outside WinAnsi without the diacritic) and \"<yyyy-MM-dd HH:mm UTC> · CodeB Wallet\". appearance = handwritten | id_image | name_only (default: handwritten when an image is sent, else name_only); appearance_image = PNG, base64url, at most 100 KB, longest side at most 1200 px, not interlaced. Without a field both are ignored. 400 appearance_image_invalid (image not usable), 400 invalid_request (appearance not allowed for this request), 422 signature_appearance_unavailable (the request allows only image kinds and no image was sent).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "name": "DPoP",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "DPoP proof (RFC 9449) of the app key: htm POST, htu https://<host>/sign-request.ashx (the query is not part of htu), iat now, unique jti, ath = base64url(SHA-256(the access token)). The card session is bound to this key: card-finish must be sent with a proof of the same key."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "request_id": {
                    "type": "string",
                    "description": "step id (from ?r=) or request id"
                  },
                  "certificate": {
                    "type": "string",
                    "description": "signing certificate, DER, base64url"
                  },
                  "chain": {
                    "type": "array",
                    "maxItems": 4,
                    "items": {
                      "type": "string"
                    },
                    "description": "issuing CA certificates, DER, base64url"
                  },
                  "document": {
                    "type": "integer",
                    "description": "document number n for requests with several PDFs (default 0)",
                    "minimum": 0
                  },
                  "appearance": {
                    "type": "string",
                    "enum": [
                      "handwritten",
                      "id_image",
                      "name_only"
                    ],
                    "description": "only used when a visible signature field is placed for this signer"
                  },
                  "appearance_image": {
                    "type": "string",
                    "description": "PNG (<= 100 KB, longest side <= 1200 px), base64url"
                  }
                },
                "required": [
                  "request_id",
                  "certificate"
                ]
              },
              "example": {
                "request_id": "Zt3pQ8vK1mWc",
                "certificate": "MIIF...base64url DER...",
                "chain": [
                  "MIIG...issuing CA..."
                ],
                "document": 0
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Prepared",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "session": {
                      "type": "string"
                    },
                    "hash": {
                      "type": "string",
                      "description": "SHA-256 of the CMS signed attributes, base64url (32 bytes)"
                    },
                    "algorithm": {
                      "type": "string",
                      "enum": [
                        "RSASSA-PKCS1-v1_5-SHA256"
                      ]
                    },
                    "expires_in": {
                      "type": "integer",
                      "examples": [
                        600
                      ]
                    },
                    "document": {
                      "type": "integer",
                      "description": "only for several documents"
                    },
                    "documents": {
                      "type": "integer",
                      "description": "only for several documents: how many"
                    }
                  },
                  "required": [
                    "session",
                    "hash",
                    "algorithm",
                    "expires_in"
                  ]
                },
                "example": {
                  "session": "q9Wd2LrX7cVb",
                  "hash": "x3Jt0k3bTq4Wm2u7lq3l0c9yJ8d1Pz6hV5sG4fE2aB0",
                  "algorithm": "RSASSA-PKCS1-v1_5-SHA256",
                  "expires_in": 600
                }
              }
            }
          },
          "400": {
            "description": "invalid_certificate (with the reason) / invalid_request (request_id, document) / certificate_refused (chain to the installed eID CAs, key usage or revocation); appearance_image_invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "sign_in_required (Bearer) or invalid_dpop_proof (WWW-Authenticate: DPoP)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown request, or the account is not the signer of the active step",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "method_not_allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "not_yet: the earlier signers have not signed yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "request_closed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "invalid_request: application/json expected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "unsupported_document: the PDF cannot take an incremental signature (with the reason); signature_appearance_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited / slow_down",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "not_configured (no national eID CA certificates installed) / revocation_unavailable (OCSP / CRL could not be checked)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sign-request.ashx?op=card-finish": {
      "post": {
        "tags": [
          "sign-request"
        ],
        "operationId": "signRequestCardFinish",
        "summary": "Signature card: send the card's signature; the server finishes and checks the PAdES signature",
        "description": "Step 2 of 2. For a signature card read by CodeB Wallet over NFC whose signing key cannot produce a PDF signature itself (the national eID card): the server builds the PDF signature, the phone only lets the card sign one hash. The PDF never leaves the server. Both calls need the signer's account access token (Authorization: Bearer, as the requester API) AND a DPoP proof; the session is bound to the account and to the DPoP key. JSON body at most 64 KB. Limits: 30 per minute per IP; per hour 60 prepares / 120 finishes per IP and 30 / 60 per account. signature = the raw RSA PKCS#1 v1.5 signature of hash (base64url). The server checks it against the certificate and the prepared hash, builds the CMS and embeds it, then adds what can be had: a signature time stamp (PAdES B-T), OCSP responses / CRLs in a DSS (B-LT) and a document time stamp (B-LTA). Every level reached is validated like a signature from the wallet, the highest one that passes is delivered and the step continues (next signer or completion). level says what was reached; reason says why a higher level was not reached. The signature is qualified only when the card's certificate is a qualified certificate; the PAdES level does not make it qualified. The session is used up by this call, also when it fails. The DPoP proof must carry ath = base64url(SHA-256(access token)). The card certificate must chain to the national eID card CA certificates installed on the server (see eidmt-status) with keyUsage nonRepudiation and must pass the revocation check (OCSP / CRL, fails closed): otherwise 400 certificate_refused or 503 revocation_unavailable; with no CA installed card-prepare answers 503 not_configured.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "name": "DPoP",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "DPoP proof (RFC 9449) of the app key: htm POST, htu https://<host>/sign-request.ashx (the query is not part of htu), iat now, unique jti, ath = base64url(SHA-256(the access token)). The card session is bound to this key: card-finish must be sent with a proof of the same key."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "session": {
                    "type": "string",
                    "description": "from card-prepare"
                  },
                  "signature": {
                    "type": "string",
                    "description": "raw RSA signature, base64url (256 bytes for RSA 2048)"
                  }
                },
                "required": [
                  "session",
                  "signature"
                ]
              },
              "example": {
                "session": "q9Wd2LrX7cVb",
                "signature": "Vb8...base64url..."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Signed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "signed"
                      ]
                    },
                    "level": {
                      "type": "string",
                      "enum": [
                        "B-B",
                        "B-T",
                        "B-LT",
                        "B-LTA"
                      ]
                    },
                    "reason": {
                      "type": "string",
                      "description": "why a higher level was not reached (e.g. no time-stamp service answered)"
                    },
                    "documents_remaining": {
                      "type": "integer",
                      "description": "documents of this step still to sign"
                    }
                  },
                  "required": [
                    "status",
                    "level"
                  ]
                },
                "example": {
                  "status": "signed",
                  "level": "B-LTA"
                }
              }
            }
          },
          "400": {
            "description": "signature_invalid (prepare again) / invalid_certificate / invalid_signed_document / invalid_request / certificate_refused (chain to the installed eID CAs, key usage or revocation)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "sign_in_required or invalid_dpop_proof",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "session_expired: unknown, used, expired, or of another account or DPoP key - prepare again",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "request_closed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited / slow_down",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error: the signature could not be built",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "not_configured (no national eID CA certificates installed) / busy / revocation_unavailable (OCSP / CRL could not be checked)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=eidcard-start": {
      "get": {
        "tags": [
          "sign-in"
        ],
        "operationId": "eidCardStart",
        "summary": "eID card sign-in: start a session in the browser",
        "description": "Browser call (loginidcard.html). POST answers the same. Sign-in with a national eID card: the card's authentication key signs a challenge in CodeB Wallet; the server checks the signature, the certificate chain to the issuing CA certificates installed on this server and the revocation status (OCSP / CRL, fails closed), then signs the browser in. The resulting session carries acr urn:codeb:acr:eidcard and amr [\"sc\",\"pop\"]; no level-of-assurance claim. Same per-IP rate limits and automatic blocking as the wallet verifier (vp-*). link=1 (or action=eidcard-link) links the card to the signed-in account instead of signing in: then a Bearer token of a sign-in of the last 10 minutes is required. return = the page or /authorize URL to continue with after the sign-in (sanitised; never a remote-signing client). Sessions live 300 s. Link mode ends with POST action=eidcard-link-confirm after the browser showed the holder's name.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "eidcard-start"
              ]
            }
          },
          {
            "name": "link",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          },
          {
            "name": "return",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Session created; Set-Cookie eid_bind_<session> (HttpOnly, Secure, SameSite=Lax) binds the poll to this browser",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "session": {
                      "type": "string"
                    },
                    "mode": {
                      "type": "string",
                      "enum": [
                        "signin",
                        "link"
                      ]
                    },
                    "challenge_url": {
                      "type": "string",
                      "description": "API URL the app GETs for the challenge",
                      "format": "uri"
                    },
                    "app_link": {
                      "type": "string",
                      "description": "CodeB Wallet App Link https://<host>/wallet/eidcard?session=<sid> (QR code / open button); a browser that opens it gets an HTML page asking to open it with CodeB Wallet",
                      "format": "uri"
                    },
                    "qr": {
                      "type": "string",
                      "description": "same as app_link",
                      "format": "uri"
                    },
                    "poll_url": {
                      "type": "string"
                    },
                    "expires_in": {
                      "type": "integer",
                      "examples": [
                        300
                      ]
                    }
                  }
                },
                "example": {
                  "session": "u7Fh2KcQ9pLzR4mW",
                  "mode": "signin",
                  "challenge_url": "https://phone.example.com/oidc.ashx?action=eidcard-challenge&session=u7Fh2KcQ9pLzR4mW",
                  "app_link": "https://phone.example.com/wallet/eidcard?session=u7Fh2KcQ9pLzR4mW",
                  "qr": "https://phone.example.com/wallet/eidcard?session=u7Fh2KcQ9pLzR4mW",
                  "poll_url": "/oidc.ashx?action=eidcard-poll&session=u7Fh2KcQ9pLzR4mW",
                  "expires_in": 300
                }
              }
            }
          },
          "401": {
            "description": "login_required / reauth_required (link only)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "account_disabled (link only)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown tenant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited / slow_down",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable: too many open sign-ins",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=eidcard-link": {
      "get": {
        "tags": [
          "sign-in"
        ],
        "operationId": "eidCardLinkStart",
        "summary": "eID card: start linking a card to the signed-in account",
        "description": "Same as eidcard-start with link=1. Sign-in with a national eID card: the card's authentication key signs a challenge in CodeB Wallet; the server checks the signature, the certificate chain to the issuing CA certificates installed on this server and the revocation status (OCSP / CRL, fails closed), then signs the browser in. The resulting session carries acr urn:codeb:acr:eidcard and amr [\"sc\",\"pop\"]; no level-of-assurance claim. Same per-IP rate limits and automatic blocking as the wallet verifier (vp-*). Requires a Bearer token whose auth_time is at most 10 minutes old. After the app answered, eidcard-poll returns status confirm with the holder's name and the browser confirms with eidcard-link-confirm. A card can be linked to one account only (409 already_linked in eidcard-response).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "eidcard-link"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Session created; Set-Cookie eid_bind_<session> (HttpOnly, Secure, SameSite=Lax) binds the poll to this browser",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "session": {
                      "type": "string"
                    },
                    "mode": {
                      "type": "string",
                      "enum": [
                        "signin",
                        "link"
                      ]
                    },
                    "challenge_url": {
                      "type": "string",
                      "description": "API URL the app GETs for the challenge",
                      "format": "uri"
                    },
                    "app_link": {
                      "type": "string",
                      "description": "CodeB Wallet App Link https://<host>/wallet/eidcard?session=<sid> (QR code / open button); a browser that opens it gets an HTML page asking to open it with CodeB Wallet",
                      "format": "uri"
                    },
                    "qr": {
                      "type": "string",
                      "description": "same as app_link",
                      "format": "uri"
                    },
                    "poll_url": {
                      "type": "string"
                    },
                    "expires_in": {
                      "type": "integer",
                      "examples": [
                        300
                      ]
                    }
                  }
                },
                "example": {
                  "session": "u7Fh2KcQ9pLzR4mW",
                  "mode": "signin",
                  "challenge_url": "https://phone.example.com/oidc.ashx?action=eidcard-challenge&session=u7Fh2KcQ9pLzR4mW",
                  "app_link": "https://phone.example.com/wallet/eidcard?session=u7Fh2KcQ9pLzR4mW",
                  "qr": "https://phone.example.com/wallet/eidcard?session=u7Fh2KcQ9pLzR4mW",
                  "poll_url": "/oidc.ashx?action=eidcard-poll&session=u7Fh2KcQ9pLzR4mW",
                  "expires_in": 300
                }
              }
            }
          },
          "401": {
            "description": "login_required / reauth_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "account_disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited / slow_down",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=eidcard-challenge": {
      "get": {
        "tags": [
          "sign-in"
        ],
        "operationId": "eidCardChallenge",
        "summary": "eID card sign-in: the app fetches the challenge",
        "description": "Called by CodeB Wallet after scanning the QR code / opening the app link. To-be-signed text (UTF-8, lines separated by \\n, no trailing newline): \"CodeB-EIDCARD-SIGNIN\", origin, session, challenge, iat. The app hashes it with SHA-256 and the card signs the hash with its authentication key (RSA PKCS#1 v1.5; the card adds the DigestInfo). A challenge lives 120 s; fetching again within that time returns the same challenge.",
        "security": [],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "eidcard-challenge"
              ]
            }
          },
          {
            "name": "session",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Challenge",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "session": {
                      "type": "string"
                    },
                    "challenge": {
                      "type": "string",
                      "description": "32 random bytes, base64url"
                    },
                    "origin": {
                      "type": "string",
                      "format": "uri"
                    },
                    "expires_in": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "session": "u7Fh2KcQ9pLzR4mW",
                  "challenge": "Hc0Vq2b8N1xT5mPz9LkR3sWd7YgA4eJu6iOq0fCb2Dk",
                  "origin": "https://phone.example.com",
                  "expires_in": 120
                }
              }
            }
          },
          "404": {
            "description": "session_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "method_not_allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "session_used",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited / slow_down",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=eidcard-response": {
      "post": {
        "tags": [
          "sign-in"
        ],
        "operationId": "eidCardResponse",
        "summary": "eID card sign-in: the app sends the card's signature",
        "description": "JSON body at most 32 KB. To-be-signed text (UTF-8, lines separated by \\n, no trailing newline): \"CodeB-EIDCARD-SIGNIN\", origin, session, challenge, iat. The app hashes it with SHA-256 and the card signs the hash with its authentication key (RSA PKCS#1 v1.5; the card adds the DigestInfo). iat (Unix seconds) must be within 120 s of the server time and not older than the challenge. certificate = the card's authentication certificate (DER, base64url; RSA of at least 2048 bits, keyUsage digitalSignature, valid now); chain = issuing CA certificates (up to 4). The chain must end at a CA certificate installed on this server; revocation is checked by OCSP or CRL and an unknown status refuses the sign-in. At most 5 attempts per session. The name (given_name, family_name) is taken from the certificate subject; a card not linked to an account signs in to a guest account derived from the card (pseudonymous account name). [EIDCARD-LINK-CONFIRM] Link mode: the verified card is parked in the session (nothing is linked yet); a card whose family name differs from the account's verified family name is refused with 403 name_mismatch. The national ID number from the card is not written to the account's claims.",
        "security": [],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "eidcard-response"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "session": {
                    "type": "string"
                  },
                  "iat": {
                    "type": "integer",
                    "description": "Unix seconds"
                  },
                  "certificate": {
                    "type": "string",
                    "description": "DER, base64url"
                  },
                  "chain": {
                    "type": "array",
                    "maxItems": 4,
                    "items": {
                      "type": "string"
                    }
                  },
                  "signature": {
                    "type": "string",
                    "description": "base64url"
                  }
                },
                "required": [
                  "session",
                  "iat",
                  "certificate",
                  "signature"
                ]
              },
              "example": {
                "session": "u7Fh2KcQ9pLzR4mW",
                "iat": 1792424000,
                "certificate": "MIIF...",
                "chain": [],
                "signature": "Kp3...base64url..."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verified; the browser's poll completes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "ok": true
                }
              }
            }
          },
          "400": {
            "description": "invalid_request / invalid_signature / unsupported_key / challenge_expired (fetch a new challenge)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "certificate_refused (chain, validity, key usage or revoked) / revocation_unavailable (OCSP / CRL could not be checked) / name_mismatch (link mode: the card's family name differs from the account's verified family name)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "session_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "method_not_allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "session_used / already_linked (link mode: the card belongs to another account)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "invalid_request: body too large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "too_many_attempts (start a new sign-in) or rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "not_configured: no eID CA certificates installed on this server",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=eidcard-poll": {
      "get": {
        "tags": [
          "sign-in"
        ],
        "operationId": "eidCardPoll",
        "summary": "eID card sign-in: the browser polls for the result",
        "description": "Only from the browser that started the session (cookie eid_bind_<session>). 202 while waiting (last_error tells the page what the app ran into, e.g. challenge_expired); 200 once: for a sign-in the same shape as vp-response (sso_assertion for the session hand-over, redirect_uri = account page or the authorization code redirect of the /authorize request that led here); for link mode {ok, status, linked, user}. The session is removed after the 200. [EIDCARD-LINK-CONFIRM] Link mode: once the app answered, 200 {ok: true, status: \"confirm\", holder: {given_name, family_name}, issuer_cn} (repeated until the browser calls eidcard-link-confirm); nothing is linked before that.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "eidcard-poll"
              ]
            }
          },
          {
            "name": "session",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Completed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "user": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "completed",
                        "confirm"
                      ]
                    },
                    "redirect_uri": {
                      "type": "string"
                    },
                    "redirect": {
                      "type": "string"
                    },
                    "continued_elsewhere": {
                      "type": "boolean"
                    },
                    "sso_assertion": {
                      "type": "string"
                    },
                    "sso_max_age": {
                      "type": "integer"
                    },
                    "claims": {
                      "type": "object",
                      "properties": {
                        "given_name": {
                          "type": "string"
                        },
                        "family_name": {
                          "type": "string"
                        }
                      }
                    },
                    "holder": {
                      "type": "object",
                      "properties": {
                        "given_name": {
                          "type": "string"
                        },
                        "family_name": {
                          "type": "string"
                        }
                      }
                    },
                    "issuer_cn": {
                      "type": "string",
                      "description": "issuing CA of the card certificate (link mode)"
                    }
                  }
                },
                "example": {
                  "ok": true,
                  "user": "eid-3f9a1c2b7d4e",
                  "role": "guest",
                  "status": "completed",
                  "redirect_uri": "/account.html",
                  "redirect": "/account.html",
                  "continued_elsewhere": false,
                  "sso_assertion": "eyJ...",
                  "sso_max_age": 60,
                  "claims": {
                    "given_name": "Maria",
                    "family_name": "Example"
                  }
                }
              }
            }
          },
          "202": {
            "description": "Waiting for the app",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "challenged"
                      ]
                    },
                    "last_error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "ok": false,
                  "status": "challenged",
                  "last_error": ""
                }
              }
            }
          },
          "401": {
            "description": "same_device_binding_failed: poll from the browser that started the sign-in",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "account_disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "session_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "session_used",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited / slow_down",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error: the account for the card could not be prepared"
          }
        }
      }
    },
    "/oidc.ashx?action=eidcard-link-list": {
      "get": {
        "tags": [
          "sign-in"
        ],
        "operationId": "eidCardLinkList",
        "summary": "eID card: the cards linked to the signed-in account",
        "description": "Shows id (16 hex characters), the issuing CA name and the link date; no card number and no personal data.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "eidcard-link-list"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Linked cards",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "links": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "pattern": "^[0-9a-f]{16}$"
                          },
                          "issuer": {
                            "type": "string"
                          },
                          "created_utc": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "links": [
                    {
                      "id": "3f9a1c2b7d4e8a10",
                      "issuer": "Example eID Issuing CA",
                      "created_utc": "2026-10-19T12:10:00Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "login_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=eidcard-unlink": {
      "post": {
        "tags": [
          "sign-in"
        ],
        "operationId": "eidCardUnlink",
        "summary": "eID card: unlink one card (id) or all cards from the signed-in account",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "eidcard-unlink"
              ]
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{16}$"
            },
            "description": "from eidcard-link-list; empty = every card of the account"
          }
        ],
        "responses": {
          "200": {
            "description": "Removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "removed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "removed": 1
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "login_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "method_not_allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/wrpac-ca.ashx?registry=<id>": {
      "get": {
        "tags": [
          "wrpac-ca"
        ],
        "operationId": "wrpacRegistryEntry",
        "summary": "Public register entry of a relying party (registry_uri of the registration certificate)",
        "description": "What this site's relying-party register says about one entry: the data that goes into the registration certificates this site signs, plus the status. Never e-mail, phone or history of the relying party. CORS open. This is this site's own register, not a Member State's national register. [WRP-INTERMEDIARY 2026-10-20] uses_intermediary + intermediary {sub, sname} (Annex I points 14-15) when the relying party uses this site as intermediary; the gateway client id is never published.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "registry",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "register id"
          }
        ],
        "responses": {
          "200": {
            "description": "Register entry",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "official_name": {
                      "type": "string"
                    },
                    "trade_name": {
                      "type": "string"
                    },
                    "org_id": {
                      "type": "string"
                    },
                    "country": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "support_url": {
                      "type": "string"
                    },
                    "services": {
                      "type": "string"
                    },
                    "intended_use": {
                      "type": "string"
                    },
                    "privacy_policy": {
                      "type": "string"
                    },
                    "info_uri": {
                      "type": "string"
                    },
                    "supervisory_email": {
                      "type": "string"
                    },
                    "supervisory_phone": {
                      "type": "string"
                    },
                    "supervisory_uri": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "created_utc": {
                      "type": "string"
                    },
                    "updated_utc": {
                      "type": "string"
                    },
                    "register": {
                      "type": "string"
                    },
                    "public_body": {
                      "type": "boolean"
                    },
                    "entitlements": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "id": "examplerp",
                  "official_name": "Example Services Ltd",
                  "org_id": "VATMT-12345678",
                  "country": "MT",
                  "url": "https://rp.example.com",
                  "support_url": "https://rp.example.com/privacy/requests",
                  "intended_use": "Sign-in with the EU Digital Identity Wallet",
                  "privacy_policy": "https://rp.example.com/privacy",
                  "supervisory_email": "dpa@example.org",
                  "supervisory_phone": "+15555550123",
                  "supervisory_uri": "https://dpa.example.org",
                  "public_body": false,
                  "entitlements": [
                    "rp"
                  ],
                  "status": "valid",
                  "register": "this site's relying-party register; not a Member State's national register"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/wrpac-ca.ashx?issue-registrar-signer": {
      "post": {
        "tags": [
          "wrpac-ca"
        ],
        "operationId": "wrpacIssueRegistrarSigner",
        "summary": "Admin: issue the registration-certificate signer",
        "description": "Issues (from this site's access-certificate CA) the certificate that signs the registration certificate (ETSI TS 119 475 rc-wrp+jwt) of this site's own verifier. Replaces and revokes the previous signer. days default 365, at most 825. Key made and kept on the server.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "days": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 825,
                    "default": 365
                  }
                }
              },
              "example": {
                "days": 365
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Issued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "serial": {
                      "type": "string",
                      "description": "hex"
                    },
                    "certificate_pem": {
                      "type": "string"
                    },
                    "use": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "conflict (e.g. the CA does not exist yet)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "ca_key_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/wrpac-ca.ashx?replace-ca": {
      "post": {
        "tags": [
          "wrpac-ca"
        ],
        "operationId": "wrpacReplaceCa",
        "summary": "Superuser: replace the access-certificate CA (new name, new key)",
        "description": "Creates a new CA, for example to correct the organisation identifier in its name. The old CA's certificate, issued records, CRL and settings are archived on the server; before its key is destroyed it signs a final CRL revoking every certificate it issued (served at GET ?crl&ca=<SHA-256 prefix>), so it can never sign again. This site's own verifier certificate, registration-certificate signer and (when it was issued by this CA) issuer access certificate are issued again under the new CA with the same relying party, DNS names and lifetime. The relying-party register is kept. Certificates issued to other relying parties are not re-issued. If the new CA cannot be created, the old one is restored unchanged. Superuser role required (an admin gets 403). Not available when the CA key is in an HSM (409). Wallets that pinned the old CA must pin the new one (new_sha256).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "organization",
                  "country",
                  "confirm_sha256",
                  "confirm_text"
                ],
                "properties": {
                  "organization": {
                    "type": "string",
                    "description": "legal name, 1-64 characters"
                  },
                  "organization_identifier": {
                    "type": "string",
                    "description": "any one-line identifier up to 64 characters, e.g. VATMT-12345678"
                  },
                  "country": {
                    "type": "string",
                    "description": "ISO 3166-1 alpha-2 (EL for Greece)"
                  },
                  "confirm_sha256": {
                    "type": "string",
                    "description": "SHA-256 of the CA being replaced (at least the first 8 hex characters); GET ?settings returns it as ca_sha256"
                  },
                  "confirm_text": {
                    "type": "string",
                    "enum": [
                      "REPLACE"
                    ]
                  }
                }
              },
              "example": {
                "organization": "Example Company Limited",
                "organization_identifier": "VATMT-12345678",
                "country": "MT",
                "confirm_sha256": "4377a6e0",
                "confirm_text": "REPLACE"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Replaced",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "old_sha256": {
                      "type": "string"
                    },
                    "old_subject": {
                      "type": "string"
                    },
                    "new_sha256": {
                      "type": "string"
                    },
                    "new_subject": {
                      "type": "string"
                    },
                    "archive": {
                      "type": "string",
                      "description": "archive folder under the CA folder on the server"
                    },
                    "reissued": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "certificate": {
                            "type": "string"
                          },
                          "serial": {
                            "type": "string"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "not_after": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "certificates that could not be re-issued, with the reason"
                    },
                    "final_crl": {
                      "type": "string",
                      "description": "where the old CA's final CRL is served"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_request (name, confirm_sha256 or confirm_text)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "superuser_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "conflict: no CA yet, or the CA key is in an HSM",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "ca_key_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/wrpac-ca.ashx?rc-status": {
      "get": {
        "tags": [
          "wrpac-ca"
        ],
        "operationId": "wrpacRcStatus",
        "summary": "Status list of this site's registration certificates (public)",
        "description": "Token Status List (draft-ietf-oauth-status-list) referenced by the `status` claim of every registration certificate this site signs (verifier `verifier_info` and issuer `issuer_info`): `{ status_list: { idx, uri } }`. JWS typ statuslist+jwt, alg ES256, x5c [registration-certificate signer, access-certificate CA]; payload sub (this URL), iat, exp (24 h), ttl (3600 s), status_list { bits: 2, lst (zlib, base64url) }. Values: 0 VALID (register entry valid), 2 SUSPENDED (entry suspended), 1 INVALID (entry cancelled or removed). Each register entry has one stable index per kind (verifier, issuer). Cached up to 5 minutes. No sign-in, CORS open.",
        "security": [],
        "responses": {
          "200": {
            "description": "statuslist+jwt",
            "content": {
              "application/statuslist+jwt": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "no registration-certificate signer on this site",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/wrpac-ca.ashx?registrar-signer": {
      "get": {
        "tags": [
          "wrpac-ca"
        ],
        "operationId": "wrpacRegistrarSigner",
        "summary": "Admin: facts of the registration-certificate signer",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "responses": {
          "200": {
            "description": "Signer (exists false when none)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "exists": {
                      "type": "boolean"
                    },
                    "serial": {
                      "type": "string"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "not_after": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "issued_utc": {
                      "type": "string"
                    },
                    "sha256": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/wrpac-ca.ashx?wrprc-preview": {
      "get": {
        "tags": [
          "wrpac-ca"
        ],
        "operationId": "wrpacWrprcPreview",
        "summary": "Admin: the registration certificate of this site's verifier, decoded",
        "description": "Mints the registration certificate as wallets get it in verifier_info and returns it with the decoded header ({alg ES256, typ rc-wrp+jwt, x5c [signer, CA]}) and payload (ETSI TS 119 475 Table 7 claims from the register: name, sub, country, registry_uri, srv_description, entitlements, privacy_policy, info_uri, support_uri, supervisory_authority {email, phone, uri}, policy_id, certificate_policy, credentials, purpose, iat, exp = iat + 24 h, jti; claims without data in the register are left out). In real requests credentials and purpose list exactly what that request asks for.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "responses": {
          "200": {
            "description": "Preview",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "jws": {
                      "type": "string"
                    },
                    "header": {
                      "type": "object"
                    },
                    "payload": {
                      "type": "object"
                    },
                    "note": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "conflict: no registration certificate (with the reason, e.g. no signer or no verifier certificate)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/wrpac-ca.ashx?issue-own-issuer": {
      "post": {
        "tags": [
          "wrpac-ca"
        ],
        "operationId": "wrpacIssueOwnIssuer",
        "summary": "Admin: issuer access certificate that signs this site's issuer metadata",
        "description": "Issues an access certificate for this site's credential issuer from this site's access-certificate CA (using the registration of this site's verifier certificate, which must exist first) and installs it as the signer of the issuer metadata: GET /.well-known/openid-credential-issuer with Accept: application/jwt then answers a signed metadata JWT (typ openidvci-issuer-metadata+jwt, x5c [leaf, CA]). An issuer certificate from another CA is never replaced (409). days default 365, at most 825. Wallets must trust this CA to accept it.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "days": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 825,
                    "default": 365
                  }
                }
              },
              "example": {
                "days": 365
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Issued and installed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "serial": {
                      "type": "string",
                      "description": "hex"
                    },
                    "certificate_pem": {
                      "type": "string"
                    },
                    "use": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "conflict: issue this site's verifier certificate first / an issuer certificate from another CA is installed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "ca_key_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/wrpac-ca.ashx?own-issuer": {
      "get": {
        "tags": [
          "wrpac-ca"
        ],
        "operationId": "wrpacOwnIssuer",
        "summary": "Admin: which certificate signs the issuer metadata",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "responses": {
          "200": {
            "description": "Source (details only for codeb-ca)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "source": {
                      "type": "string",
                      "enum": [
                        "codeb-ca",
                        "other",
                        "none"
                      ]
                    },
                    "serial": {
                      "type": "string"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "not_after": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "issued_utc": {
                      "type": "string"
                    },
                    "sha256": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "source": "codeb-ca",
                  "serial": "4f1a2b",
                  "subject": "CN=phone.example.com, O=Example Ltd, C=MT",
                  "not_after": "2027-10-19T00:00:00Z",
                  "status": "valid"
                }
              }
            }
          },
          "401": {
            "description": "admin sign-in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/emrtd-relay.ashx?p=document-image": {
      "get": {
        "tags": [
          "emrtd"
        ],
        "operationId": "emrtdDocumentImage",
        "summary": "A document image read from the chip (proof of citizenship, front, rear) as JPEG",
        "description": "Images a passport or ID card chip may hold besides the face: DG11 proof of citizenship, DG12 image of the front and of the rear. They are kept with the account and listed in the profile under identity_documents.<passport|id_card|other>.<proof_of_citizenship_image|front_image|rear_image> = {id, type, bytes, sha256, view} ({stored: false} when the chip had one that could not be kept). Own account: Bearer of the signed-in user and id. Administrator: admin Bearer plus user. JPEG 2000 images are served converted to JPEG. Cache-Control no-store. 60 per minute per account. Not part of the PID or of OIDC claims.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "image id from identity_documents"
          },
          {
            "name": "user",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 254
            },
            "description": "administrators only: the account"
          }
        ],
        "responses": {
          "200": {
            "description": "The image",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "sign-in (or admin sign-in) required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not found (or not this account's image)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "use GET",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited / slow_down",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "seconds"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=eidcard-link-confirm": {
      "post": {
        "tags": [
          "sign-in"
        ],
        "operationId": "eidCardLinkConfirm",
        "summary": "eID card: confirm (or cancel) linking the card shown to the signed-in account",
        "description": "Link mode only. After the app answered, eidcard-poll returns status confirm with the holder's name from the card; the browser that started the link shows it and the user confirms. Needs the Bearer of the account that started the link AND the eid_bind_<session> cookie of that browser. confirm=true links the card (a card belongs to one account only), false cancels. Nothing is linked before this call. The national ID number is not stored in the account's claims and never goes into ID tokens or userinfo.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "eidcard-link-confirm"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "session": {
                    "type": "string"
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "true = link, false = cancel"
                  }
                },
                "required": [
                  "session",
                  "confirm"
                ]
              },
              "example": {
                "session": "u7Fh2KcQ9pLzR4mW",
                "confirm": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Linked or cancelled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "completed",
                        "cancelled"
                      ]
                    },
                    "linked": {
                      "type": "boolean"
                    },
                    "user": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "ok": true,
                  "status": "completed",
                  "linked": true,
                  "user": "maria@example.com"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request: JSON body required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "login_required / same_device_binding_failed (confirm in the browser that started the link)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: not a link session of this account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "session_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "method_not_allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "already_linked (the card belongs to another account) / not_ready (the app has not answered yet) / session_used",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error: the link could not be written"
          }
        }
      }
    },
    "/oidc.ashx?action=eidmt-status": {
      "get": {
        "tags": [
          "sign-in"
        ],
        "operationId": "eidMtStatus",
        "summary": "Admin: national eID CA trust store - status",
        "description": "Anchors and intermediates in use, roots waiting for a pin (fingerprints and subjects), which CAs count as eID card issuers, last runs and the next check (starts an overdue check in the background). The issuing CA certificates the server accepts for national eID cards (sign-in and card PDF signatures): CA certificates the operator installed by hand plus a weekly automatic import from the public repository of the national certification authority and from the cached national trusted list. Fail closed: a self-signed root counts only when its SHA-256 is pinned or it appears in the trusted list; a CA certificate counts only when it chains to such a root; everything else is listed as untrusted and never used. A failed import keeps the previous set. The trust store is shared by every site on the server, so changing it needs a superuser.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "eidmt-status"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Trust store status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "configured": {
                      "type": "boolean",
                      "description": "at least one anchor is installed"
                    },
                    "running": {
                      "type": "boolean"
                    },
                    "anchors_in_use": {
                      "type": "integer"
                    },
                    "intermediates_in_use": {
                      "type": "integer"
                    },
                    "certificates": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "not_after": {
                            "type": "string"
                          },
                          "self_signed": {
                            "type": "boolean"
                          },
                          "in_use": {
                            "type": "boolean"
                          },
                          "eid_card_issuer": {
                            "type": "boolean"
                          }
                        }
                      }
                    },
                    "pending_roots": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      },
                      "description": "roots found but not pinned: check the fingerprint, then eidmt-pin"
                    },
                    "pins": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "eid_card_issuers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "interval_days": {
                      "type": "integer"
                    },
                    "last_attempt": {
                      "type": "string"
                    },
                    "last_success": {
                      "type": "string"
                    },
                    "last_error": {
                      "type": "string"
                    },
                    "next_due": {
                      "type": "string"
                    },
                    "recent_runs": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "can_change_trust": {
                      "type": "boolean",
                      "description": "true for a superuser (eidmt-status only)"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "method_not_allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=eidmt-sync": {
      "post": {
        "tags": [
          "sign-in"
        ],
        "operationId": "eidMtSync",
        "summary": "Admin: national eID CA trust store - check the repository now",
        "description": "Starts the import in the background; poll eidmt-status. The issuing CA certificates the server accepts for national eID cards (sign-in and card PDF signatures): CA certificates the operator installed by hand plus a weekly automatic import from the public repository of the national certification authority and from the cached national trusted list. Fail closed: a self-signed root counts only when its SHA-256 is pinned or it appears in the trusted list; a CA certificate counts only when it chains to such a root; everything else is listed as untrusted and never used. A failed import keeps the previous set. The trust store is shared by every site on the server, so changing it needs a superuser.",
        "security": [
          {
            "oidcBearer": []
          },
          {
            "hmacAdmin": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "eidmt-sync"
              ]
            }
          }
        ],
        "responses": {
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "method_not_allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "202": {
            "description": "Started",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "started": {
                      "type": "boolean",
                      "description": "false when a run is already going"
                    },
                    "running": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "started": true,
                  "running": true
                }
              }
            }
          },
          "429": {
            "description": "too_soon: the last check ran less than 10 minutes ago (Retry-After)"
          }
        }
      }
    },
    "/oidc.ashx?action=eidmt-pin": {
      "post": {
        "tags": [
          "sign-in"
        ],
        "operationId": "eidMtPin",
        "summary": "Superuser: accept a downloaded root as trust anchor",
        "description": "Check the fingerprint and the subject first; confirm must be true. The issuing CA certificates the server accepts for national eID cards (sign-in and card PDF signatures): CA certificates the operator installed by hand plus a weekly automatic import from the public repository of the national certification authority and from the cached national trusted list. Fail closed: a self-signed root counts only when its SHA-256 is pinned or it appears in the trusted list; a CA certificate counts only when it chains to such a root; everything else is listed as untrusted and never used. A failed import keeps the previous set. The trust store is shared by every site on the server, so changing it needs a superuser.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "eidmt-pin"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Trust store status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "configured": {
                      "type": "boolean",
                      "description": "at least one anchor is installed"
                    },
                    "running": {
                      "type": "boolean"
                    },
                    "anchors_in_use": {
                      "type": "integer"
                    },
                    "intermediates_in_use": {
                      "type": "integer"
                    },
                    "certificates": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "not_after": {
                            "type": "string"
                          },
                          "self_signed": {
                            "type": "boolean"
                          },
                          "in_use": {
                            "type": "boolean"
                          },
                          "eid_card_issuer": {
                            "type": "boolean"
                          }
                        }
                      }
                    },
                    "pending_roots": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      },
                      "description": "roots found but not pinned: check the fingerprint, then eidmt-pin"
                    },
                    "pins": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "eid_card_issuers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "interval_days": {
                      "type": "integer"
                    },
                    "last_attempt": {
                      "type": "string"
                    },
                    "last_success": {
                      "type": "string"
                    },
                    "last_error": {
                      "type": "string"
                    },
                    "next_due": {
                      "type": "string"
                    },
                    "recent_runs": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "can_change_trust": {
                      "type": "boolean",
                      "description": "true for a superuser (eidmt-status only)"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "method_not_allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "superuser_required: this change affects every site on the server",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "400": {
            "description": "confirmation_required / invalid_request (with the reason)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sha256": {
                    "type": "string",
                    "description": "SHA-256 fingerprint (hex) of the CA certificate, from eidmt-status"
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "must be true"
                  }
                },
                "required": [
                  "sha256",
                  "confirm"
                ]
              },
              "example": {
                "sha256": "4f8c...e21a",
                "confirm": true
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=eidmt-unpin": {
      "post": {
        "tags": [
          "sign-in"
        ],
        "operationId": "eidMtUnpin",
        "summary": "Superuser: remove a pinned root",
        "description": "Certificates that chained only to this root stop counting. The issuing CA certificates the server accepts for national eID cards (sign-in and card PDF signatures): CA certificates the operator installed by hand plus a weekly automatic import from the public repository of the national certification authority and from the cached national trusted list. Fail closed: a self-signed root counts only when its SHA-256 is pinned or it appears in the trusted list; a CA certificate counts only when it chains to such a root; everything else is listed as untrusted and never used. A failed import keeps the previous set. The trust store is shared by every site on the server, so changing it needs a superuser.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "eidmt-unpin"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Trust store status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "configured": {
                      "type": "boolean",
                      "description": "at least one anchor is installed"
                    },
                    "running": {
                      "type": "boolean"
                    },
                    "anchors_in_use": {
                      "type": "integer"
                    },
                    "intermediates_in_use": {
                      "type": "integer"
                    },
                    "certificates": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "not_after": {
                            "type": "string"
                          },
                          "self_signed": {
                            "type": "boolean"
                          },
                          "in_use": {
                            "type": "boolean"
                          },
                          "eid_card_issuer": {
                            "type": "boolean"
                          }
                        }
                      }
                    },
                    "pending_roots": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      },
                      "description": "roots found but not pinned: check the fingerprint, then eidmt-pin"
                    },
                    "pins": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "eid_card_issuers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "interval_days": {
                      "type": "integer"
                    },
                    "last_attempt": {
                      "type": "string"
                    },
                    "last_success": {
                      "type": "string"
                    },
                    "last_error": {
                      "type": "string"
                    },
                    "next_due": {
                      "type": "string"
                    },
                    "recent_runs": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "can_change_trust": {
                      "type": "boolean",
                      "description": "true for a superuser (eidmt-status only)"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "method_not_allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "superuser_required: this change affects every site on the server",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "400": {
            "description": "confirmation_required / invalid_request (with the reason)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sha256": {
                    "type": "string",
                    "description": "SHA-256 fingerprint (hex) of the CA certificate, from eidmt-status"
                  }
                },
                "required": [
                  "sha256"
                ]
              },
              "example": {
                "sha256": "4f8c...e21a"
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=eidmt-issuer": {
      "post": {
        "tags": [
          "sign-in"
        ],
        "operationId": "eidMtIssuer",
        "summary": "Superuser: which issuing CAs count for eID cards",
        "description": "allowed=true lets certificates under this issuing CA sign in and sign PDFs as eID cards; false excludes it (for example a CA that issues other certificate types). confirm must be true. The issuing CA certificates the server accepts for national eID cards (sign-in and card PDF signatures): CA certificates the operator installed by hand plus a weekly automatic import from the public repository of the national certification authority and from the cached national trusted list. Fail closed: a self-signed root counts only when its SHA-256 is pinned or it appears in the trusted list; a CA certificate counts only when it chains to such a root; everything else is listed as untrusted and never used. A failed import keeps the previous set. The trust store is shared by every site on the server, so changing it needs a superuser.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "eidmt-issuer"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Trust store status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "configured": {
                      "type": "boolean",
                      "description": "at least one anchor is installed"
                    },
                    "running": {
                      "type": "boolean"
                    },
                    "anchors_in_use": {
                      "type": "integer"
                    },
                    "intermediates_in_use": {
                      "type": "integer"
                    },
                    "certificates": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "sha256": {
                            "type": "string"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "not_after": {
                            "type": "string"
                          },
                          "self_signed": {
                            "type": "boolean"
                          },
                          "in_use": {
                            "type": "boolean"
                          },
                          "eid_card_issuer": {
                            "type": "boolean"
                          }
                        }
                      }
                    },
                    "pending_roots": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      },
                      "description": "roots found but not pinned: check the fingerprint, then eidmt-pin"
                    },
                    "pins": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "eid_card_issuers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "interval_days": {
                      "type": "integer"
                    },
                    "last_attempt": {
                      "type": "string"
                    },
                    "last_success": {
                      "type": "string"
                    },
                    "last_error": {
                      "type": "string"
                    },
                    "next_due": {
                      "type": "string"
                    },
                    "recent_runs": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "can_change_trust": {
                      "type": "boolean",
                      "description": "true for a superuser (eidmt-status only)"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "method_not_allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "server_error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "superuser_required: this change affects every site on the server",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "400": {
            "description": "confirmation_required / invalid_request (with the reason)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sha256": {
                    "type": "string",
                    "description": "SHA-256 fingerprint (hex) of the CA certificate, from eidmt-status"
                  },
                  "allowed": {
                    "type": "boolean"
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "must be true"
                  }
                },
                "required": [
                  "sha256",
                  "allowed",
                  "confirm"
                ]
              },
              "example": {
                "sha256": "9a1d...07bc",
                "allowed": true,
                "confirm": true
              }
            }
          }
        }
      }
    },
    "/wallet-provider-native.ashx?op=admin-wallets": {
      "get": {
        "tags": [
          "wallet-provider"
        ],
        "operationId": "nativeProviderAdminWallets",
        "summary": "List every CodeB Wallet installation of this site (superuser)",
        "description": "Every wallet instance this site's wallet provider attested, newest activity first (at most 20000): device_name (from the app's link, else \"CodeB Wallet\"), key_storage, test_build, created_utc (first attestation), last_seen_utc (last wallet attestation, recorded at most hourly), app_version (version code that passed the attestation, recorded since 20 Oct 2026; null until the next attestation), below_minimum (against the site's minimum app version), accounts (logins of this site linked to the wallet; a wallet can serve up to 10 accounts), accounts_unknown (linked hashes without a current login), waiting_cards (inbox), documents, revoked (+ revoked_utc, revoked_by). Read only; no device or key identifiers beyond the instance id. Shown on wallets-admin.html. Authorization: Bearer access token of a superuser (role from the site's userinfo); 401 without sign-in, 403 for other roles. Limit 60 per hour per network. [2026-10-20] Also phone security facts from the last attestation, attestations in the last 7 days (history kept 7 days), last inbox check, last document issued, and when / how each account was linked.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "admin",
        "parameters": [
          {
            "name": "op",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "const": "admin-wallets"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Wallets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "active": {
                      "type": "integer"
                    },
                    "revoked": {
                      "type": "integer"
                    },
                    "min_app_version": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "below_minimum": {
                      "type": "integer"
                    },
                    "version_unknown": {
                      "type": "integer"
                    },
                    "truncated": {
                      "type": "boolean"
                    },
                    "wallets": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "instance": {
                            "type": "string"
                          },
                          "instance_short": {
                            "type": "string"
                          },
                          "device_name": {
                            "type": "string"
                          },
                          "key_storage": {
                            "type": "string",
                            "enum": [
                              "android_tee",
                              "android_strongbox"
                            ]
                          },
                          "test_build": {
                            "type": "boolean"
                          },
                          "created_utc": {
                            "type": "string"
                          },
                          "last_seen_utc": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "app_version": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "app_version_utc": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "below_minimum": {
                            "type": "boolean"
                          },
                          "accounts": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "accounts_unknown": {
                            "type": "integer"
                          },
                          "waiting_cards": {
                            "type": "integer"
                          },
                          "documents": {
                            "type": "integer"
                          },
                          "revoked": {
                            "type": "boolean"
                          },
                          "revoked_utc": {
                            "type": "string"
                          },
                          "revoked_by": {
                            "type": "string",
                            "enum": [
                              "self",
                              "account",
                              "admin"
                            ]
                          },
                          "account_links": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "account": {
                                  "type": "string"
                                },
                                "linked_utc": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "how": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "last_inbox_utc": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "attestations_7d": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "wallet attestations in the last 7 days (per-day counts are kept 7 days only)"
                          },
                          "last_document_utc": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "security": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "description": "what the last attestation proved: os_patch, vendor_patch (yyyymm[dd]), attestation_version (KeyMint/Keymaster), integrity play|key|play+key, rkp"
                          },
                          "security_utc": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "when these facts last changed"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "invalid_token: not signed in"
          },
          "403": {
            "description": "forbidden: superuser only"
          },
          "405": {
            "description": "GET only"
          },
          "429": {
            "description": "rate_limited"
          },
          "503": {
            "description": "temporarily_unavailable: the wallet store could not be read"
          }
        }
      }
    },
    "/sign-request.ashx?sigimg={sid}": {
      "post": {
        "tags": [
          "sign-request"
        ],
        "operationId": "signRequestDrawnSignature",
        "summary": "Store (or remove) the signature the signer drew on the web page",
        "description": "For the signer of the ACTIVE step when a visible signature field is placed for them and handwritten is allowed. Body: the drawing as a transparent PNG (twice the field size, longest side at most 1200 px, at most 100 KB). It is kept until the step ends (signed, declined, withdrawn or expired) and offered to the wallet as codeb_signature_fields[].handwritten_image. A new drawing replaces the old one; clear=1 (no body) removes it. 20 per minute per IP. The step id is the capability (no sign-in).",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "sid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{22}$"
            }
          },
          {
            "name": "clear",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "image/png": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stored or removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "drawn": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "appearance_image_invalid (the PNG is not usable)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Unknown step",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "no_signature_field",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "410": {
            "description": "request_closed (the step is not active)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "appearance_image_invalid: more than 100 KB",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "invalid_request: image/png expected",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit"
          }
        }
      }
    },
    "/sign-request.ashx?sigimg={sid}.{token}": {
      "get": {
        "tags": [
          "sign-request"
        ],
        "operationId": "signRequestDrawnSignatureImage",
        "summary": "The drawn signature (PNG) for the wallet",
        "description": "The URI in codeb_signature_fields[].handwritten_image of the request object. Answers only while the step is active. hash in the claim = SHA-256 of exactly these bytes, base64.",
        "security": [],
        "x-codeb-audience": "wallet",
        "parameters": [
          {
            "name": "sid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PNG",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Unknown",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "410": {
            "description": "request_closed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit"
          }
        }
      }
    },
    "/oidc.ashx?action=bc-authorize": {
      "post": {
        "tags": [
          "ai-agents",
          "oidc-op"
        ],
        "operationId": "cibaBackchannelAuthorize",
        "summary": "OpenID CIBA backchannel authentication request of an agent",
        "description": "OpenID Connect Client-Initiated Backchannel Authentication Core 1.0, poll mode (discovery: backchannel_authentication_endpoint, backchannel_token_delivery_modes_supported [poll]). The agent client (created by the person on agent-approvals.html; client_id agent-<32 hex>) authenticates with client_secret_basic or client_secret_post and asks its owner: login_hint = the owner's user name or e-mail, scope = 'openid sign_requests' (nothing else is available to agents), binding_message = a short code (at most 64 characters) the agent also shows, requested_expiry 60-600 s (default 300). The person gets an e-mail and approves or denies on agent-approvals.html. Then poll the token endpoint with grant_type=urn:openid:params:grant-type:ciba and the auth_req_id every interval seconds. Signed requests (request), login_hint_token, id_token_hint and user_code are not supported. At most 2 open requests per agent and 5 per person (access_denied); the person gets at most one e-mail every five minutes per agent. Rate limits per address and per agent (429 slow_down). Clients other than agent clients get unauthorized_client.",
        "security": [],
        "x-codeb-audience": "agent",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "scope",
                  "login_hint"
                ],
                "properties": {
                  "client_id": {
                    "type": "string"
                  },
                  "client_secret": {
                    "type": "string"
                  },
                  "scope": {
                    "type": "string",
                    "example": "openid sign_requests"
                  },
                  "login_hint": {
                    "type": "string"
                  },
                  "binding_message": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "requested_expiry": {
                    "type": "integer",
                    "minimum": 60,
                    "maximum": 600
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Request accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "auth_req_id": {
                      "type": "string"
                    },
                    "expires_in": {
                      "type": "integer"
                    },
                    "interval": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, invalid_scope, unknown_user_id (not the agent's owner), invalid_binding_message, access_denied (too many open requests), unauthorized_client (not an agent client)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "invalid_client",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "slow_down: too many open requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=agent-approvals": {
      "get": {
        "tags": [
          "ai-agents"
        ],
        "operationId": "agentApprovalsList",
        "summary": "The person's open agent requests (to approve or deny)",
        "description": "Bearer = the person's own access token (aud codeb-admin; agent tokens are refused). Used by agent-approvals.html. With v=2 the list also has action items: {id, kind: action, agent, client_id, binding_message, created, expires_in, authorization_details, authorization_details_b64 (the exact stored bytes, base64url), details_sha256, acting_for, agent_verified}. Without v=2 the answer is unchanged.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "responses": {
          "200": {
            "description": "Open requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requests": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "agent": {
                            "type": "string"
                          },
                          "client_id": {
                            "type": "string"
                          },
                          "binding_message": {
                            "type": "string"
                          },
                          "scope": {
                            "type": "string"
                          },
                          "created": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "expires_in": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "login_required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=agent-decide": {
      "post": {
        "tags": [
          "ai-agents"
        ],
        "operationId": "agentApprovalsDecide",
        "summary": "Approve or deny an agent request",
        "description": "Bearer = the person's own access token. An approval lets the agent collect one access token (1 hour, scope sign_requests) at the token endpoint. For an action id (agent-approvals with v=2): deny is always possible; when the account has an approval key, approve needs a confirmation (compact JWS, header {alg ES256, typ codeb-approval-confirm+jwt, kid}, payload {id, decision, details_sha256, aud = the site origin, iat within 300 s, jti once}) signed with that key, else 409 confirmation_required; an account without any approval key can approve without it (method click). Answer for actions: {ok, decision, method, receipt}; 409 not_possible when already answered, expired or unknown; 400 unknown_key or invalid_confirmation.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "decision"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "decision": {
                    "type": "string",
                    "enum": [
                      "approve",
                      "deny"
                    ]
                  },
                  "confirmation": {
                    "type": "string",
                    "description": "Actions only: the confirmation JWS"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "decision": {
                      "type": "string"
                    },
                    "method": {
                      "type": "string"
                    },
                    "receipt": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "login_required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "not_possible: unknown, already answered, expired or agent removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=agent-action": {
      "post": {
        "tags": [
          "ai-agents"
        ],
        "operationId": "agentActionCreate",
        "summary": "An agent asks its owner to approve one action (payment, order, contract, ...)",
        "description": "Rich authorization request (RFC 9396 authorization_details, type codeb_action) of an agent client (client_secret_basic or client_secret_post; client_id agent-<32 hex>). Exactly one entry; unknown fields are refused; texts: control characters removed, direction and invisible formatting characters refused. The person sees the details in CodeB Wallet and approves (confirmed with a hardware key that needs the fingerprint or PIN) or denies; the person also gets an e-mail (at most one every five minutes per agent). expires_in 60-900 s (default 300). login_hint optional, only the agent's owner. At most 5 open actions per agent, 10 per person, 200 per agent in 24 hours. The request needs a Content-Length header. Then poll agent-action-status every interval seconds.",
        "security": [],
        "x-codeb-audience": "agent",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "authorization_details"
                ],
                "properties": {
                  "authorization_details": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 1,
                    "items": {
                      "type": "object",
                      "required": [
                        "type",
                        "action",
                        "title"
                      ],
                      "additionalProperties": false,
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "codeb_action"
                        },
                        "action": {
                          "type": "string",
                          "enum": [
                            "payment",
                            "order",
                            "contract",
                            "data_share",
                            "booking",
                            "custom"
                          ]
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 300
                        },
                        "amount": {
                          "type": "object",
                          "required": [
                            "value",
                            "currency"
                          ],
                          "properties": {
                            "value": {
                              "type": "string",
                              "pattern": "^[0-9]+(\\.[0-9]+)?$",
                              "example": "1240.00"
                            },
                            "currency": {
                              "type": "string",
                              "description": "ISO 4217",
                              "example": "EUR"
                            }
                          }
                        },
                        "recipient": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string",
                              "maxLength": 120
                            },
                            "iban": {
                              "type": "string",
                              "description": "checked (mod 97), stored in groups of four"
                            }
                          }
                        },
                        "reference": {
                          "type": "string",
                          "maxLength": 80
                        },
                        "url": {
                          "type": "string",
                          "format": "uri",
                          "maxLength": 200,
                          "description": "https only"
                        }
                      }
                    }
                  },
                  "expires_in": {
                    "type": "integer",
                    "minimum": 60,
                    "maximum": 900
                  },
                  "login_hint": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Action created; waiting for the person",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "approved",
                        "denied",
                        "expired"
                      ]
                    },
                    "binding_message": {
                      "type": "string"
                    },
                    "expires_in": {
                      "type": "integer"
                    },
                    "interval": {
                      "type": "integer"
                    },
                    "details_sha256": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_authorization_details or invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "invalid_client",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "access_denied (limits, or login_hint not the owner)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "slow_down",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=agent-action-status": {
      "get": {
        "tags": [
          "ai-agents"
        ],
        "operationId": "agentActionStatus",
        "summary": "State of an agent action, with the signed receipt once answered",
        "description": "Agent client authentication as for agent-action. Pending: as the create answer. Final: approved, denied (decided_by person) or expired (decided_by expiry), with decided_at, method and receipt. The receipt is a compact JWS (typ codeb-approval+jwt, RS256, tenant OIDC key) with iss, iat, jti, id, agent {client_id, name}, principal {sub}, acting_for, authorization_details, details_sha256, decision, decided_by, decided_at, method, confirmation_kid. It can never be used as an access token. 404 not_found for an id of another agent.",
        "security": [],
        "x-codeb-audience": "agent",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "State",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "approved",
                        "denied",
                        "expired"
                      ]
                    },
                    "binding_message": {
                      "type": "string"
                    },
                    "expires_in": {
                      "type": "integer"
                    },
                    "interval": {
                      "type": "integer"
                    },
                    "details_sha256": {
                      "type": "string"
                    },
                    "decided_by": {
                      "type": "string",
                      "enum": [
                        "person",
                        "expiry"
                      ]
                    },
                    "decided_at": {
                      "type": "string"
                    },
                    "method": {
                      "type": "string",
                      "enum": [
                        "device-key",
                        "click",
                        "none"
                      ]
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Compact JWS, typ codeb-approval+jwt, RS256 with the tenant's OIDC key (kid in the JWKS)"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "invalid_client",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=approval-key-challenge": {
      "get": {
        "tags": [
          "ai-agents"
        ],
        "operationId": "approvalKeyChallenge",
        "summary": "Single-use challenge for registering an approval key (CodeB Wallet)",
        "description": "Bearer = the person's own access token. Returns a 32-byte challenge (base64url) valid for 300 s, used once as the Android Key Attestation challenge. The sign-in must be at most 10 minutes old (auth_time), else 403 fresh_login_required. Every add, replace and removal sends the person an e-mail and is written to the evidence log.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "responses": {
          "200": {
            "description": "Challenge",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "challenge": {
                      "type": "string"
                    },
                    "expires_in": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "login_required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "fresh_login_required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=approval-key": {
      "post": {
        "tags": [
          "ai-agents"
        ],
        "operationId": "approvalKeyRegister",
        "summary": "Register the approval key of a CodeB Wallet installation",
        "description": "Bearer = the person's own access token. An EC P-256 key made only for approvals, in the phone's secure hardware (TEE or StrongBox), usable only after the person's fingerprint or PIN for every use; proven with Android Key Attestation (pinned roots, revocation list, verified boot, the CodeB Wallet app, the exact challenge). kid = RFC 7638 thumbprint. The same installation_id replaces its key. At most 10 keys per account. No PID, credential or wallet attestation key is used. The sign-in must be at most 10 minutes old (auth_time), else 403 fresh_login_required. Every add, replace and removal sends the person an e-mail and is written to the evidence log.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "jwk",
                  "attestation",
                  "challenge",
                  "installation_id"
                ],
                "properties": {
                  "jwk": {
                    "type": "object",
                    "properties": {
                      "kty": {
                        "const": "EC"
                      },
                      "crv": {
                        "const": "P-256"
                      },
                      "x": {
                        "type": "string"
                      },
                      "y": {
                        "type": "string"
                      }
                    }
                  },
                  "attestation": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Base64 DER certificates, leaf first"
                  },
                  "challenge": {
                    "type": "string"
                  },
                  "installation_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Registered",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "kid": {
                      "type": "string"
                    },
                    "replaced": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, invalid_challenge or attestation_failed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "login_required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "fresh_login_required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "too_many_keys",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=approval-key-delete": {
      "post": {
        "tags": [
          "ai-agents"
        ],
        "operationId": "approvalKeyDelete",
        "summary": "Remove an approval key",
        "description": "Bearer = the person's own access token. The sign-in must be at most 10 minutes old (auth_time), else 403 fresh_login_required. Every add, replace and removal sends the person an e-mail and is written to the evidence log.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "kid"
                ],
                "properties": {
                  "kid": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "login_required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "fresh_login_required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=approval-keys": {
      "get": {
        "tags": [
          "ai-agents"
        ],
        "operationId": "approvalKeysList",
        "summary": "The person's approval keys",
        "description": "Bearer = the person's own access token.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "responses": {
          "200": {
            "description": "Keys",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "keys": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kid": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "created": {
                            "type": "string"
                          },
                          "last_used": {
                            "type": "string"
                          },
                          "security_level": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "login_required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=agent-clients": {
      "get": {
        "tags": [
          "ai-agents"
        ],
        "operationId": "agentClientsList",
        "summary": "The person's agents and the endpoints they use",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "responses": {
          "200": {
            "description": "Agents",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "login_required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=agent-client-create": {
      "post": {
        "tags": [
          "ai-agents"
        ],
        "operationId": "agentClientCreate",
        "summary": "Add an agent (client_id + client_secret, the secret is shown once)",
        "description": "At most 10 agents per person. An agent client may only ask its owner (login_hint).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 60
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "client_id": {
                      "type": "string"
                    },
                    "client_secret": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "login_hint": {
                      "type": "string"
                    },
                    "backchannel_authentication_endpoint": {
                      "type": "string"
                    },
                    "token_endpoint": {
                      "type": "string"
                    },
                    "mcp_endpoint": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "login_required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=agent-client-delete": {
      "post": {
        "tags": [
          "ai-agents"
        ],
        "operationId": "agentClientDelete",
        "summary": "Remove an agent",
        "description": "Its open requests end at once; an access token it already holds stops working within a minute.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "signed-in",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "client_id"
                ],
                "properties": {
                  "client_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "login_required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/mcp.ashx": {
      "post": {
        "tags": [
          "ai-agents"
        ],
        "operationId": "mcpSigning",
        "summary": "MCP server 'CodeB' (Model Context Protocol, Streamable HTTP, JSON responses)",
        "description": "JSON-RPC 2.0 messages: initialize (protocol versions 2025-06-18, 2025-03-26, 2024-11-05), ping, tools/list, tools/call; notifications get 202. No server-sent event stream, no session id, no batches. Also at the clean address /mcp, the address people paste into their AI app (same server). Bearer = the access token of an app the person allowed with the MCP sign-in (authorization server https://<host>/mcp-auth; aud = this server's URL) or of an agent that received it through OpenID CIBA after the person's approval (oidc.ashx?action=bc-authorize, then the token endpoint with grant_type urn:openid:params:grant-type:ciba). No other token is accepted. Agent tokens are accepted only here and by the signing requests API, and stop working within a minute after the person removes the agent. Without a valid token: 401 with WWW-Authenticate resource_metadata (RFC 9728). Messages that cannot be parsed or are not valid JSON-RPC get HTTP 400; JSON-RPC responses sent by the client get 202. Only for hosts this site serves. Tools: inspect_pdf, create_signing_request (documents, level aes|qes, sign_myself, invite, note, signature_fields with rect or position bottom-left|bottom-center|bottom-right, appearance, required_visible; at most 12 MB of PDFs), list_signing_requests, get_signing_request, invite_signers, resend_invitation, withdraw_signing_request, get_document (at most 8 MB), verify_document. The tools use the signing requests API with the same token, so all its rules apply. Agents cannot sign and cannot delete requests. Requests with a foreign Origin are refused. Permissions (scopes) the person ticks when connecting the app: sign_requests (the signing tools above), age_checks (create_age_check {reference, days 1-30}, get_age_check, list_age_checks, cancel_age_check: a link /check?c=<id> for one customer, who confirms 18+ with an EUDI wallet (proof of age eu.europa.ec.av.1); the app gets only age_over_18 true/false, nobody is signed in), meetings (create_meeting {title, start ISO 8601 with time zone, duration_minutes 5-720, note, invite[] up to 20 e-mail addresses}, list_meetings, get_meeting, invite_to_meeting, cancel_meeting: a browser video meeting room.html?room=mt-..., e-mail invitations with invite.ics; at most 100 invitation e-mails per person and day; guest accounts cannot e-mail invitations), cards (administrators only: list_card_templates, issue_card {template_id, member, delivery email_link|sign_in|wallet, days, given_name + family_name for a new guest}, list_card_offers, revoke_card_offer; existing templates only). tools/list shows only the tools of the token's permissions; other tools answer isError. Agents connected with OpenID CIBA keep sign_requests only.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "agent",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "jsonrpc",
                  "method"
                ],
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "enum": [
                      "2.0"
                    ]
                  },
                  "id": {},
                  "method": {
                    "type": "string"
                  },
                  "params": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Notification or JSON-RPC response accepted"
          },
          "401": {
            "description": "Sign-in required: WWW-Authenticate: Bearer resource_metadata=\"https://<host>/.well-known/oauth-protected-resource/mcp\", scope=\"sign_requests age_checks meetings cards\""
          },
          "403": {
            "description": "Origin not allowed"
          },
          "405": {
            "description": "GET/DELETE: no event stream, no sessions"
          },
          "413": {
            "description": "Larger than 20 MB"
          },
          "415": {
            "description": "application/json expected"
          },
          "429": {
            "description": "Rate limit"
          },
          "400": {
            "description": "Parse error or invalid JSON-RPC message (JSON-RPC error in the body); unsupported MCP-Protocol-Version"
          },
          "404": {
            "description": "Unknown host"
          }
        }
      }
    },
    "/mcp.ashx?resource-metadata": {
      "get": {
        "tags": [
          "ai-agents"
        ],
        "operationId": "mcpResourceMetadata",
        "summary": "OAuth 2.0 Protected Resource Metadata of the MCP server (RFC 9728)",
        "security": [],
        "x-codeb-audience": "public",
        "responses": {
          "200": {
            "description": "resource, authorization_servers, scopes_supported, bearer_methods_supported",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/oauth-protected-resource/mcp": {
      "get": {
        "tags": [
          "ai-agents"
        ],
        "operationId": "mcpResourceMetadataClean",
        "summary": "Protected Resource Metadata of the MCP server at /mcp (RFC 9728)",
        "description": "resource = https://<host>/mcp, authorization_servers = [https://<host>/mcp-auth], scopes_supported [sign_requests, age_checks, meetings, cards], bearer_methods_supported [header]. The 401 of /mcp points here in WWW-Authenticate resource_metadata. /mcp.ashx has the same document with resource https://<host>/mcp.ashx (/.well-known/oauth-protected-resource/mcp.ashx or /mcp.ashx?resource-metadata).",
        "security": [],
        "x-codeb-audience": "public",
        "responses": {
          "200": {
            "description": "resource, authorization_servers, scopes_supported, bearer_methods_supported",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/oauth-authorization-server/mcp-auth": {
      "get": {
        "tags": [
          "ai-agents"
        ],
        "operationId": "mcpAuthServerMetadata",
        "summary": "OAuth 2.0 Authorization Server Metadata of the MCP sign-in (RFC 8414)",
        "description": "Issuer https://<host>/mcp-auth (RFC 8414 path insertion). authorization_endpoint /mcp-auth/authorize, token_endpoint /mcp-auth/token, registration_endpoint /mcp-auth/register, revocation_endpoint /mcp-auth/revoke; response_types [code]; grant_types [authorization_code, refresh_token]; code_challenge_methods_supported [S256]; token_endpoint_auth_methods_supported [none] (public clients); scopes_supported [sign_requests, offline_access]; client_id_metadata_document_supported true; authorization_response_iss_parameter_supported true (RFC 9207). Separate from the OpenID provider of the site: the sign-in of people and of CodeB Wallet is unchanged.",
        "security": [],
        "x-codeb-audience": "public",
        "responses": {
          "200": {
            "description": "Authorization server metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/mcp-auth/authorize": {
      "get": {
        "tags": [
          "ai-agents"
        ],
        "operationId": "mcpAuthAuthorize",
        "summary": "MCP sign-in: authorization request of an AI app (OAuth 2.1 authorization code + PKCE)",
        "description": "MCP authorization (2026-07-28). client_id = the HTTPS URL of the app's Client ID Metadata Document (fetched by the server: https only, public addresses only, no redirects, at most 5 KB, client_id must equal the URL, no client secret; cached one hour) or a client_id from /mcp-auth/register. redirect_uri must be one of the app's redirect_uris (https, or http on localhost/127.0.0.1/[::1] with any port). response_type=code, code_challenge with code_challenge_method=S256 (required), resource = https://<host>/mcp or https://<host>/mcp.ashx (RFC 8707; default /mcp), scope: any of sign_requests, age_checks, meetings, cards (none = all four; offline_access and openid are accepted; the consent page shows one checkbox per permission, cards only to administrators). The person is sent to /mcp-connect.html, signs in as usual and sees the app name, its website (for metadata documents), the host it returns to and a warning for localhost apps; Allow redirects back with code, state and iss (RFC 9207), Deny with error=access_denied. An invalid client_id or redirect_uri is never redirected to.",
        "security": [],
        "x-codeb-audience": "public",
        "responses": {
          "302": {
            "description": "To /mcp-connect.html (consent) or back to redirect_uri with error, state and iss"
          }
        },
        "parameters": [
          {
            "name": "response_type",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "code"
          },
          {
            "name": "client_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Client ID Metadata Document URL or registered client_id"
          },
          {
            "name": "redirect_uri",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Registered redirect URI"
          },
          {
            "name": "code_challenge",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "PKCE S256 challenge"
          },
          {
            "name": "code_challenge_method",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "S256"
          },
          {
            "name": "resource",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "https://<host>/mcp"
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "sign_requests age_checks meetings cards (space-separated; any subset)"
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Returned unchanged"
          }
        ],
        "x-codeb-request-example": "GET /mcp-auth/authorize?response_type=code&client_id=https%3A%2F%2Fapp.example%2Foauth%2Fclient.json&redirect_uri=http%3A%2F%2F127.0.0.1%3A33418%2Fcallback&code_challenge=E9Mel...&code_challenge_method=S256&resource=https%3A%2F%2Fphone.codeb.io%2Fmcp&scope=sign_requests&state=af0ifjsldkj"
      }
    },
    "/mcp-auth/token": {
      "post": {
        "tags": [
          "ai-agents"
        ],
        "operationId": "mcpAuthToken",
        "summary": "MCP sign-in: token request (authorization_code with PKCE, refresh_token)",
        "description": "Public clients only (no client secret). grant_type=authorization_code: code (once, 2 minutes; a second use ends the connection), redirect_uri, client_id, code_verifier (S256), resource optional (must equal the authorization request). grant_type=refresh_token: refresh_token, client_id; the refresh token is rotated on every use (30 days), presenting a rotated-away one ends the connection. Answer: access_token (JWT, 1 hour, aud = the MCP server URL, scope = the permissions the person ticked, act.sub = client_id, role agent - guest for a guest account), token_type Bearer, expires_in, refresh_token, scope. The token works only on the MCP server and the signing requests API, never as a sign-in; it stops working within a minute when the person removes the app.",
        "security": [],
        "x-codeb-audience": "public",
        "responses": {
          "200": {
            "description": "Tokens",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_grant, invalid_target, unsupported_grant_type, invalid_request"
          },
          "401": {
            "description": "invalid_client (client authentication sent)"
          },
          "429": {
            "description": "Rate limit"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "grant_type",
                  "client_id"
                ],
                "properties": {
                  "grant_type": {
                    "type": "string",
                    "description": "authorization_code or refresh_token"
                  },
                  "code": {
                    "type": "string",
                    "description": "Authorization code"
                  },
                  "redirect_uri": {
                    "type": "string",
                    "description": "Same as in the authorization request"
                  },
                  "client_id": {
                    "type": "string",
                    "description": "The app"
                  },
                  "code_verifier": {
                    "type": "string",
                    "description": "PKCE verifier"
                  },
                  "refresh_token": {
                    "type": "string",
                    "description": "Refresh token"
                  },
                  "resource": {
                    "type": "string",
                    "description": "https://<host>/mcp"
                  }
                }
              }
            }
          }
        },
        "x-codeb-request-example": "grant_type=authorization_code&code=...&redirect_uri=http%3A%2F%2F127.0.0.1%3A33418%2Fcallback&client_id=https%3A%2F%2Fapp.example%2Foauth%2Fclient.json&code_verifier=...&resource=https%3A%2F%2Fphone.codeb.io%2Fmcp"
      }
    },
    "/mcp-auth/register": {
      "post": {
        "tags": [
          "ai-agents"
        ],
        "operationId": "mcpAuthRegister",
        "summary": "MCP sign-in: dynamic client registration (RFC 7591, for apps without a Client ID Metadata Document)",
        "description": "Public clients only: redirect_uris (1-10; https, or http on localhost/127.0.0.1/[::1]), client_name (shown to the person as given, marked as not confirmed by a website), client_uri, grant_types (authorization_code, refresh_token), response_types (code). token_endpoint_auth_method is always none. Rate limited per address.",
        "security": [],
        "x-codeb-audience": "public",
        "responses": {
          "201": {
            "description": "client_id, client_id_issued_at, client_name, redirect_uris, grant_types, response_types, token_endpoint_auth_method",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "invalid_redirect_uri, invalid_client_metadata"
          },
          "429": {
            "description": "Rate limit"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "redirect_uris"
                ],
                "properties": {
                  "redirect_uris": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "client_name": {
                    "type": "string"
                  },
                  "client_uri": {
                    "type": "string"
                  },
                  "grant_types": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "response_types": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "token_endpoint_auth_method": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "x-codeb-request-example": "{\"client_name\":\"My AI app\",\"redirect_uris\":[\"http://127.0.0.1:33418/callback\"],\"grant_types\":[\"authorization_code\",\"refresh_token\"],\"token_endpoint_auth_method\":\"none\"}"
      }
    },
    "/mcp-auth/revoke": {
      "post": {
        "tags": [
          "ai-agents"
        ],
        "operationId": "mcpAuthRevoke",
        "summary": "MCP sign-in: revoke a refresh token (RFC 7009)",
        "description": "token = the app's refresh token: the connection ends. Always 200.",
        "security": [],
        "x-codeb-audience": "public",
        "responses": {
          "200": {
            "description": "Done",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "token"
                ],
                "properties": {
                  "token": {
                    "type": "string",
                    "description": "Refresh token"
                  },
                  "client_id": {
                    "type": "string",
                    "description": "The app"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=mcp-request": {
      "get": {
        "tags": [
          "ai-agents"
        ],
        "operationId": "mcpConsentRequest",
        "summary": "Consent page: what an app asks for",
        "description": "Used by mcp-connect.html. id = the request id from the page fragment. Returns client_name, client_id, client_uri, verified_site (host of the metadata document URL; null for registered apps), redirect_host, localhost, scope (the permissions the app asks for), resource, user, is_admin (whether the page may offer cards), expires_in (seconds; requests last 15 minutes).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "person",
        "responses": {
          "200": {
            "description": "Request details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "login_required"
          },
          "404": {
            "description": "not_found (expired)"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Request id"
          }
        ]
      }
    },
    "/oidc.ashx?action=mcp-decide": {
      "post": {
        "tags": [
          "ai-agents"
        ],
        "operationId": "mcpConsentDecide",
        "summary": "Consent page: allow or deny an app",
        "description": "Body {\"id\",\"decision\":\"allow\"|\"deny\",\"scopes\":[permissions the person ticked]} (scopes optional: missing = all the app asked for; cards only for administrators; allow with an empty list gives 400). Returns {\"ok\":true,\"redirect\":\"<redirect_uri with code, state, iss or error=access_denied>\"}; the page navigates there. A request can be decided once.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "person",
        "responses": {
          "200": {
            "description": "ok + redirect",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "login_required"
          },
          "409": {
            "description": "not_possible (expired or already answered)"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "decision"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "decision": {
                    "type": "string",
                    "enum": [
                      "allow",
                      "deny"
                    ]
                  },
                  "scopes": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "sign_requests",
                        "age_checks",
                        "meetings",
                        "cards"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=mcp-connections": {
      "get": {
        "tags": [
          "ai-agents"
        ],
        "operationId": "mcpConnections",
        "summary": "The apps the person connected",
        "description": "Returns {\"connections\":[{\"id\",\"name\",\"client_id\",\"redirect_host\",\"created\",\"last_used\"}],\"mcp_url\":\"https://<host>/mcp\"}. Each connection also has scope (the permissions the person ticked).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "person",
        "responses": {
          "200": {
            "description": "Connections",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "login_required"
          }
        }
      }
    },
    "/oidc.ashx?action=mcp-connection-delete": {
      "post": {
        "tags": [
          "ai-agents"
        ],
        "operationId": "mcpConnectionDelete",
        "summary": "Remove a connected app",
        "description": "Body {\"id\"}. The app's refresh token ends at once, its access token within a minute.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "person",
        "responses": {
          "200": {
            "description": "ok",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "login_required"
          },
          "404": {
            "description": "not_found"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "tags": [
          "ai-agents"
        ],
        "operationId": "mcpSigningClean",
        "summary": "MCP server 'CodeB' at the clean address /mcp (the address people paste into their AI app)",
        "description": "JSON-RPC 2.0 messages: initialize (protocol versions 2025-06-18, 2025-03-26, 2024-11-05), ping, tools/list, tools/call; notifications get 202. No server-sent event stream, no session id, no batches. Also at /mcp.ashx (same server). Bearer = the access token of an app the person allowed with the MCP sign-in (authorization server https://<host>/mcp-auth; aud = this server's URL) or of an agent that received it through OpenID CIBA after the person's approval (oidc.ashx?action=bc-authorize, then the token endpoint with grant_type urn:openid:params:grant-type:ciba). No other token is accepted. Agent tokens are accepted only here and by the signing requests API, and stop working within a minute after the person removes the agent. Without a valid token: 401 with WWW-Authenticate resource_metadata (RFC 9728). Messages that cannot be parsed or are not valid JSON-RPC get HTTP 400; JSON-RPC responses sent by the client get 202. Only for hosts this site serves. Tools: inspect_pdf, create_signing_request (documents, level aes|qes, sign_myself, invite, note, signature_fields with rect or position bottom-left|bottom-center|bottom-right, appearance, required_visible; at most 12 MB of PDFs), list_signing_requests, get_signing_request, invite_signers, resend_invitation, withdraw_signing_request, get_document (at most 8 MB), verify_document. The tools use the signing requests API with the same token, so all its rules apply. Agents cannot sign and cannot delete requests. Requests with a foreign Origin are refused. Permissions (scopes) the person ticks when connecting the app: sign_requests (the signing tools above), age_checks (create_age_check {reference, days 1-30}, get_age_check, list_age_checks, cancel_age_check: a link /check?c=<id> for one customer, who confirms 18+ with an EUDI wallet (proof of age eu.europa.ec.av.1); the app gets only age_over_18 true/false, nobody is signed in), meetings (create_meeting {title, start ISO 8601 with time zone, duration_minutes 5-720, note, invite[] up to 20 e-mail addresses}, list_meetings, get_meeting, invite_to_meeting, cancel_meeting: a browser video meeting room.html?room=mt-..., e-mail invitations with invite.ics; at most 100 invitation e-mails per person and day; guest accounts cannot e-mail invitations), cards (administrators only: list_card_templates, issue_card {template_id, member, delivery email_link|sign_in|wallet, days, given_name + family_name for a new guest}, list_card_offers, revoke_card_offer; existing templates only). tools/list shows only the tools of the token's permissions; other tools answer isError. Agents connected with OpenID CIBA keep sign_requests only.",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "x-codeb-audience": "agent",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "jsonrpc",
                  "method"
                ],
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "enum": [
                      "2.0"
                    ]
                  },
                  "id": {},
                  "method": {
                    "type": "string"
                  },
                  "params": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Notification or JSON-RPC response accepted"
          },
          "401": {
            "description": "Sign-in required: WWW-Authenticate: Bearer resource_metadata=\"https://<host>/.well-known/oauth-protected-resource/mcp\", scope=\"sign_requests age_checks meetings cards\""
          },
          "403": {
            "description": "Origin not allowed"
          },
          "405": {
            "description": "GET/DELETE: no event stream, no sessions"
          },
          "413": {
            "description": "Larger than 20 MB"
          },
          "415": {
            "description": "application/json expected"
          },
          "429": {
            "description": "Rate limit"
          },
          "400": {
            "description": "Parse error or invalid JSON-RPC message (JSON-RPC error in the body); unsupported MCP-Protocol-Version"
          },
          "404": {
            "description": "Unknown host"
          }
        }
      }
    },
    "/check": {
      "get": {
        "tags": [
          "ai-agents"
        ],
        "operationId": "ageCheckPage",
        "summary": "Age check page for a customer (created by an AI app with the permission age_checks)",
        "description": "HTML page (English or German by browser language). c = the age check id from create_age_check (a bearer link: no-store, no-referrer, noindex). The customer starts a wallet request (POST /check.ashx?api=start&c=<id> -> {link: openid4vp://...}, also shown as a QR code) and the page polls GET /check.ashx?api=status&c=<id> -> {status: open|waiting|done|cancelled|expired, age_over_18 when done}. The site's verifier asks only for age_over_18 of a proof of age (eu.europa.ec.av.1); nobody is signed in; the requester learns only yes or no. 60 requests per minute per address; the verifier's own limits apply to the customer's address.",
        "security": [],
        "x-codeb-audience": "public",
        "parameters": [
          {
            "name": "c",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ac[0-9a-f]{40}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The page",
            "content": {
              "text/html": {}
            }
          },
          "404": {
            "description": "Unknown age check (page with a message)"
          },
          "429": {
            "description": "Too many requests"
          }
        }
      }
    },
    "/camara.ashx/number-verification/v0/verify": {
      "post": {
        "tags": [
          "camara-identity"
        ],
        "operationId": "camaraNumberVerify",
        "x-codeb-audience": "relying-party",
        "summary": "Number Verification (CAMARA-compatible): is this the verified phone number of the person who confirmed with their wallet?",
        "description": "Answers true when the phone number equals the number the site operator verified for the account of the person who just confirmed with an EUDI wallet. Unlike network-based Number Verification it identifies the person (PID), not only the SIM. Scope: number-verification:verify. Three-legged: the relying party sends the person through this site's OpenID Connect authorization code flow with acr_values=urn:codeb:acr:eudi-wallet and the scope named here; the person confirms with an EUDI wallet (PID presentation). The resulting access token (Bearer) must be at most 15 minutes old (auth_time). Every OIDC client registered on the site may call these APIs by default; the site admin can limit each API to chosen clients or switch it off. At most 5 calls per API per wallet confirmation. Errors follow the CAMARA error format {status, code, message}.",
        "security": [
          {
            "camaraBearer": []
          }
        ],
        "parameters": [
          {
            "name": "x-correlator",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 256
            },
            "description": "Echoed back for request tracing (CAMARA convention)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NumberVerificationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NumberVerificationResponse"
                }
              }
            }
          },
          "400": {
            "description": "INVALID_ARGUMENT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CamaraError"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CamaraError"
                }
              }
            }
          },
          "403": {
            "description": "PERMISSION_DENIED: not a fresh EUDI wallet sign-in, scope missing, or client or API not allowed by the site admin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CamaraError"
                }
              }
            }
          },
          "405": {
            "description": "METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CamaraError"
                }
              }
            }
          },
          "429": {
            "description": "TOO_MANY_REQUESTS: more than 5 calls for this wallet confirmation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CamaraError"
                }
              }
            }
          }
        }
      }
    },
    "/camara.ashx/number-verification/v0/device-phone-number": {
      "get": {
        "tags": [
          "camara-identity"
        ],
        "operationId": "camaraDevicePhoneNumber",
        "x-codeb-audience": "relying-party",
        "summary": "Number Verification: the verified phone number of the person who confirmed with their wallet",
        "description": "Scope: number-verification:device-phone-number:read. Three-legged: the relying party sends the person through this site's OpenID Connect authorization code flow with acr_values=urn:codeb:acr:eudi-wallet and the scope named here; the person confirms with an EUDI wallet (PID presentation). The resulting access token (Bearer) must be at most 15 minutes old (auth_time). Every OIDC client registered on the site may call these APIs by default; the site admin can limit each API to chosen clients or switch it off. At most 5 calls per API per wallet confirmation. Errors follow the CAMARA error format {status, code, message}.",
        "security": [
          {
            "camaraBearer": []
          }
        ],
        "parameters": [
          {
            "name": "x-correlator",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 256
            },
            "description": "Echoed back for request tracing (CAMARA convention)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DevicePhoneNumberResponse"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CamaraError"
                }
              }
            }
          },
          "403": {
            "description": "PERMISSION_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CamaraError"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: no verified phone number for this person",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CamaraError"
                }
              }
            }
          },
          "429": {
            "description": "TOO_MANY_REQUESTS",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CamaraError"
                }
              }
            }
          }
        }
      }
    },
    "/camara.ashx/kyc-match/v0.3/match": {
      "post": {
        "tags": [
          "camara-identity"
        ],
        "operationId": "camaraKycMatch",
        "x-codeb-audience": "relying-party",
        "summary": "KYC Match (CAMARA-compatible): compare customer data with the person's EUDI wallet PID; answers only true / false / not_available",
        "description": "Each property sent is compared with the PID presented in the same wallet sign-in (names tolerant of case, accents and umlaut spellings; dates exact; address parts after normalising). Only properties that were sent are answered. The PID values never leave the server. email is compared with the account's verified e-mail address. If phoneNumber is sent it must be the person's verified number, otherwise 403 INVALID_TOKEN_CONTEXT. Scope: kyc-match:match. Three-legged: the relying party sends the person through this site's OpenID Connect authorization code flow with acr_values=urn:codeb:acr:eudi-wallet and the scope named here; the person confirms with an EUDI wallet (PID presentation). The resulting access token (Bearer) must be at most 15 minutes old (auth_time). Every OIDC client registered on the site may call these APIs by default; the site admin can limit each API to chosen clients or switch it off. At most 5 calls per API per wallet confirmation. Errors follow the CAMARA error format {status, code, message}.",
        "security": [
          {
            "camaraBearer": []
          }
        ],
        "parameters": [
          {
            "name": "x-correlator",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 256
            },
            "description": "Echoed back for request tracing (CAMARA convention)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KycMatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KycMatchResponse"
                }
              }
            }
          },
          "400": {
            "description": "INVALID_ARGUMENT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CamaraError"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CamaraError"
                }
              }
            }
          },
          "403": {
            "description": "PERMISSION_DENIED or INVALID_TOKEN_CONTEXT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CamaraError"
                }
              }
            }
          },
          "429": {
            "description": "TOO_MANY_REQUESTS",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CamaraError"
                }
              }
            }
          }
        }
      }
    },
    "/camara.ashx/openapi.json": {
      "get": {
        "tags": [
          "camara-identity"
        ],
        "operationId": "camaraOpenApi",
        "x-codeb-audience": "public",
        "summary": "OpenAPI description of the identity APIs (this document's identity part)",
        "responses": {
          "200": {
            "description": "OpenAPI 3.1 JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?vcall=start": {
      "post": {
        "tags": [
          "verify-caller"
        ],
        "operationId": "verifyCallerStart",
        "x-codeb-audience": "public",
        "summary": "Verify caller: the person called gets a 6-digit code (10 minutes) and a secret session id",
        "description": "No sign-in needed. Limits: 5 open codes and 30 per hour per IP (IPv6 per /64). Sessions are short-lived files under App_Data/<tenant>/vcall (any cluster node answers).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VcallStart"
                }
              }
            }
          },
          "429": {
            "description": "too-many / busy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?vcall=status&id=<id>": {
      "get": {
        "tags": [
          "verify-caller"
        ],
        "operationId": "verifyCallerStatus",
        "x-codeb-audience": "public",
        "summary": "Verify caller: state of a session (waiting, verified, declined, expired) for the person called",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 32,
              "maxLength": 32
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VcallStatus"
                }
              }
            }
          },
          "404": {
            "description": "unknown or gone",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?vcall=check": {
      "post": {
        "tags": [
          "verify-caller"
        ],
        "operationId": "verifyCallerCheck",
        "x-codeb-audience": "public",
        "summary": "Verify caller: the caller checks the code before signing in",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VcallCode"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "code is open",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "expiresIn": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "unknown-code",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "too-many-attempts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?vcall=claim": {
      "post": {
        "tags": [
          "verify-caller"
        ],
        "operationId": "verifyCallerClaim",
        "x-codeb-audience": "wallet",
        "summary": "Verify caller: the caller confirms with a fresh EUDI wallet sign-in; the person called then sees the verified name",
        "description": "Bearer = access token (aud codeb-admin) of an EUDI wallet sign-in made after the code was shown. sharePhone=true also shows the admin-verified phone number (opt-in, default false).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VcallClaim"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VcallClaimResult"
                }
              }
            }
          },
          "401": {
            "description": "invalid_token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "wallet-sign-in-required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "unknown-code",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "already-used / expired",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "no-name",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?vcall=decline": {
      "post": {
        "tags": [
          "verify-caller"
        ],
        "operationId": "verifyCallerDecline",
        "x-codeb-audience": "public",
        "summary": "Verify caller: the caller declines; the person called sees 'declined'",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VcallCode"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?vcall=cancel": {
      "post": {
        "tags": [
          "verify-caller"
        ],
        "operationId": "verifyCallerCancel",
        "x-codeb-audience": "public",
        "summary": "Verify caller: the person called closes the session",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/oidc.ashx?action=vcall-attest": {
      "post": {
        "tags": [
          "call-screening"
        ],
        "operationId": "callScreeningAttest",
        "x-codeb-audience": "wallet",
        "summary": "Call screening: a signed 2-minute statement about the caller (verified name, hash of the verified number, key binding) plus a single-use announce capability",
        "description": "Bearer = access token (aud codeb-admin, no act) of an EUDI wallet sign-in at most 5 minutes old. Response token: JWS RS256, typ codeb-vcall+jwt, claims iss, name, from_h = base64url(SHA-256('codeb-vcall-from|' + E.164)), verified_at, iat, exp = iat+120, jti, cnf.jwk. 30 per account per hour (429 {\"error\":\"rate_limited\"}).",
        "security": [
          {
            "oidcBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VcallAttestRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VcallAttestResponse"
                }
              }
            }
          },
          "400": {
            "description": "cnf_jwk_required / invalid_cnf_jwk",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "invalid_token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "wallet_sign_in_required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "no_verified_number / no_name",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?vcall=announce": {
      "post": {
        "tags": [
          "call-screening"
        ],
        "operationId": "callScreeningAnnounce",
        "x-codeb-audience": "wallet",
        "summary": "Call screening: store an encrypted announcement for 120 s in a 16-bit bucket (no account, no phone number)",
        "description": "No Authorization header: the single-use cap from vcall-attest authorises one announcement. The blob is encrypted on the caller's phone with a key derived from the callee's number; the server cannot read it. At most 50 per bucket.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VcallAnnounce"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "stored",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "expires": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_bucket / invalid_blob",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "invalid_capability",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "busy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/signal.ashx?vcall=pending&bucket=<bucket>": {
      "get": {
        "tags": [
          "call-screening"
        ],
        "operationId": "callScreeningPending",
        "x-codeb-audience": "public",
        "summary": "Call screening: all unexpired encrypted announcements of one bucket (anonymous; 30 per minute per IP)",
        "parameters": [
          {
            "name": "bucket",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{4}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VcallPending"
                }
              }
            }
          },
          "400": {
            "description": "invalid_bucket",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}