Skip to content

Delete a policy

DELETE/api/public/v1/policies/{public_id}

Deletes it (the one exit of an AIP): it stops running in its Autonomy Zone and cannot be used again — the history is kept, because the decisions it already made are evidence, and the deleted AIP stays readable from GET /policies/{public_id}. To run its rules in another zone, copy it first with POST /policies/{public_id}/copy. A zone_id that holds no attachment of it answers 409 INHERITED_HERE. An agent (OAuth) caller must send the version of the policy it read as a query parameter: missing answers 428 POLICY_VERSION_REQUIRED, one that is no longer current 409 POLICY_VERSION_STALE; an already-retired policy is checked too.

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

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

API key scope: policies:write

ParameterTypeDescription
public_idstringRequired.
ParameterTypeDescription
zone_idstring (uuid) or null
versioninteger or nullThe version of the policy the caller read; required of an agent (OAuth) caller.
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.
FieldTypeDescription
public_idstringRequired.
retired_atstring or null
statusstringRequired.
{
"public_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10",
"retired_at": "2026-01-15T14:32:05Z",
"status": "string"
}