Skip to main content

ListPolicies

GET 

/v1/policy/policies

ListPolicies returns a UNIFIED, read-only, paginated list of every PROJECT- or TAG-targeted policy across all policy types (budget, rate-limit, fallback-chain, traffic-split) for the caller's tenant (fraser#5448, item 5.2 -- the unified Policies area). This is a read-model composed on top of the existing type-specific repositories; it introduces no new write path -- creating/updating/deleting a policy still goes through the type-specific RPCs above (CreateBudgetPolicy, CreateRateLimitPolicy, CreateFallbackChainPolicy, CreateTrafficSplitPolicy, and their Update/Delete/SetStatus siblings).

KEY-targeted policies (BudgetPolicy/RateLimitPolicy scope_type = POLICY_SCOPE_TYPE_API_KEY, or a FallbackChainPolicy/TrafficSplitPolicy target_scope_type = POLICY_TARGET_SCOPE_TYPE_KEY) are deliberately EXCLUDED from this list -- they remain scoped to the owning API key's config page. TEAM/TEAM_PER_USER_DEFAULT/TEAM_PER_KEY_DEFAULT/USER/ SYSTEM/CUSTOMER-scoped BudgetPolicy and SYSTEM-scoped RateLimitPolicy rows are also excluded: this surface is specifically "every policy that targets a project or a tag selector", not every policy that exists.

UnifiedPolicy.match_count reports how many API keys the policy's target currently resolves to: for a TAG target this is the same tagselector.Count query GetPolicyCoverage already runs; for a PROJECT target it is a count of that project's API keys.

Request

Responses

Success