Create RLCL

Overview

Creates a new Rate Limit Control List (RLCL). RLCLs allow you to define rate limiting rules for credentials and API endpoints, controlling how many requests can be made within a specific time period.

Endpoint

POST /apiops/projects/{projectName}/rlcl/

Authentication

Requires a Personal API Access Token.

Authorization: Bearer YOUR_TOKEN

Request

Headers

Header Value Required
Authorization Bearer {token} Yes
Content-Type application/json Yes

Path Parameters

Parameter Type Required Description
projectName string Yes Project name

Request Body

Full JSON Body Example - Basic RLCL

{
  "name": "PremiumUserRLCL",
  "description": "Rate limit for premium users",
  "enabled": true,
  "executionOrder": "FIRST",
  "cacheConnectionTimeoutInSeconds": 3,
  "cacheErrorHandlingType": "FAIL",
  "timeIntervalWindowType": "FIXED",
  "showRateLimitStatisticsInResponseHeader": false,
  "targetVariable": null
}

Full JSON Body Example - RLCL with Target Variable

{
  "name": "IPBasedRLCL",
  "description": "Rate limit based on IP address",
  "enabled": true,
  "executionOrder": "FIRST",
  "cacheConnectionTimeoutInSeconds": 5,
  "cacheErrorHandlingType": "CONTINUE",
  "timeIntervalWindowType": "SLIDING",
  "showRateLimitStatisticsInResponseHeader": true,
  "targetVariable": {
    "name": "clientIp",
    "type": "CONTEXT_VALUES",
    "contextValue": "REQUEST_REMOTE_ADDRESS"
  }
}

Request Body Fields

Field Type Required Default Description
name string Yes - RLCL name (unique identifier within project)
description string No - RLCL description
enabled boolean No true Whether the RLCL is enabled
executionOrder string No FIRST Execution order. See EnumExecutionOrder
cacheConnectionTimeoutInSeconds integer No 3 Cache connection timeout in seconds
cacheErrorHandlingType string No FAIL Cache error handling type. See EnumCacheErrorHandlingType
timeIntervalWindowType string No FIXED Time interval window type. See EnumIntervalWindowType
showRateLimitStatisticsInResponseHeader boolean No false Show rate limit statistics in response header
targetVariable object|null No null Target variable for rate limiting. See Variable Object

EnumExecutionOrder (executionOrder)

  • FIRST - Execute first (before other RLCLs)
  • LAST - Execute last (after other RLCLs)

EnumCacheErrorHandlingType (cacheErrorHandlingType)

  • FAIL - Fail the request if cache error occurs
  • CONTINUE - Continue processing if cache error occurs

EnumIntervalWindowType (timeIntervalWindowType)

  • FIXED - Fixed time interval window
  • SLIDING - Sliding time interval window

Variable Object (targetVariable)

See Variable Definition for complete variable documentation.

Field Type Required Description  
name string Yes Variable name (unique identifier)  
description string No Variable description  
type string Yes Variable type. See Variable Types  
headerName string No* Header name (required if type=HEADER)  
paramType string No* Parameter type (required if type=PARAMETER). See EnumVariableParameterType  
paramName string No* Parameter name (required if type=PARAMETER)  
paramPath string No* Parameter path template (required if type=PARAMETER and paramType=PATH)  
formName string No Form field name (optional, used if paramType=FORM)  
messageContentType string No* Message content type (required if type=BODY). See EnumMessageContentType  
xpathValue string No* XPath expression (required if type=BODY and messageContentType=XML)  
jsonPathValue string No* JsonPath expression (required if type=BODY and messageContentType=JSON)  
contextValue string No* Context value (required if type=CONTEXT_VALUES). See EnumVariableContextValue  
zoneId string No* Time zone ID (required for date/time context values)  
initWithScript boolean No false Whether to initialize with script (default: false)
scriptLanguage string No* Script language (required if type=CUSTOM or initWithScript=true). See EnumScriptType  
scriptBody string No* Script body (required if type=CUSTOM or initWithScript=true)  

Notes

  • name must be unique within the project
  • name must not be empty
  • RLCL is created empty (no credentials or endpoints)
  • Use Add Credentials and Add Endpoints endpoints to configure the RLCL

Response

Success Response (200 OK)

{
  "success": true
}

Error Response (400 Bad Request)

{
  "error": "bad_request",
  "error_description": "name value can not be empty!"
}

or

{
  "error": "bad_request",
  "error_description": "An RLCL with same name (PremiumUserRLCL) already exists in project!"
}

cURL Example

curl -X POST \
  "https://demo.apinizer.com/apiops/projects/MyProject/rlcl/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "PremiumUserRLCL",
    "description": "Rate limit for premium users",
    "enabled": true,
    "executionOrder": "FIRST",
    "cacheConnectionTimeoutInSeconds": 3,
    "cacheErrorHandlingType": "FAIL",
    "timeIntervalWindowType": "FIXED",
    "showRateLimitStatisticsInResponseHeader": false
  }'

Notes and Warnings

  • Name Uniqueness:
    • RLCL name must be unique within the project
    • If name already exists, creation will fail
  • Empty RLCL:
    • RLCL is created empty (no credentials or endpoints)
    • Use Add Credentials and Add Endpoints endpoints to configure
  • Target Variable:
    • Target variable defines what to rate limit (e.g., IP address, user ID)
    • If null, rate limiting is applied per credential
  • Permissions:
    • Requires ROLE_MANAGE_PROXIES permission
    • User must have access to the project