Skip to main content
DELETE/policies/{bundleId}

Delete Policy Draft

Deletes a draft policy bundle.

Only draft-status bundles may be deleted; attempts to delete a published or superseded bundle return K9O_POLICY_PUBLISH_CONFLICT (409).

Requires PROJECT_ADMIN.

Published and superseded bundles are retained for audit and cannot be deleted.

Parameters
bundleId *path

The policy bundle id (pol_...).

The pol_ prefix may be left out.

projectSlug *path

The project's slug: the path segment after @.

It is unique within the org.

Responses
HTTPK9O CodeDescription
204The draft was deleted. No body.
401K9O_SESSION_EXPIREDThe caller's session token is expired or invalid; re-authenticate to continue.
403K9O_ACCESS_DENIEDThe caller does not hold PROJECT_ADMIN role, which is required to delete a policy bundle.
404K9O_POLICY_NOT_FOUNDNo policy bundle with the supplied identifier exists in this project.
409K9O_POLICY_PUBLISH_CONFLICTThe bundle is published or superseded and cannot be deleted; only draft bundles may be removed.
TypeScript
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.policies.delete('pol_demo00000001')

Showing example in TypeScript

More in Policy & Approvals