Search + K

Command Palette

Search for a command to run...

Sign In

Update a rate limit

Deprecated
PUT /zones/{zone_id}/rate_limits/{rate_limit_id}
Copy endpoint
https://api.cloudflare.com/client/v4

Updates an existing rate limit.

Parameters

path Path Parameters

Name Type
rate_limit_id required
type FirewallRateLimitId = string
zone_id required
type FirewallIdentifier = string

Request Body

application/json required
{
action: FirewallAction

The action to perform when the threshold of matched traffic within the configured period is exceeded.

interface FirewallAction {
mode?: FirewallMode;
response?: FirewallCustomResponse;
timeout?: FirewallTimeout;
}
;
match: FirewallMatch

Determines which traffic the rate limit counts towards the threshold.

interface FirewallMatch {
headers?: { name?: FirewallHeaderName;op?: FirewallHeaderOp;value?: FirewallHeaderValue; }[];
request?: { methods?: FirewallMethods;schemes?: FirewallSchemes;url?: FirewallUrl; };
response?: { origin_traffic?: FirewallOriginTraffic; };
}
;
period: FirewallPeriod

The time in seconds (an integer value) to count matching traffic. If the count exceeds the configured threshold within this period, Cloudflare will perform the configured action.

type FirewallPeriod = number
;
threshold: FirewallThreshold

The threshold that will trigger the configured mitigation action. Configure this value along with the period property to establish a threshold per period.

type FirewallThreshold = number
;
}

Responses

200 application/json

Update a rate limit response.

type FirewallRatelimitResponseSingle = type FirewallApiResponseSingle = never & { result?: FirewallRateLimits
type FirewallRateLimits = FirewallRatelimit & {}
; }

Client Errors

4XX application/json

Update a rate limit response failure.

type FirewallRatelimitResponseSingle = type FirewallApiResponseSingle = never & { result?: FirewallRateLimits
type FirewallRateLimits = FirewallRatelimit & {}
; }
& interface FirewallApiResponseCommonFailure {
errors: FirewallMessages
type FirewallMessages = { code: number;message: string; }[]
;
messages: FirewallMessages
type FirewallMessages = { code: number;message: string; }[]
;
result: null;
success: false;
}