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

# Detect PII

> Detect PII spans in `text`. Returns typed findings with character offsets. Nothing is stored.



## OpenAPI

````yaml /pii-engine/api-reference/openapi.json post /detect
openapi: 3.1.0
info:
  title: Tenet PII Engine (Enterprise)
  version: current
  description: >-
    Two services from one image, each behind its own Amazon VPC Lattice service
    inside your VPC. The detect service serves `POST /detect`, `/redact`,
    `/deidentify` and `DELETE /sessions/{session_id}`. The rehydrate service
    serves `POST /reidentify` only. Callers sign every request with SigV4
    (service `vpc-lattice-svcs`) as their own IAM role, over HTTPS on 443; each
    service's auth policy names the roles allowed per route. Anything outside a
    service's routes is a 404 from Lattice. Generated from the services' own
    OpenAPI schema.
servers:
  - url: https://{detect_endpoint}
    description: >-
      Detect service: the `DetectEndpoint` output (Terraform `detect_endpoint`;
      EKS: the detect HTTPRoute's assigned domain name).
    variables:
      detect_endpoint:
        default: >-
          tenet-pii-detect-0123456789abcdef0.7d67968.vpc-lattice-svcs.us-east-1.on.aws
  - url: https://{rehydrate_endpoint}
    description: >-
      Rehydrate service: the `RehydrateEndpoint` output. Only roles in the
      rehydrate invoker list (and break-glass).
    variables:
      rehydrate_endpoint:
        default: >-
          tenet-pii-rehydrate-0123456789abcdef0.7d67968.vpc-lattice-svcs.us-east-1.on.aws
security: []
tags:
  - name: Detect service
    description: Detection, de-identification and erasure. Never returns stored plaintext.
  - name: Rehydrate service
    description: >-
      Re-identification. Privileged, audited, a separate service and auth
      policy.
  - name: Health
    description: >-
      Probes inside each task or pod on port 19991. Not routed through VPC
      Lattice.
paths:
  /detect:
    post:
      tags:
        - Detect service
      summary: Detect PII
      description: >-
        Detect PII spans in `text`. Returns typed findings with character
        offsets. Nothing is stored.
      operationId: detect_endpoint_detect_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DetectRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DetectResponse'
        '403':
          description: >-
            Refused. Either VPC Lattice denied the request under the service's
            auth policy (the caller's role isn't allowed this route and method,
            the request isn't SigV4-signed for `vpc-lattice-svcs`, the source
            VPC isn't allowed, or the approval tag is missing), or the service's
            own re-check refused it (peer outside the Lattice ranges, missing
            identity headers, another service's ARN, a non-canonical path, or a
            principal outside the route's allow-list). The service's refusal is
            the fixed body below and logs the reason at WARNING; Lattice's
            refusal carries Lattice's own body. Never retried by the client.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              example:
                detail: forbidden
        '404':
          description: >-
            Not routed. VPC Lattice forwards only the exact method and path of
            each route (case-sensitive, no trailing slash); anything else gets a
            fixed 404 from Lattice and never reaches a task.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - sigv4: []
      servers:
        - url: https://{detect_endpoint}
          description: >-
            Detect service: the `DetectEndpoint` output (Terraform
            `detect_endpoint`; EKS: the detect HTTPRoute's assigned domain
            name).
          variables:
            detect_endpoint:
              default: >-
                tenet-pii-detect-0123456789abcdef0.7d67968.vpc-lattice-svcs.us-east-1.on.aws
components:
  schemas:
    DetectRequest:
      properties:
        text:
          type: string
          title: Text
        confidence_threshold:
          anyOf:
            - type: number
            - type: 'null'
          title: Confidence Threshold
        code_filter:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Code Filter
      type: object
      required:
        - text
      title: DetectRequest
      description: >-
        Request body for `POST /detect`: the text to scan, plus an optional
        per-request `confidence_threshold` and `code_filter`.
    DetectResponse:
      properties:
        findings:
          items:
            $ref: '#/components/schemas/FindingOut'
          type: array
          title: Findings
      type: object
      required:
        - findings
      title: DetectResponse
    ErrorDetail:
      type: object
      required:
        - detail
      properties:
        detail:
          type: string
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    FindingOut:
      properties:
        label:
          type: string
          title: Label
        start:
          type: integer
          title: Start
        end:
          type: integer
          title: End
        confidence:
          type: number
          title: Confidence
        source:
          type: string
          title: Source
      type: object
      required:
        - label
        - start
        - end
        - confidence
        - source
      title: FindingOut
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    sigv4:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        AWS Signature Version 4 for service `vpc-lattice-svcs` in the service's
        Region, signed as the caller's own IAM role, with the header
        `x-amz-content-sha256: UNSIGNED-PAYLOAD` (plus `x-amz-security-token`
        for temporary credentials). Use the `tenet-pii-lattice` client or any
        SigV4 signer. The role needs `vpc-lattice-svcs:Invoke` in its own IAM
        policy and must be named in the service's auth policy.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.