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
| Parameter | Type | Required | Description |
|---|---|---|---|
environment | string | Yes | Environment identifier (e.g. live, staging) |
sessionId | string | Yes | The unique identifier of the session to delete PII for |
Request
Headers
| Header | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Bearer token for authentication |
Response
{
"sessionId": "0197c55f-5af6-7e3d-af9b-f2359b104be8",
"deletedAt": "2025-01-07T12:30:00.000Z"
}
Response parameters
| Parameter | Type | Description |
|---|---|---|
sessionId | string | The unique identifier of the session whose PII was deleted |
deletedAt | string | ISO 8601 timestamp of when the session's PII data blocks were deleted |
Error responses
| Status | Description |
|---|---|
404 | Session not found |
422 | Session is still in progress (RUNNING) and cannot have its PII deleted yet |
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.