Guard Packs
POST
/v1/orgs/{org_id}/packs/removeRemove 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/sdkPath parameters
| Name | Type | Required | Description |
|---|---|---|---|
| org_id#path | string | required | — |
Header parameters
| Name | Type | Required | Description |
|---|---|---|---|
| X-API-Key#header | string | null | optional | — |
| authorization#header | string | null | optional | — |
Request bodyrequired
| Field | Type | Required | Description |
|---|---|---|---|
| pack_id | string | required | — |
| target_scope | ApplyPackTargetScope | required | — |
Responses
| Status | Description |
|---|---|
| 200 | Successful Response |
| 422 | Validation Error |
Response schema
any
Errors & what triggers them
| Code | Trigger | Fix |
|---|---|---|
| 404 | pack_id does not exist in the catalog. | — |
| 422 | target_scope is malformed (missing app_id, invalid env). | — |
| 500 | Policy 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