---
title: "Anonymize Text"
method: POST
path: "/anonymize"
tags: ["Anonymizer"]
---

# Anonymize Text

`POST /anonymize`

## Request body

- AnonymizeRequest
  - `text` string, required — The text to anonymize
  - `anonymizers` object — Object where the key is DEFAULT or the ENTITY_TYPE and the value is the anonymizer definition
  - `analyzer_results` RecognizerResult[], required — Array of analyzer detections
    - `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.

## Response `200`

OK

- AnonymizeResponse
  - `text` string
  - `items` OperatorResult[] — Array of anonymized entities
    - `operator` string — Name of the used operator
    - `entity_type` string, required — Type of the PII entity
    - `start` integer, required — Start index of the changed text
    - `end` integer, required — End index in the changed text
    - `text` string — The new text returned

## Other responses

- `400` — Bad request
- `422` — Unprocessable Entity

## Changes

- **2025-06-16** `dac1960a677e` — 1 warning
  - removed the request property `analyzer_results/items/recognition_metadata`
- **2025-03-17** `7f6009a824ac` — 1 breaking, 1 info
  - removed the enum value `blake2b` of the request property `anonymizers/additionalProperties/anyOf[subschema #4: Hash]/hash_type`
  - the `hash_type` request property default value changed from `blake2b` to `sha256`
- **2025-03-17** `5b96d3395229` — 1 breaking, 2 info
  - removed the enum value `md5` of the request property `anonymizers/additionalProperties/anyOf[subschema #4: Hash]/hash_type`
  - the `hash_type` request property default value changed from `md5` to `blake2b`
  - added the new `blake2b` enum value to the request property `anonymizers/additionalProperties/anyOf[subschema #4: Hash]/hash_type`
- **2023-01-25** `ad83f14db552` — 1 breaking
  - removed `#/components/schemas/Replace, #/components/schemas/Redact, #/components/schemas/Mask, #/components/schemas/Hash, #/components/schemas/Encrypt` from the `anonymizers` request property `anyOf` list
- **2022-02-22** `4339e6a46b07` — 2 breaking, 5 info
  - request body became required
  - the response's body type/format changed from ``/`` to `object`/`` for status `200`
  - added the media type `application/json` to the request body
  - added the media type `application/json` for the response with the status `400`
  - …3 more

[Full history](https://skmtc.dev/data-privacy-stack/apis/presidio/changes/anonymize/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)
