---
title: "Analyze Text"
method: POST
path: "/analyze"
tags: ["Analyzer"]
---

# Analyze Text

`POST /analyze`

Recognizes PII entities in a given text and returns their types, locations and score

## Request body

- AnalyzeRequest
  - `text` union, required — The text to analyze. Can be a single string or an array of strings.
    - string
    - string[]
  - `language` string, required — Two characters for the desired language in ISO_639-1 format
  - `correlation_id` string — A correlation id to append to headers and traces
  - `score_threshold` number, double — The minimal detection score threshold
  - `entities` EntityTypes[] — A list of entities to analyze
  - `return_decision_process` boolean — Whether to include analysis explanation in the response
  - `ad_hoc_recognizers` PatternRecognizer[] — list of recognizers to be used in the context of this request only (ad-hoc).
    - `name` string — Name of recognizer
    - `supported_language` string — Language code supported by this recognizer
    - `patterns` Pattern[] — List of type Pattern containing regex expressions with additional metadata.
      - `name` string — Name of regular expression pattern
      - `regex` string — Regex pattern string
      - `score` number, double — Detection confidence of this pattern (0.01 if very noisy, 0.6-1.0 if very specific)
    - `deny_list` string[] — List of words to be returned as PII if found.
    - `context` string[] — List of words to be used to increase confidence if found in the vicinity of detected entities.
    - `supported_entity` string — The name of entity this ad hoc recognizer detects
  - `context` string[] — list of context words which may help to raise recognized entities confidence

## Response `200`

OK

- union
  - RecognizerResultWithAnalysisExplanation[] — A list of analysis results (when input text is a single string)
    - `start` integer, required — Where the PII starts
    - `end` integer, required — Where the PII ends
    - `score` number, double, required — The PII detection score
    - `entity_type` string, required — The supported PII entity types.
    - `analysis_explanation` AnalysisExplanation
      - `recognizer` string — Name of recognizer that made the decision
      - `pattern_name` string — name of pattern (if decision was made by a PatternRecognizer)
      - `pattern` string — Regex pattern that was applied (if PatternRecognizer)
      - `original_score` number, double — Recognizer's confidence in result
      - `score` number, double — The PII detection score
      - `textual_explanation` string — Free text for describing a decision of a logic or model
      - `score_context_improvement` number, double — Difference from the original score
      - `supportive_context_word` string — The context word which helped increase the score
      - `validation_result` boolean, nullable — Result of a validation (e.g. checksum)
  - array[] — A list of analysis result lists (when input text is an array of strings)
    - RecognizerResultWithAnalysisExplanation[]
      - `start` integer, required — Where the PII starts
      - `end` integer, required — Where the PII ends
      - `score` number, double, required — The PII detection score
      - `entity_type` string, required — The supported PII entity types.
      - `analysis_explanation` AnalysisExplanation
        - `recognizer` string — Name of recognizer that made the decision
        - `pattern_name` string — name of pattern (if decision was made by a PatternRecognizer)
        - `pattern` string — Regex pattern that was applied (if PatternRecognizer)
        - `original_score` number, double — Recognizer's confidence in result
        - `score` number, double — The PII detection score
        - `textual_explanation` string — Free text for describing a decision of a logic or model
        - `score_context_improvement` number, double — Difference from the original score
        - `supportive_context_word` string — The context word which helped increase the score
        - `validation_result` boolean, nullable — Result of a validation (e.g. checksum)

## Changes

- **2026-02-22** `0bb0770b0f7c` — 1 breaking, 1 info
  - added `subschema #1, subschema #2` to the response body `oneOf` list for the response status `200`
  - removed `subschema #1, subschema #2` from the response body `oneOf` list for the response status `200`
- **2026-02-04** `f00a67b23f3f` — 2 breaking, 1 info
  - added `subschema #1, subschema #2` to the response body `oneOf` list for the response status `200`
  - the response's body type/format changed from `array`/`` to ``/`` for status `200`
  - request property `text` list-of-types was widened by adding types `array` to media type `application/json`
- **2025-06-16** `dac1960a677e` — 1 warning
  - removed the optional property `items/allOf[#/components/schemas/RecognizerResult]/recognition_metadata` from the response with the `200` status
- **2022-02-22** `4339e6a46b07` — 3 breaking, 7 info
  - added the new required request property `language`
  - added the new required request property `text`
  - the request's body type/format changed from ``/`` to `object`/``
  - added the new optional request property `ad_hoc_recognizers`
  - …6 more
- **2021-05-05** `08cf7bba99bb` — 1 breaking, 6 warning, 1 info
  - the request's body type/format changed from `object`/`` to ``/``
  - removed the request property `correlation_id`
  - removed the request property `entities`
  - removed the request property `language`
  - …4 more

[Full history](https://skmtc.dev/data-privacy-stack/apis/presidio/changes/analyze/post.md)

---

[API](https://skmtc.dev/data-privacy-stack/apis/presidio.md) · [All operations](https://skmtc.dev/data-privacy-stack/apis/presidio/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/data-privacy-stack/presidio/revisions/c114dc1262f2/schema)
