> ## Documentation Index
> Fetch the complete documentation index at: https://docs.enkryptai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PII anonymization and de-anonymization



## OpenAPI

````yaml POST /guardrails/pii
openapi: 3.0.0
info:
  title: Enkrypt AI APIs
  version: 2.0.0
servers:
  - url: https://api.enkryptai.com
security:
  - apiKeyAuth: []
tags:
  - name: Guardrails
  - name: Code of Conduct
  - name: Endpoints
  - name: Datasets
  - name: Redteam
  - name: Deployments
  - name: AI Proxy
  - name: Leaderboard
  - name: Archived
  - name: MCP Hub
    description: >-
      MCP Hub vulnerability scanning APIs. Submitting scans (the POST endpoints)
      is open to all authenticated callers. The scan **retrieval** APIs — Get
      Scan Job Status, Get Complete Scan Results, List Scans, and Get MCP Hub
      Scan Statistics (the GET endpoints) — are an **enterprise data-license
      feature**: they require your organization to have MCP Hub API access
      enabled by Enkrypt, otherwise they return `403`. Contact us at
      support@enkryptai.com to enable access.
  - name: MCP Registry Servers
  - name: MCP Gateways
  - name: MCP Playground
paths:
  /guardrails/pii:
    post:
      tags:
        - Guardrails
      summary: PII anonymization and de-anonymization
      operationId: guardrails_pii_guardrails_pii_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GuardrailsPIIRequest'
            examples:
              pii_anonymization_example:
                summary: Example PII detection and anonymization request
                value:
                  text: >-
                    John Doe, born on January 1, 1970, currently lives in New
                    York City, embarked on a journey filled with diverse
                    experiences and milestones.
                  mode: request
                  key: 'null'
              pii_deanonymization_example:
                summary: Example PII de-anonymization request
                value:
                  text: >-
                    <PERSON_0>, born on January 1, 1970, currently lives in
                    <LOCATION_0>, embarked on a journey filled with diverse
                    experiences and milestones.
                  mode: response
                  key: 1e73a3335f304890a0ffc4b2aaab14d7
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GuardrailsPIIResponse'
              examples:
                pii_anonymization_successful_response:
                  summary: Example of successful PII request anonymization
                  value:
                    text: >-
                      <PERSON_0>, born on <DATE_TIME_0>, currently lives in
                      <LOCATION_0>, embarked on a journey filled with diverse
                      experiences and milestones.
                    key: 1e73a3335f304890a0ffc4b2aaab14d7
                pii_deanonymization_successful_response:
                  summary: Example of successful PII response de-anonymization
                  value:
                    text: >-
                      John Doe, born on January 1, 1970, currently lives in New
                      York City, embarked on a journey filled with diverse
                      experiences and milestones.
                    key: 1e73a3335f304890a0ffc4b2aaab14d7
components:
  schemas:
    GuardrailsPIIRequest:
      title: GuardrailsPIIRequest
      type: object
      required:
        - text
        - mode
      properties:
        text:
          type: string
          title: Text
        mode:
          type: string
          title: Mode
          enum:
            - request
            - response
          default: request
        key:
          type: string
          title: Key
    GuardrailsPIIResponse:
      title: GuardrailsPIIResponse
      type: object
      properties:
        text:
          type: string
          title: Text
        key:
          type: string
          title: Key
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: apikey

````