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".

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/sdk

Code 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

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.