Api Limit Policies Create
POST handler with superadmin-only field protection.
Strips superadmin-only fields from non-superadmin requests before delegating to OrganizationInjectionMixin.post() for org injection.
Authentication
Request
cost- Costrequest_count- Request counttoken_count- Token count
balance_fixed_window- Balance fixed windowtoken_bucket- Token bucket
calendar- Calendarfirst_event- First eventexplicit_ts- Explicit timestamp
When true on creation, SUMs matching CHLogV3 history into the live counter so the cap starts at the historical total. For lifetime policies (period=null) the SUM covers all history up to creation time. For rolling policies the SUM covers only the current window — when the window rolls over the seeded counter naturally ages out and the next window starts fresh. Idempotent via the row’s seeded_at audit column.
Response
cost- Costrequest_count- Request counttoken_count- Token count
balance_fixed_window- Balance fixed windowtoken_bucket- Token bucket
Live counter state for the policy’s current window. Sourced from Redis (same key apply_limits evaluates against). Populated by the view’s bulk prefetch on list responses; falls back to a single HGET on detail.
calendar- Calendarfirst_event- First eventexplicit_ts- Explicit timestamp