---
title: "Anonymize sensitive entities in text"
method: POST
path: "/v1/anon"
tags: ["Anon"]
---

# Anonymize sensitive entities in text

`POST /v1/anon`

## Request

- Base URL: `https://apipie.ai`
- URL: `https://apipie.ai/v1/anon`
- Auth: API key in header `Authorization`

Uses Microsoft Presidio analyzer and anonymizer to detect PII entities in text and replace them with truncated SHA-256 hashes (16 characters). Returns both the anonymized text and a mapping of original values to their anonymized replacements for potential re-identification.

## Request body

- AnonRequest: Request body for text anonymization
  - `text` string, required: Text containing potentially sensitive information to be anonymized

## Response `200`

Successfully anonymized text with value mappings

- AnonResponse: Response containing anonymized text and value mappings
  - `anon_text` string: Text with all detected PII replaced by truncated SHA-256 hashes
  - `mappings` AnonMapping[]: Array of mappings between original values and their anonymized replacements
    - `actual_value` string: Original sensitive value detected in the text
    - `mapped_value` string: Truncated SHA-256 hash (16 characters) replacing the original value
    - `type` string: Type of PII entity detected by Presidio analyzer

## Other responses

- `400`: Invalid request - missing or malformed text
- `500`: Internal server error or Presidio service unavailable

---

[API](https://skmtc.dev/apipie/apis/introduction.md) · [All operations](https://skmtc.dev/apipie/apis/introduction/llms.txt) · [OpenAPI document](https://skmtc.dev/apipie/apis/introduction/revisions/f8386be4eb3f?raw)
