Ana içeriğe atla

Endpoint

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

Authentication

Requires a Personal API Access Token.
Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer Yes
Content-Typeapplication/jsonYes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject 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

FieldTypeRequiredDefaultDescription
namestringYes-RLCL name (unique identifier within project)
descriptionstringNo-RLCL description
enabledbooleanNotrueWhether the RLCL is enabled
executionOrderstringNoFIRSTExecution order. See EnumExecutionOrder
cacheConnectionTimeoutInSecondsintegerNo3Cache connection timeout in seconds
cacheErrorHandlingTypestringNoFAILCache error handling type. See EnumCacheErrorHandlingType
timeIntervalWindowTypestringNoFIXEDTime interval window type. See EnumIntervalWindowType
showRateLimitStatisticsInResponseHeaderbooleanNofalseShow rate limit statistics in response header
targetVariableobject|nullNonullTarget 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.
FieldTypeRequiredDescription
namestringYesVariable name (unique identifier)
descriptionstringNoVariable description
typestringYesVariable type. See Variable Types
headerNamestringNo*Header name (required if type=HEADER)
paramTypestringNo*Parameter type (required if type=PARAMETER). See EnumVariableParameterType
paramNamestringNo*Parameter name (required if type=PARAMETER)
paramPathstringNo*Parameter path template (required if type=PARAMETER and paramType=PATH)
formNamestringNoForm field name (optional, used if paramType=FORM)
messageContentTypestringNo*Message content type (required if type=BODY). See EnumMessageContentType
xpathValuestringNo*XPath expression (required if type=BODY and messageContentType=XML)
jsonPathValuestringNo*JsonPath expression (required if type=BODY and messageContentType=JSON)
contextValuestringNo*Context value (required if type=CONTEXT_VALUES). See EnumVariableContextValue
zoneIdstringNo*Time zone ID (required for date/time context values)
initWithScriptbooleanNofalseWhether to initialize with script (default: false)
scriptLanguagestringNo*Script language (required if type=CUSTOM or initWithScript=true). See EnumScriptType
scriptBodystringNo*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

  • User must have IDENTITY + MANAGE permission in the project