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

Read the architecture guide →

Analyze text

Detects PII entities in one text string or a batch, returning entity types, text offsets, confidence scores, and optional analysis explanations.

Privacy
POST/analyze

AnalyzeText requests PII detection 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 Analyzer sidecar (POST /analyze). 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 before anonymizing user-supplied text.

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-analyzer)
Protocol / FormatHTTP POST /analyze, application/json request and response
Gateway EndpointInternal sidecar POST /analyze (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
Note

The Presidio Analyzer (presidio-analyzer) and Anonymizer (presidio-anonymizer) run as separate sidecar containers with independent endpoints; never assume a shared base URL.

Request & Response Contract

Request Body (application/json)

NameTypeRequiredConstraintsDescription
textstring | string[]YesNon-empty string or array of stringsInput text to scan for PII entities (BookWorm sends a single string)
languagestringYesTwo-character ISO 639-1 code (BookWorm defaults to "en")Language model used for PII recognition
correlation_idstringNo—Caller-supplied correlation identifier echoed for request tracing
score_thresholdnumberNoDefault 0.0; floating-point confidence floorMinimum confidence score required to include a detection
entitiesstring[]NoValid Presidio entity namesOptional allowlist of PII entity types (e.g., PERSON, EMAIL_ADDRESS)
return_decision_processbooleanNoDefault falseWhen true, includes recognizer decision-process metadata per detection
ad_hoc_recognizersobject[]NoPresidio recognizer objectsRequest-scoped custom pattern or deny-list recognizers
contextstring[]No—Surrounding context words that can boost recognizer confidence

Success Response (200 OK)

For a single-string request, returns a JSON array of detection objects. For a batch (string[]) request, returns an array of detection arrays (one per input string).

NameTypeRequiredConstraintsDescription
entity_typestringYesPresidio entity labelDetected PII category (e.g., PERSON, EMAIL_ADDRESS)
startintegerYes>= 0Zero-based inclusive start character index in text
endintegerYes> startZero-based exclusive end character index in text
scorenumberYes0.0-1.0Confidence score assigned by the recognizer
analysis_explanationobjectNoPresent when return_decision_process is trueOptional recognizer decision metadata

Behavior & Side Effects

  • Stateless analysis: Performs in-memory NLP and pattern-based PII detection with no persistent state.
  • Client guard: BookWorm callers skip calls when text is null or whitespace and return the original text unchanged when no detections are returned.
  • PII logging restriction: Raw text payloads and unredacted detection excerpts must never be logged.

Error Responses

Status / CodeConditionClient Recovery Action
400 Bad RequestMalformed request payload or invalid ad-hoc recognizer definitionFix the request body; do not retry unchanged
500 Internal Server ErrorUnsupported language ("No matching recognizers were found to serve the request.") or sidecar failureSupply a supported ISO 639-1 language code (e.g., en)

Analyze text schema

8 properties

Request to detect PII in one or more text strings.

textoneOf
required

Text to analyze, as a single string or a batch of strings.

languagestring
required

Two-character ISO 639-1 language code.

correlation_idstring
score_thresholdnumber

Minimum detection confidence score.

entitiesarray[string]

PII entity types to analyze.

return_decision_processboolean

Whether to include analysis explanations in the response.

ad_hoc_recognizersarray[object]

Request-specific recognizers.

contextarray[string]

Context words that can improve recognition confidence.