SnykOrgPolicy

Model for Snyk Organization Policies.

  1. Overview

Overview

This model represents policies at the organization level in Snyk. Org policies are used for Code Consistent Ignores.

Uses the Snyk v2 REST API endpoint: /orgs/{org_id}/policies

import clearskies
from clearskies_snyk.models import SnykOrgPolicy


def my_handler(snyk_org_policy: SnykOrgPolicy):
    # Fetch all policies for an organization
    policies = snyk_org_policy.where("org_id=org-id-123")
    for policy in policies:
        print(f"Policy: {policy.name} ({policy.action_type})")

    # Access the parent organization
    print(f"Org: {policy.org.name}")