DELETE
/approval-policies/{policyId}Delete Approval Policy
Permanently deletes a draft policy bundle identified by policyId.
Deletion is permitted only while the bundle is in draft status; attempting to delete a published or superseded bundle returns K9O_POLICY_PUBLISH_CONFLICT (409).
Returns K9O_POLICY_NOT_FOUND (404) if policyId does not resolve to a bundle in the project.
Requires PROJECT_ADMIN.
Parameters
| policyId * | path | The approval policy id ( The |
| projectSlug * | path | The project's slug: the path segment after It is unique within the org. |
Responses
| HTTP | K9O Code | Description |
|---|---|---|
| 200 | Success | |
| 401 | K9O_SESSION_EXPIRED | The caller's session token is expired or invalid; re-authenticate to continue. |
| 403 | K9O_ACCESS_DENIED | The caller does not hold the required role to delete this approval policy. |
| 403 | K9O_POLICY_AUTHORING_AUTHORITY_INSUFFICIENT | The caller's role is not authorised under the org-policy constraint to remove the approval rule for the targeted collection and operation scope. |
| 404 | K9O_POLICY_NOT_FOUND | No approval policy with the supplied identifier exists in this project. |
Response body (200)
| data * | object | The approval policy that was deleted. |
| id * | string | The id of the deleted policy ( |
| meta * | any |
TypeScript
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.approvalPolicies.delete('apo_demo00000001')Showing example in TypeScript
Response example (200)
{
"data": {
"id": "string"
}
}