Add Endpoints to RLCL

Overview

Adds API endpoints to an existing RLCL. Endpoints added to the RLCL will be subject to the rate limiting rules defined in the RLCL.

Endpoint

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

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
rlclName string Yes RLCL name

Request Body

Full JSON Body Example - Single Endpoint

{
  "endpointRateLimitList": [
    {
      "apiProxyName": "MyAPI",
      "endpointName": "/users",
      "endpointHTTPMethod": "GET",
      "permittedMessageCount": 100,
      "timeIntervalPeriodLength": 1,
      "timeInterval": "ONE_MINUTE",
      "cacheConnectionTimeoutInSeconds": 3,
      "cacheErrorHandlingType": "FAIL",
      "timeIntervalWindowType": "FIXED",
      "showRateLimitStatisticsInResponseHeader": false,
      "enabled": true
    }
  ]
}

Full JSON Body Example - Multiple Endpoints

{
  "endpointRateLimitList": [
    {
      "apiProxyName": "MyAPI",
      "endpointName": "/users",
      "endpointHTTPMethod": "GET",
      "permittedMessageCount": 100,
      "timeIntervalPeriodLength": 1,
      "timeInterval": "ONE_MINUTE",
      "cacheConnectionTimeoutInSeconds": 3,
      "cacheErrorHandlingType": "FAIL",
      "timeIntervalWindowType": "FIXED",
      "showRateLimitStatisticsInResponseHeader": false,
      "enabled": true
    },
    {
      "apiProxyName": "MyAPI",
      "endpointName": "/orders",
      "endpointHTTPMethod": "POST",
      "permittedMessageCount": 50,
      "timeIntervalPeriodLength": 1,
      "timeInterval": "ONE_MINUTE",
      "cacheConnectionTimeoutInSeconds": 3,
      "cacheErrorHandlingType": "FAIL",
      "timeIntervalWindowType": "SLIDING",
      "showRateLimitStatisticsInResponseHeader": true,
      "enabled": true
    }
  ]
}

Full JSON Body Example - All Endpoints

{
  "endpointRateLimitList": [
    {
      "apiProxyName": "MyAPI",
      "endpointName": "ALL",
      "endpointHTTPMethod": "ALL",
      "permittedMessageCount": 200,
      "timeIntervalPeriodLength": 1,
      "timeInterval": "ONE_HOUR",
      "cacheConnectionTimeoutInSeconds": 3,
      "cacheErrorHandlingType": "FAIL",
      "timeIntervalWindowType": "FIXED",
      "showRateLimitStatisticsInResponseHeader": false,
      "enabled": true
    }
  ]
}

Request Body Fields

The request body is an object containing an array of endpoint rate limit objects.

Endpoint Rate Limit Object

Field Type Required Default Description
apiProxyName string Yes - API Proxy name
endpointName string Yes* - Endpoint path (e.g., “/users”) or “ALL” for all endpoints. Required if endpointHTTPMethod is not “ALL”
endpointHTTPMethod string Yes* - HTTP method. See EnumHttpRequestMethod. Required if endpointName is not “ALL”
permittedMessageCount integer Yes - Maximum number of messages allowed per time interval
timeIntervalPeriodLength integer Yes - Length of time interval period
timeInterval string Yes - Time interval unit. See EnumRateLimitTimeInterval
targetVariable object|null No null Variable used to identify clients. See Variable Object
cacheConnectionTimeoutInSeconds integer Yes - Cache connection timeout in seconds
cacheErrorHandlingType string Yes - Cache error handling type. See EnumCacheErrorHandlingType
timeIntervalWindowType string Yes - Time interval window type. See EnumIntervalWindowType
targetIdentityValue string|null No null Target identity value (if not using targetVariable)
showRateLimitStatisticsInResponseHeader boolean No false Show rate limit statistics in response header
enabled boolean No true Enable rate limiting for this endpoint

EnumHttpRequestMethod (endpointHTTPMethod)

  • GET - GET method
  • POST - POST method
  • PUT - PUT method
  • DELETE - DELETE method
  • PATCH - PATCH method
  • HEAD - HEAD method
  • OPTIONS - OPTIONS method
  • TRACE - TRACE method
  • ALL - All HTTP methods

EnumRateLimitTimeInterval (timeInterval)

  • ONE_SECOND - One second
  • ONE_MINUTE - One minute
  • ONE_HOUR - One hour
  • ONE_DAY - One day
  • ONE_MONTH - One month

EnumCacheErrorHandlingType (cacheErrorHandlingType)

  • FAIL - Fail request when cache error occurs
  • CONTINUE - Continue processing when cache error occurs

EnumIntervalWindowType (timeIntervalWindowType)

  • FIXED - Fixed window (resets at fixed intervals)
  • SLIDING - Sliding window (continuous rolling 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)  

Request Body Object

Field Type Required Description
endpointRateLimitList array Yes Array of endpoint rate limit objects

Notes

  • Request body must be an object with endpointRateLimitList array (even for single endpoint)
  • apiProxyName is the API Proxy name
  • endpointName is the endpoint path (e.g., “/users”), not including HTTP method
  • endpointHTTPMethod is the HTTP method (e.g., “GET”, “POST”)
  • If endpointName is “ALL”, endpointHTTPMethod should also be “ALL” or can be omitted
  • If endpointHTTPMethod is “ALL”, endpointName should also be “ALL” or can be omitted
  • endpointId is automatically resolved from endpointName and endpointHTTPMethod (not sent in request)
  • Duplicate endpoints are ignored (not added twice)
  • Endpoints are added to the existing list

Response

Success Response (200 OK)

{
  "success": true
}

Error Response (400 Bad Request)

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

or

{
  "error": "bad_request",
  "error_description": "API Proxy with name (MyAPI) is not found in project!"
}

or

{
  "error": "bad_request",
  "error_description": "API Endpoint with name (/users) and method type (GET) is not found in API Proxy!"
}

cURL Example

curl -X POST \
  "https://demo.apinizer.com/apiops/projects/MyProject/rlcl/PremiumUserRLCL/endpoints/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "endpointRateLimitList": [
      {
        "apiProxyName": "MyAPI",
        "endpointName": "/users",
        "endpointHTTPMethod": "GET",
        "permittedMessageCount": 100,
        "timeIntervalPeriodLength": 1,
        "timeInterval": "ONE_MINUTE",
        "cacheConnectionTimeoutInSeconds": 3,
        "cacheErrorHandlingType": "FAIL",
        "timeIntervalWindowType": "FIXED",
        "showRateLimitStatisticsInResponseHeader": false,
        "enabled": true
      }
    ]
  }'

Notes and Warnings

  • Request Body Format:
    • Request body must be an object with endpointRateLimitList array
    • Even for single endpoint, use object format with array inside
  • API Proxy Name:
    • Use API Proxy name in apiProxyName
    • API Proxy must exist in the project
  • Endpoint Name and Method:
    • endpointName is the endpoint path (e.g., “/users”), not including HTTP method
    • endpointHTTPMethod is the HTTP method (e.g., “GET”, “POST”, “PUT”, “DELETE”)
    • Use “ALL” for both endpointName and endpointHTTPMethod to apply to all endpoints
    • Both endpointName and endpointHTTPMethod are required for specific endpoints
  • Duplicate Handling:
    • Duplicate endpoints are ignored
    • No error is thrown for duplicates
  • RLCL Must Exist:
    • RLCL must exist before adding endpoints