v3

latestOpenAPI 3.1.02026-07-311,4541,5202.3 MB
platformApi

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.

post/api/limit-policies/

Headers

Authorizationstring required

JWT access token or Respan API key

Request body

projectstring nullable
namestring
scopestring
scope_valuestring required
composestring[]
metric'cost' | 'request_count' | 'token_count'
  • cost - Cost
  • request_count - Request count
  • token_count - Token count
algorithm'balance_fixed_window' | 'token_bucket'
  • balance_fixed_window - Balance fixed window
  • token_bucket - Token bucket
periodstring nullable
effective_atstring date-time nullable
expires_atstring date-time nullable
anchor'calendar' | 'first_event' | 'explicit_ts'
  • calendar - Calendar
  • first_event - First event
  • explicit_ts - Explicit timestamp
anchor_atstring date-time nullable
refill_ratenumber double nullable
rulesobject[]
priorityinteger
is_activeboolean
include_existing_usageboolean

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

idstring required
namestring required
scopestring required
scope_valuestring required
composestring[] required
metric'cost' | 'request_count' | 'token_count' required
  • cost - Cost
  • request_count - Request count
  • token_count - Token count
algorithm'balance_fixed_window' | 'token_bucket' required
  • balance_fixed_window - Balance fixed window
  • token_bucket - Token bucket
periodstring nullable required
effective_atstring date-time nullable required
expires_atstring date-time nullable required
priorityinteger required
is_activeboolean required
threshold_valuenumber double required
meter_definition_idstring required
created_atstring date-time required
updated_atstring date-time required
rulesobject[] required
anchor'calendar' | 'first_event' | 'explicit_ts' required
  • calendar - Calendar
  • first_event - First event
  • explicit_ts - Explicit timestamp
anchor_atstring date-time nullable required
refill_ratenumber double nullable required