Skip to main content

Guard Packs

POST/v1/orgs/{org_id}/packs/remove

Remove Pack

Undo a previous apply for a (pack, scope) pair. Flips off every detector the pack enabled in that scope's policy, drops any non-detector keys the pack injected (quality_scoring et al.), and deletes the pack-application history rows so the UI flips back to "Apply".

CI or Admin tokenscope: writeoperation_id: packs.remove

Authentication

Requires a CI- or admin-level token. Runtime tokens are rejected for mutations.

SDK install

pip install znyx-sdknpm install @znyx/sdk

Path parameters

NameTypeRequiredDescription
org_id#pathstringrequired

Header parameters

NameTypeRequiredDescription
X-API-Key#headerstring | nulloptional
authorization#headerstring | nulloptional

Request bodyrequired

FieldTypeRequiredDescription
pack_idstringrequired
target_scopeApplyPackTargetScoperequired

Responses

StatusDescription
200Successful Response
422Validation Error

Response schema

any

Errors & what triggers them

CodeTriggerFix
404pack_id does not exist in the catalog.
422target_scope is malformed (missing app_id, invalid env).
500Policy write failed after the pack was resolved.The endpoint is transactional — the pack install count is only incremented if the policy write succeeded. Retry is safe.

Request

curl -X POST 'https://api.znyx.ai/v1/orgs/00000000-0000-0000-0000-000000000000/packs/remove' \
  -H 'Authorization: Bearer $ZNYX_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "pack_id": "string",
  "target_scope": {
    "tenant_id": null,
    "app_id": "string",
    "agent_id": "default",
    "env": "prod"
  }
}'

Response

application/json

Successful Response

null

Schema: any