Skip to content

Delete a session and cascade to all events and stats for that session.

DELETE/api/public/v1/sessions/{session_id}

Hard-delete. The sessions row is removed; FK ON DELETE CASCADE propagates to unified_events and event_stats_daily rows with matching session_id. The owning agent is untouched. If the underlying agent ingests a new event with the same native_session_id after deletion the async materializer will re-create a fresh session row (new session_id).

Terminal window
curl --fail-with-body -X DELETE 'https://app.openlatch.ai/api/public/v1/sessions/<session_id>' \
-H "Authorization: Bearer $OPENLATCH_API_KEY"
Role in the organizationThis endpoint
ownerAllowed
adminAllowed
editorNot allowed
viewerNot allowed

A key carries the role its owner holds in the organization. See Authentication.

API key scope: agents:write

ParameterTypeDescription
session_idstringRequired.
ParameterTypeDescription
Idempotency-Keystring or nullOptional. Makes the request safe to retry: the same key and the same request, within 24 hours, returns the stored response with Idempotent-Replayed: true and runs once.