{"openapi":"3.0.0","info":{"title":"PII Anonymization API","version":"1.1.0","description":"Ultra-fast API for anonymizing personally identifiable information (PII). Combines 5 parallel detection methods: Pattern Detection (emails, phones, IBANs, crypto wallets, EU IDs, German social/financial data, profile URLs on 35+ platforms), SpaCy NER (names, organizations via local LLM), Address Detection (30+ countries), Abbreviation Detection (Strict Mode), and URL Cross-Referencing. Zero-Knowledge Architecture: no persistent PII storage, 1-hour cache TTL, user-namespaced keys. GDPR-compliant (Art. 5, 25, 44-49), processed locally in Germany.","contact":{"name":"Michael SCHILLER - Organisation. Digital.","url":"https://schiller-partners.de"}},"servers":[{"url":"https://schiller-partners.de/api/v1","description":"Production server"}],"paths":{"/pii/anonymize":{"post":{"summary":"Anonymize text","description":"Detects and anonymizes PII in the provided text using 5 parallel detection methods. Returns anonymized text with placeholders (e.g., [PERSON_1], [EMAIL_1]) and a session_id for later de-anonymization.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text"],"properties":{"text":{"type":"string","description":"The text to anonymize (UTF-8)","maxLength":50000,"example":"Dr. Anna Müller (anna.mueller@firma.de, +49 231 5678900) wohnt in der Hauptstraße 42, 44137 Dortmund."},"session_id":{"type":"string","description":"Session ID for de-anonymization. If omitted, a new UUID is generated automatically. Use the same session_id across related texts to maintain consistent placeholder numbering.","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"strict_mode":{"type":"boolean","description":"Controls abbreviation and standalone first name detection. When true: company/department abbreviations (3-4 uppercase letters like ACME, MKTG) are anonymized unless on the whitelist (~665 safe entries like API, SQL, CEO), and standalone first names from a 12,000+ European names database are detected. When false: only abbreviations with explicit context and names with surrounding context are detected. When omitted (null): uses the server-side default configuration (currently: enabled).","nullable":true,"default":null},"compact":{"type":"boolean","description":"Returns a compact response format (40-50% smaller JSON). Keys are shortened: anonymized_text→txt, entities→ent, session_id→sid, stats→st, performance→perf. Entity keys: text→t, label→l, start→s, end→e, placeholder→p. Useful for high-throughput scenarios or bandwidth-constrained environments.","default":false}}}}}},"responses":{"200":{"description":"Successful anonymization","content":{"application/json":{"schema":{"type":"object","properties":{"anonymized_text":{"type":"string","description":"Text with PII replaced by placeholders","example":"[PERSON_1] ([EMAIL_1], [PHONE_1]) wohnt in der [ADDRESS_1]."},"entities":{"type":"array","description":"List of detected PII entities with their original values and placeholders","items":{"type":"object","properties":{"text":{"type":"string","description":"Original PII text that was detected","example":"Michael Berg"},"label":{"type":"string","description":"Entity type","enum":["person","email","phone","address","iban","credit_card","crypto","url_pii","abbreviation","birth_date","organization","location","postal_code","ip_address","de_sozialversicherung","de_steuernummer","de_steuer_id","de_personalausweis","de_kindergeld","de_krankenversicherung","de_handelsregister","eu_vat","bic_swift","es_dni","es_nie","ch_ahv","fr_insee","nl_bsn","be_rijksregister"],"example":"person"},"start":{"type":"integer","description":"Start position in original text (0-indexed)","example":0},"end":{"type":"integer","description":"End position in original text (exclusive)","example":12},"placeholder":{"type":"string","description":"Anonymization placeholder used in output","example":"[PERSON_1]"}}}},"session_id":{"type":"string","format":"uuid","description":"Session ID for de-anonymization (valid for 1 hour)"},"stats":{"type":"object","properties":{"original_length":{"type":"integer","description":"Character count of input text"},"anonymized_length":{"type":"integer","description":"Character count of anonymized text"},"entities_found":{"type":"integer","description":"Total number of PII entities detected"},"entity_types":{"type":"object","description":"Count of entities per type (e.g., {\"person\": 2, \"email\": 1})","additionalProperties":{"type":"integer"}}}},"performance":{"type":"object","properties":{"detection_ms":{"type":"number","format":"float","description":"PII detection time in milliseconds"},"anonymization_ms":{"type":"number","format":"float","description":"Text anonymization time in milliseconds"},"total_processing_ms":{"type":"number","format":"float","description":"Total processing time in milliseconds"}}}}}}}},"400":{"description":"Bad request (missing/empty text, text too long, or invalid JSON)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"},"message":{"type":"string","description":"Detailed error description (only on 500)"}},"required":["error"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"},"message":{"type":"string","description":"Detailed error description (only on 500)"}},"required":["error"]}}}}}}},"/pii/deanonymize":{"post":{"summary":"De-anonymize text","description":"Restores original PII values in anonymized text using the session ID from the anonymize response. The session mapping is cached for 1 hour after creation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text","session_id"],"properties":{"text":{"type":"string","description":"Anonymized text containing placeholders (e.g., [PERSON_1], [EMAIL_1])","example":"[PERSON_1] ([EMAIL_1]) wohnt in der [ADDRESS_1]."},"session_id":{"type":"string","format":"uuid","description":"Session ID from the anonymize response","example":"550e8400-e29b-41d4-a716-446655440000"}}}}}},"responses":{"200":{"description":"Successful de-anonymization","content":{"application/json":{"schema":{"type":"object","properties":{"original_text":{"type":"string","description":"Text with placeholders replaced by original PII values","example":"Dr. Anna Müller (anna.mueller@firma.de) wohnt in der Hauptstraße 42, 44137 Dortmund."},"session_id":{"type":"string","format":"uuid"}}}}}},"400":{"description":"Bad request (missing text or session_id, or invalid JSON)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"},"message":{"type":"string","description":"Detailed error description (only on 500)"}},"required":["error"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"},"message":{"type":"string","description":"Detailed error description (only on 500)"}},"required":["error"]}}}}}}},"/pii/schema":{"get":{"summary":"OpenAPI Schema","description":"Returns this OpenAPI 3.0 schema document describing all PII API endpoints.","responses":{"200":{"description":"OpenAPI schema","content":{"application/json":{"schema":{"type":"object"}}}}}}}},"components":{"schemas":{"EntityLabel":{"type":"string","description":"All possible PII entity types detected by the API","enum":["person","email","phone","address","iban","credit_card","crypto","url_pii","abbreviation","birth_date","organization","location","postal_code","ip_address","de_sozialversicherung","de_steuernummer","de_steuer_id","de_personalausweis","de_kindergeld","de_krankenversicherung","de_handelsregister","eu_vat","bic_swift","es_dni","es_nie","ch_ahv","fr_insee","nl_bsn","be_rijksregister"],"x-categories":{"Personal":["person","email","phone","address","birth_date"],"Financial":["iban","credit_card","crypto","bic_swift"],"Government IDs (DE)":["de_sozialversicherung","de_steuernummer","de_steuer_id","de_personalausweis","de_kindergeld","de_krankenversicherung","de_handelsregister"],"Government IDs (EU)":["eu_vat","es_dni","es_nie","ch_ahv","fr_insee","nl_bsn","be_rijksregister"],"Digital":["url_pii","ip_address"],"Context":["abbreviation","organization","location","postal_code"]}}}}}