Rejection rules are JavaScript expressions that let Nadles API Gateway decide, whether current request should be rejected. If an expression evaluates to true, Nadles API Gateway will reject the request. Itβs useful for implementing premium features and impose limitations on input parameters. Some use cases for rejection rules: Reject request if:Documentation Index
Fetch the complete documentation index at: https://docs.nadles.com/llms.txt
Use this file to discover all available pages before exploring further.
-
The customer tries to request more than 100 elements:
request.query.num > 100 -
The customer tries to request more than 10 pages of results:
request.query.page > 10 -
Number of elements in the input JSON array is bigger than 50:
JSON.parse(request.body).batch.length > 50
Add rejection rule
- Navigate to Products β choose a product β Limits.
-
Click Add rejection rule.

- Enter the expression, select the endpoints this rule applies to, and click Save.
- The rejection rule is now added to the product.
Expression variables
There is a number of variables that can be used in the expression. Note that response variables are not available, since rejection rules are evaluated before proxying the request.Path parameters
path.params.* β placeholder values specified in the endpoint URL.
ExampleIf an endpoint URL is
/resource/{resourceId}and the HTTP request URL is /resource/801d49c2-ca05-42b1-97af-baf0ddf36ba3,then there will be a variable path.params.resourceId with value "801d49c2-ca05-42b1-97af-baf0ddf36ba3".Client IP address
request.remote_addr β Client IP address.
Request headers
request.headers['header-name'] β Request header values.
Example
Request query string parameters
request.query['query_string_parameter_name'] β Request query string parameters.
Example
Request body
request.body β Request body.
Example