Aller au contenu

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.

Fenêtre de terminal
curl --fail-with-body -X DELETE 'https://app.openlatch.ai/api/public/v1/policies/<policy_public_id>' \
-H "Authorization: Bearer $OPENLATCH_API_KEY"
Rôle dans l’organisationCe point de terminaison
ownerAutorisé
adminAutorisé
editorAutorisé
viewerNon autorisé

Une clé porte le rôle que son propriétaire détient dans l’organisation. Voir Authentification.

Portée de clé d’API : policies:write

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