> ## 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.

# Re-identify text

> Restore the placeholders in `text` from the session's vault entries. Substitution is single-pass and allowlist-only: a placeholder this session never issued is left as-is and listed in `unresolved`. Every call that passes auth writes one `tenet.reidentify-audit.v3` record, naming the caller's role session ARN, before the response is sent; the response carries `X-Request-ID` matching the record's `request_id`. Served only by the rehydrate service.



## OpenAPI

````yaml /pii-engine/api-reference/openapi.json post /reidentify
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:
  /reidentify:
    post:
      tags:
        - Rehydrate service
      summary: Re-identify text
      description: >-
        Restore the placeholders in `text` from the session's vault entries.
        Substitution is single-pass and allowlist-only: a placeholder this
        session never issued is left as-is and listed in `unresolved`. Every
        call that passes auth writes one `tenet.reidentify-audit.v3` record,
        naming the caller's role session ARN, before the response is sent; the
        response carries `X-Request-ID` matching the record's `request_id`.
        Served only by the rehydrate service.
      operationId: reidentify_endpoint_reidentify_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReidentifyRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReidentifyResponse'
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
        '400':
          description: >-
            Malformed `session_id` (not an id the server issues). Audited as
            `malformed_session`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              example:
                detail: 'malformed session id: ''not-a-session'''
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
        '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: Unknown or expired `session_id`. Audited as `unknown_session`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              example:
                detail: unknown or expired session_id
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '503':
          description: >-
            The audit record (`tenet.reidentify-audit.v3`) could not be written.
            Nothing was restored and no plaintext is returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              example:
                detail: reidentify audit failed; nothing was restored
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
      security:
        - sigv4: []
      servers:
        - 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
components:
  schemas:
    ReidentifyRequest:
      properties:
        text:
          type: string
          title: Text
        session_id:
          type: string
          title: Session Id
      type: object
      required:
        - text
        - session_id
      title: ReidentifyRequest
    ReidentifyResponse:
      properties:
        text:
          type: string
          title: Text
        session_id:
          type: string
          title: Session Id
        restored:
          type: integer
          title: Restored
        unresolved:
          items:
            type: string
          type: array
          title: Unresolved
      type: object
      required:
        - text
        - session_id
        - restored
        - unresolved
      title: ReidentifyResponse
    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
    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
  headers:
    X-Request-ID:
      description: Equals the `request_id` of the audit record this call wrote.
      schema:
        type: string
  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.