Storefront has been decoupled into micro-frontends with a dedicated commerce app and shared shell.

Read the architecture guide →

Anonymize text

Replaces or transforms detected PII in text using the supplied analysis results and configured anonymization operators.

Privacy
POST/anonymize

AnonymizeText requests PII transformation from the internal Presidio APIServicev1.0.0Presidio APIExternal HTTP sidecar API for detecting PII in text and anonymizing detected entities in the Chat and Rating AI agent pi...SubscribesAnalyzeText, AnonymizeText +3APIsOpenAPIOwnerplatform-engineering-teamDiagramOpen docs Anonymizer sidecar (POST /anonymize) using entity spans produced by Analyze textCommandv1.0.0Analyze textDetects PII entities in one text string or a batch, returning entity types, text offsets, confidence scores, and optiona...Ownerplatform-engineering-teamSchemaDiagramOpen docs. In BookWorm, Chat APIServicev1.0.0Chat APIInternal HTTP host for BookWorm's interactive multi-agent chat workflow, agent discovery, and session persistence. Ownerai-capabilities-teamDiagramRepositoryOpen docs and Rating APIServicev1.0.0Rating APIInternal HTTP and A2A gRPC service for collecting, listing, deleting, and summarizing customer feedback for Catalog book...PublishesFeedbackCreatedIntegrationEvent, FeedbackDeletedIntegrationEventSubscribesCreateFeedback, DeleteFeedback +3APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs call this endpoint to replace detected PII spans with <PII>.

Overview

PropertyValue
Bounded ContextData Privacy (External Integration)
Owner ServicePresidio APIServicev1.0.0Presidio APIExternal HTTP sidecar API for detecting PII in text and anonymizing detected entities in the Chat and Rating AI agent pi...SubscribesAnalyzeText, AnonymizeText +3APIsOpenAPIOwnerplatform-engineering-teamDiagramOpen docs (presidio-anonymizer)
Protocol / FormatHTTP POST /anonymize, application/json request and response
Gateway EndpointInternal sidecar POST /anonymize (not exposed via API Gateway)
Authentication & AuthorizationNone (internal service-to-service network boundary)
Idempotency / ConcurrencyStateless and naturally idempotent
Rate Limit / CachingNone (sidecar)
Contract Version1.0.0
Warning

Pass analyzer_results computed against the exact same text string. Stale character offsets cause Presidio Anonymizer to corrupt unrelated substrings or reject the request.

Request & Response Contract

Request Body (application/json)

NameTypeRequiredConstraintsDescription
textstringYesExact string analyzed by Analyze textCommandv1.0.0Analyze textDetects PII entities in one text string or a batch, returning entity types, text offsets, confidence scores, and optiona...Ownerplatform-engineering-teamSchemaDiagramOpen docsOriginal text containing PII spans to transform
analyzer_resultsobject[]YesEach item requires start (>= 0), end (> start), score (0.0-1.0), entity_typePII detections returned by POST /analyze
anonymizersobjectNoMap of DEFAULT or entity type to operator (replace, redact, mask, hash, encrypt)Per-entity or fallback operator configuration (BookWorm defaults to replace with "<PII>")

Success Response (200 OK)

NameTypeRequiredConstraintsDescription
textstringYes—Transformed text after applying configured operators
itemsobject[]NoEach item includes start, end, entity_type, and optional operator / textApplied operator metadata

Behavior & Side Effects

  • Stateless transformation: Transforms the supplied string in memory and stores no data.
  • Default replacement: BookWorm configures the DEFAULT operator as {"type": "replace", "new_value": "<PII>"} for all detected entities.
  • PII logging restriction: Raw text request bodies must never be logged.

Error Responses

Status / CodeConditionClient Recovery Action
400 Bad RequestInvalid request JSON payloadFix the request body; do not retry unchanged
422 Unprocessable EntityInvalid input (e.g., empty text or invalid operator configuration)Correct the input fields and retry

Anonymize text schema

7 properties

Request to transform text using previously detected PII entities.

textstring
required

Text to anonymize.

anonymizersmap<string, oneOf>

Optional operators keyed by DEFAULT or a PII entity type.

analyzer_resultsarray[object]
required

PII detections returned by the Analyzer.