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".
Bearer token or X-API-Keyscope: org memberoperation_id: packs.remove
Authentication
Send either Authorization: Bearer <token> or X-API-Key: <token>. Any org token with sufficient scope. Create tokens from the console or the /v1/orgs/{org_id}/tokens endpoints. Requests without a valid credential are rejected with 401.
SDK install
pip install znyx-sdknpm install @znyx/sdkCode samples
Request
curl -X POST "$ZNYX_API_URL/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
Path 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. |