---
id: GetSupportedEntities
name: Get supported entities
version: 1.0.0
badges:
  - content: Privacy
    backgroundColor: red
    textColor: red
summary: Returns the PII entity types Presidio Analyzer can detect for the requested language.
owners:
  - platform-engineering-team
schemaPath: schema.json
operation:
  method: GET
  path: /supportedentities
  statusCodes: ["200"]
sidebar:
  badge: "GET"
---

`GetSupportedEntities` queries the internal [[service|presidio-api]] Analyzer sidecar (`GET /supportedentities`) to list the PII entity types the analyzer can detect for a language. This endpoint reports upstream Analyzer capability; BookWorm's runtime PII middleware calls only `POST /analyze`.

## Overview

| Property                           | Value                                                                   |
| :--------------------------------- | :---------------------------------------------------------------------- |
| **Bounded Context**                | Data Privacy (External Integration)                                     |
| **Owner Service**                  | [[service\|presidio-api]] (`presidio-analyzer`)                         |
| **Protocol / Format**              | HTTP `GET /supportedentities`, `application/json` response              |
| **Gateway Endpoint**               | Internal sidecar `GET /supportedentities` (not exposed via API Gateway) |
| **Authentication & Authorization** | None (internal service-to-service network boundary)                     |
| **Idempotency / Concurrency**      | Read-only and naturally idempotent                                      |
| **Rate Limit / Caching**           | None (sidecar)                                                          |
| **Contract Version**               | `1.0.0`                                                                 |

:::note
**Capability discovery only:** The returned list describes Presidio Analyzer capability rather than a BookWorm allowlist. At runtime, BookWorm calls [[command|AnalyzeText]] (`language: "en"`) without an `entities` filter and replaces all detected spans via [[command|AnonymizeText]].
:::

## Request & Response Contract

### Query Parameters

| Name       | Type     | Required | Constraints                               | Description                                                                     |
| :--------- | :------- | :------- | :---------------------------------------- | :------------------------------------------------------------------------------ |
| `language` | `string` | No       | Two-character ISO 639-1 code (e.g., `en`) | Filters returned PII entity types to those supported for the specified language |

### Success Response (`200 OK`)

| Name       | Type       | Required | Constraints                                | Description                                                                                     |
| :--------- | :--------- | :------- | :----------------------------------------- | :---------------------------------------------------------------------------------------------- |
| Root value | `string[]` | Yes      | Array of uppercase entity type identifiers | PII entity types Presidio Analyzer can detect (e.g., `EMAIL_ADDRESS`, `PERSON`, `PHONE_NUMBER`) |

## Behavior & Side Effects

- **Read-only discovery:** Returns supported entity type identifiers from the sidecar without mutating state.

## Error Responses

| Status / Code               | Condition                                                                                              | Client Recovery Action                                  |
| :-------------------------- | :----------------------------------------------------------------------------------------------------- | :------------------------------------------------------ |
| `500 Internal Server Error` | Unsupported `language` (`"No matching recognizers were found to serve the request."`) or sidecar error | Supply a supported ISO 639-1 language code (e.g., `en`) |

## Related Documentation

- [[service|presidio-api]] — Service overview and privacy middleware integration.
- [[command|AnalyzeText]] — Runtime `POST /analyze` command used by [[service|chat-api]] and [[service|rating-api]].
- [[query|GetRecognizers]] — List available PII recognizers in Presidio Analyzer.
- [[query|GetAnonymizers]] — List built-in anonymization operators in Presidio Anonymizer.

<NodeGraph />

<SchemaViewer
	file="schema.json"
	title="Get supported entities schema"
	maxHeight="500"
	search="true"
/>


 ## Raw Schema:schema.json

{
	"$schema": "https://json-schema.org/draft/2020-12/schema",
	"title": "GetSupportedEntitiesResponse",
	"description": "PII entity types supported by Presidio Analyzer for the requested language.",
	"type": "array",
	"items": { "type": "string" }
}
