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

# Erase a session

> Erase a session and its stored values. Allowed only to roles in the erasure invoker list. Each erasure writes a `tenet.erasure-audit.v1` record before anything is deleted. Always 204, including for unknown or already-deleted ids.



## OpenAPI

````yaml /pii-engine/api-reference/openapi.json delete /sessions/{session_id}
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:
  /sessions/{session_id}:
    delete:
      tags:
        - Detect service
      summary: Erase a session
      description: >-
        Erase a session and its stored values. Allowed only to roles in the
        erasure invoker list. Each erasure writes a `tenet.erasure-audit.v1`
        record before anything is deleted. Always 204, including for unknown or
        already-deleted ids.
      operationId: delete_session_endpoint_sessions__session_id__delete
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: string
            title: Session Id
      responses:
        '204':
          description: Erased (or never existed). No body.
          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: >-
            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'
        '503':
          description: >-
            The erasure audit record (`tenet.erasure-audit.v1`) could not be
            written. Nothing was deleted; the session survives.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
              example:
                detail: erase audit failed; nothing was deleted
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
      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:
  headers:
    X-Request-ID:
      description: Equals the `request_id` of the audit record this call wrote.
      schema:
        type: string
  schemas:
    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
  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.