/v1/workspaces/{workspace_slug}/policies/{policy_id}AuthDelete a managed policy. Cascades: API keys lose the binding (deny-all if no other bindings remain); roles fall back to their inline policy column. Owners and admins; a policy bound to a role, or a preset policy, only an owner can delete. Cookie/JWT only.
Path parameters
workspace_slug*stringSlug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve("acme")`); the product APIs bind `workspace_id` instead.
policy_id*string · uuidId of the policy.
Response · 200 Policy deleted. `bound_key_count` is the number of live API keys that lost the binding.
id*string · uuidThe deleted policy.
deleted*booleanAlways `true`: the policy is gone.
Example: true
bound_key_count*numberLive API keys that were bound to the policy and lost the binding. A key with no binding left falls back to deny-all.
Example: 3
Example
Request
DELETE https://api.platform-auth.productcraft.co/v1/workspaces/{workspace_slug}/policies/{policy_id}
Authorization: Bearer YOUR_TOKENResponse
{
"id": "00000000-0000-0000-0000-000000000000",
"deleted": true,
"bound_key_count": 3
}