PUT /v1/traffic/policies/{code}
TrafficService_PutRateLimitPolicy
The server validates credentials, tenant, environment and permissions. This page does not send requests. Replace example values; deployed server validation remains authoritative.
Parameters
codepath · string · required
Request body
algorithmstringFIXED_WINDOW is the compatibility default. TOKEN_BUCKET refills evenly during window_seconds and permits short bursts up to limit_count. SLIDING_WINDOW enforces an exact rolling window using an opaque Redis ZSET.
codestringdimensionstringdimension_valuestringlimit_countstringstatusstringunit_modestringREQUEST counts calls. TOKEN consumes a server-derived token/cost estimate; public traffic:check calls remain request-weighted by design.
window_secondsinteger · int32
cURL
curl --request PUT 'https://nexus-api.rainlib.com/v1/traffic/policies/{code}' \
--header 'Authorization: Bearer <NEXUS_ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"algorithm": "<value>",
"dimension": "<value>",
"dimension_value": "<value>",
"limit_count": "<value>",
"status": "<value>",
"unit_mode": "<value>",
"window_seconds": 0
}'Response contract
200 · OK
algorithmstringcodestringdimensionstringdimension_valuestringidstringlimit_countstringstatusstringunit_modestringupdated_atstringversionstringwindow_secondsinteger · int32
Generated responses do not enumerate every runtime error. See the integration guide for authentication, conflicts and retries.