Skip to content

Delete every session (and its events) for a specific agent.

DELETE/api/public/v1/agents/{agent_id}/sessions

Hard-delete of every sessions row scoped to (organization_id, agent_id). FK ON DELETE CASCADE propagates to unified_events and event_stats_daily rows with matching session_id. The agents row itself is untouched — the agent remains visible on /agents with zero sessions until the next ingest. Emits a single session.bulk_deleted audit event.

Terminal window
curl --fail-with-body -X DELETE 'https://app.openlatch.ai/api/public/v1/agents/<agent_id>/sessions' \
-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
agent_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.