Skip to content

Delete an agent and cascade to all its sessions, events, and stats.

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

Hard-delete. The agents row is removed; FK ON DELETE CASCADE propagates to sessions, unified_events, and event_stats_daily for that agent. If the underlying agent install ingests a new event after deletion the async materializer will re-create the agent row under the same derived agt_ ID.

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