Platform API reference

Platform API · Workspace-Policies

delete/v1/workspaces/{workspace_slug}/policies/{policy_id}Auth

Delete 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*string

Slug 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 · uuid

Id of the policy.

Response · 200 Policy deleted. `bound_key_count` is the number of live API keys that lost the binding.

id*string · uuid

The deleted policy.

deleted*boolean

Always `true`: the policy is gone.

Example: true

bound_key_count*number

Live 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_TOKEN

Response

{
  "id": "00000000-0000-0000-0000-000000000000",
  "deleted": true,
  "bound_key_count": 3
}