Skip to main content

Delete session PII

Permanently delete the PII data blocks for a completed session​

Delete the PII data blocks belonging to a specific session ahead of the automated retention period. Only PII data blocks are removed — the session record and its non-PII metadata remain intact and queryable.

This endpoint is idempotent: if the session's PII was already deleted, the original deletion result is returned rather than an error.

Endpoint​

DELETE /api/v1/{environment}/sessions/{sessionId}

Path parameters

ParameterTypeRequiredDescription
environmentstringYesEnvironment identifier (e.g. live, staging)
sessionIdstringYesThe unique identifier of the session to delete PII for

Request​

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token for authentication

Response​

Response parameters

ParameterTypeDescription
sessionIdstringThe unique identifier of the session whose PII was deleted
deletedAtstringISO 8601 timestamp of when the session's PII data blocks were deleted
{
"sessionId": "0197c55f-5af6-7e3d-af9b-f2359b104be8",
"deletedAt": "2025-01-07T12:30:00.000Z"
}

Error responses​

StatusDescription
404Session not found
409Session is still in progress (RUNNING) — cannot delete PII until the session reaches a terminal state

Example​

curl --request DELETE https://localhost:3000/api/v1/live/sessions/0197c55f-5af6-7e3d-af9b-f2359b104be8 \
--header "Authorization: Bearer YOUR_API_KEY"
note

This is a distinct, on-demand mechanism separate from Studio's manual deletion feature, though both share the same underlying deletion logic. The automated retention period still applies to sessions not explicitly deleted via this endpoint.