Fetches the rate limits for a zone.
/zones/{zone_identifier}/rate_limits
get
Rate limits for a zone
rate-limits-for-a-zone-list-rate-limits
{
"business": true,
"enterprise": true,
"free": true,
"pro": true
} null [
{
"in": "path",
"name": "zone_identifier",
"required": true,
"schema": {
"description": "Identifier",
"example": "023e105f4ecef8ad9ca31a8372d0c353",
"maxLength": 32,
"readOnly": true,
"type": "string"
}
},
{
"in": "query",
"name": "page",
"schema": {
"default": 1,
"description": "The page number of paginated results.",
"minimum": 1,
"type": "number"
}
},
{
"in": "query",
"name": "per_page",
"schema": {
"default": 20,
"description": "The maximum number of results per page. You can only set the value to `1` or to a multiple of 5 such as `5`, `10`, `15`, or `20`.",
"maximum": 1000,
"minimum": 1,
"type": "number"
}
}
] null {
"200": {
"content": {
"application/json": {
"schema": {
"allOf": [
{
"allOf": [
{
"properties": {
"errors": {
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
},
"messages": {
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
},
"result": {
"anyOf": [
{
"type": "object"
},
{
"items": {},
"type": "array"
},
{
"type": "string"
}
]
},
"success": {
"description": "Whether the API call was successful",
"enum": [
true
],
"example": true,
"type": "boolean"
}
},
"required": [
"success",
"errors",
"messages",
"result"
],
"type": "object"
},
{
"properties": {
"result": {
"items": {},
"nullable": true,
"type": "array"
},
"result_info": {
"properties": {
"count": {
"description": "Total number of results for the requested service",
"example": 1,
"type": "number"
},
"page": {
"description": "Current page within paginated list of results",
"example": 1,
"type": "number"
},
"per_page": {
"description": "Number of results per page of results",
"example": 20,
"type": "number"
},
"total_count": {
"description": "Total results available without any search parameters",
"example": 2000,
"type": "number"
}
},
"type": "object"
}
}
}
],
"type": "object"
},
{
"properties": {
"result": {
"items": {
"allOf": [
{
"properties": {
"action": {
"anyOf": [
{
"properties": {
"mode": {
"description": "The action to perform.",
"enum": [
"simulate",
"ban",
"challenge",
"js_challenge",
"managed_challenge"
],
"example": "challenge",
"type": "string"
},
"response": {
"anyOf": [
{
"properties": {
"body": {
"description": "The response body to return. The value must conform to the configured content type.",
"example": "<error>This request has been rate-limited.</error>",
"maxLength": 10240,
"type": "string"
},
"content_type": {
"description": "The content type of the body. Must be one of the following: `text/plain`, `text/xml`, or `application/json`.",
"example": "text/xml",
"maxLength": 50,
"type": "string"
}
},
"type": "object"
}
],
"description": "A custom content type and reponse to return when the threshold is exceeded. The custom response configured in this object will override the custom error for the zone. This object is optional.\nNotes: If you omit this object, Cloudflare will use the default HTML error page. If \"mode\" is \"challenge\", \"managed_challenge\", or \"js_challenge\", Cloudflare will use the zone challenge pages and you should not provide the \"response\" object.",
"type": "object"
},
"timeout": {
"description": "The time in seconds during which Cloudflare will perform the mitigation action. Must be an integer value greater than or equal to the period.\nNotes: If \"mode\" is \"challenge\", \"managed_challenge\", or \"js_challenge\", Cloudflare will use the zone's Challenge Passage time and you should not provide this value.",
"example": 86400,
"maximum": 86400,
"minimum": 1,
"type": "number"
}
},
"type": "object"
}
],
"description": "The action to perform when the threshold of matched traffic within the configured period is exceeded.",
"type": "object"
},
"bypass": {
"description": "Criteria specifying when the current rate limit should be bypassed. You can specify that the rate limit should not apply to one or more URLs.",
"items": {
"properties": {
"name": {
"enum": [
"url"
],
"example": "url",
"type": "string"
},
"value": {
"description": "The URL to bypass.",
"example": "api.example.com/*",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"description": {
"description": "An informative summary of the rate limit. This value is sanitized and any tags will be removed.",
"example": "Prevent multiple login failures to mitigate brute force attacks",
"maxLength": 1024,
"type": "string"
},
"disabled": {
"description": "When true, indicates that the rate limit is currently disabled.",
"example": false,
"type": "boolean"
},
"id": {
"description": "The unique identifier of the rate limit.",
"example": "372e67954025e0ba6aaa6d586b9e0b59",
"maxLength": 32,
"readOnly": true,
"type": "string"
},
"match": {
"description": "Determines which traffic the rate limit counts towards the threshold.",
"oneOf": [
{
"properties": {
"headers": {
"items": {
"properties": {
"name": {
"description": "The name of the response header to match.",
"example": "Cf-Cache-Status",
"type": "string"
},
"op": {
"description": "The operator used when matching: `eq` means \"equal\" and `ne` means \"not equal\".",
"enum": [
"eq",
"ne"
],
"example": "ne",
"type": "string"
},
"value": {
"description": "The value of the response header, which must match exactly.",
"example": "HIT",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"request": {
"properties": {
"methods": {
"description": "The HTTP methods to match. You can specify a subset (for example, `['POST','PUT']`) or all methods (`['_ALL_']`). This field is optional when creating a rate limit.",
"example": [
"GET",
"POST"
],
"items": {
"description": "An HTTP method or `_ALL_` to indicate all methods.",
"enum": [
"GET",
"POST",
"PUT",
"DELETE",
"PATCH",
"HEAD",
"_ALL_"
],
"example": "GET",
"type": "string"
},
"type": "array"
},
"schemes": {
"description": "The HTTP schemes to match. You can specify one scheme (`['HTTPS']`), both schemes (`['HTTP','HTTPS']`), or all schemes (`['_ALL_']`). This field is optional.",
"example": [
"HTTP",
"HTTPS"
],
"items": {
"description": "An HTTP scheme or `_ALL_` to indicate all schemes.",
"example": "HTTPS",
"type": "string"
},
"type": "array"
},
"url": {
"description": "The URL pattern to match, composed of a host and a path such as `example.org/path*`. Normalization is applied before the pattern is matched. `*` wildcards are expanded to match applicable traffic. Query strings are not matched. Set the value to `*` to match all traffic to your zone.",
"example": "*.example.org/path*",
"maxLength": 1024,
"type": "string"
}
},
"type": "object"
},
"response": {
"properties": {
"origin_traffic": {
"description": "When true, only the uncached traffic served from your origin servers will count towards rate limiting. In this case, any cached traffic served by Cloudflare will not count towards rate limiting. This field is optional.\nNotes: This field is deprecated. Instead, use response headers and set \"origin_traffic\" to \"false\" to avoid legacy behaviour interacting with the \"response_headers\" property.",
"type": "boolean"
}
},
"type": "object"
}
},
"type": "object"
}
],
"type": "object"
},
"period": {
"description": "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.",
"example": 900,
"maximum": 86400,
"minimum": 10,
"type": "number"
},
"threshold": {
"description": "The threshold that will trigger the configured mitigation action. Configure this value along with the `period` property to establish a threshold per period.",
"example": 60,
"minimum": 1,
"type": "number"
}
}
}
],
"type": "object"
},
"type": "array"
}
},
"type": "object"
}
]
}
}
},
"description": "List rate limits response"
},
"4xx": {
"content": {
"application/json": {
"schema": {
"allOf": [
{
"allOf": [
{
"allOf": [
{
"properties": {
"errors": {
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
},
"messages": {
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
},
"result": {
"anyOf": [
{
"type": "object"
},
{
"items": {},
"type": "array"
},
{
"type": "string"
}
]
},
"success": {
"description": "Whether the API call was successful",
"enum": [
true
],
"example": true,
"type": "boolean"
}
},
"required": [
"success",
"errors",
"messages",
"result"
],
"type": "object"
},
{
"properties": {
"result": {
"items": {},
"nullable": true,
"type": "array"
},
"result_info": {
"properties": {
"count": {
"description": "Total number of results for the requested service",
"example": 1,
"type": "number"
},
"page": {
"description": "Current page within paginated list of results",
"example": 1,
"type": "number"
},
"per_page": {
"description": "Number of results per page of results",
"example": 20,
"type": "number"
},
"total_count": {
"description": "Total results available without any search parameters",
"example": 2000,
"type": "number"
}
},
"type": "object"
}
}
}
],
"type": "object"
},
{
"properties": {
"result": {
"items": {
"allOf": [
{
"properties": {
"action": {
"anyOf": [
{
"properties": {
"mode": {
"description": "The action to perform.",
"enum": [
"simulate",
"ban",
"challenge",
"js_challenge",
"managed_challenge"
],
"example": "challenge",
"type": "string"
},
"response": {
"anyOf": [
{
"properties": {
"body": {
"description": "The response body to return. The value must conform to the configured content type.",
"example": "<error>This request has been rate-limited.</error>",
"maxLength": 10240,
"type": "string"
},
"content_type": {
"description": "The content type of the body. Must be one of the following: `text/plain`, `text/xml`, or `application/json`.",
"example": "text/xml",
"maxLength": 50,
"type": "string"
}
},
"type": "object"
}
],
"description": "A custom content type and reponse to return when the threshold is exceeded. The custom response configured in this object will override the custom error for the zone. This object is optional.\nNotes: If you omit this object, Cloudflare will use the default HTML error page. If \"mode\" is \"challenge\", \"managed_challenge\", or \"js_challenge\", Cloudflare will use the zone challenge pages and you should not provide the \"response\" object.",
"type": "object"
},
"timeout": {
"description": "The time in seconds during which Cloudflare will perform the mitigation action. Must be an integer value greater than or equal to the period.\nNotes: If \"mode\" is \"challenge\", \"managed_challenge\", or \"js_challenge\", Cloudflare will use the zone's Challenge Passage time and you should not provide this value.",
"example": 86400,
"maximum": 86400,
"minimum": 1,
"type": "number"
}
},
"type": "object"
}
],
"description": "The action to perform when the threshold of matched traffic within the configured period is exceeded.",
"type": "object"
},
"bypass": {
"description": "Criteria specifying when the current rate limit should be bypassed. You can specify that the rate limit should not apply to one or more URLs.",
"items": {
"properties": {
"name": {
"enum": [
"url"
],
"example": "url",
"type": "string"
},
"value": {
"description": "The URL to bypass.",
"example": "api.example.com/*",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"description": {
"description": "An informative summary of the rate limit. This value is sanitized and any tags will be removed.",
"example": "Prevent multiple login failures to mitigate brute force attacks",
"maxLength": 1024,
"type": "string"
},
"disabled": {
"description": "When true, indicates that the rate limit is currently disabled.",
"example": false,
"type": "boolean"
},
"id": {
"description": "The unique identifier of the rate limit.",
"example": "372e67954025e0ba6aaa6d586b9e0b59",
"maxLength": 32,
"readOnly": true,
"type": "string"
},
"match": {
"description": "Determines which traffic the rate limit counts towards the threshold.",
"oneOf": [
{
"properties": {
"headers": {
"items": {
"properties": {
"name": {
"description": "The name of the response header to match.",
"example": "Cf-Cache-Status",
"type": "string"
},
"op": {
"description": "The operator used when matching: `eq` means \"equal\" and `ne` means \"not equal\".",
"enum": [
"eq",
"ne"
],
"example": "ne",
"type": "string"
},
"value": {
"description": "The value of the response header, which must match exactly.",
"example": "HIT",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"request": {
"properties": {
"methods": {
"description": "The HTTP methods to match. You can specify a subset (for example, `['POST','PUT']`) or all methods (`['_ALL_']`). This field is optional when creating a rate limit.",
"example": [
"GET",
"POST"
],
"items": {
"description": "An HTTP method or `_ALL_` to indicate all methods.",
"enum": [
"GET",
"POST",
"PUT",
"DELETE",
"PATCH",
"HEAD",
"_ALL_"
],
"example": "GET",
"type": "string"
},
"type": "array"
},
"schemes": {
"description": "The HTTP schemes to match. You can specify one scheme (`['HTTPS']`), both schemes (`['HTTP','HTTPS']`), or all schemes (`['_ALL_']`). This field is optional.",
"example": [
"HTTP",
"HTTPS"
],
"items": {
"description": "An HTTP scheme or `_ALL_` to indicate all schemes.",
"example": "HTTPS",
"type": "string"
},
"type": "array"
},
"url": {
"description": "The URL pattern to match, composed of a host and a path such as `example.org/path*`. Normalization is applied before the pattern is matched. `*` wildcards are expanded to match applicable traffic. Query strings are not matched. Set the value to `*` to match all traffic to your zone.",
"example": "*.example.org/path*",
"maxLength": 1024,
"type": "string"
}
},
"type": "object"
},
"response": {
"properties": {
"origin_traffic": {
"description": "When true, only the uncached traffic served from your origin servers will count towards rate limiting. In this case, any cached traffic served by Cloudflare will not count towards rate limiting. This field is optional.\nNotes: This field is deprecated. Instead, use response headers and set \"origin_traffic\" to \"false\" to avoid legacy behaviour interacting with the \"response_headers\" property.",
"type": "boolean"
}
},
"type": "object"
}
},
"type": "object"
}
],
"type": "object"
},
"period": {
"description": "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.",
"example": 900,
"maximum": 86400,
"minimum": 10,
"type": "number"
},
"threshold": {
"description": "The threshold that will trigger the configured mitigation action. Configure this value along with the `period` property to establish a threshold per period.",
"example": 60,
"minimum": 1,
"type": "number"
}
}
}
],
"type": "object"
},
"type": "array"
}
},
"type": "object"
}
]
},
{
"properties": {
"errors": {
"allOf": [
{
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
}
],
"example": [
{
"code": 7003,
"message": "No route for the URI"
}
],
"minLength": 1
},
"messages": {
"allOf": [
{
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
}
],
"example": []
},
"result": {
"enum": [
null
],
"nullable": true,
"type": "object"
},
"success": {
"description": "Whether the API call was successful",
"enum": [
false
],
"example": false,
"type": "boolean"
}
},
"required": [
"success",
"errors",
"messages",
"result"
],
"type": "object"
}
]
}
}
},
"description": "List rate limits response failure"
}
} [
{
"api_email": [],
"api_key": []
},
{
"api_token": []
}
]