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.
Header
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 methodPOST- POST methodPUT- PUT methodDELETE- DELETE methodPATCH- PATCH methodHEAD- HEAD methodOPTIONS- OPTIONS methodTRACE- TRACE methodALL- All HTTP methods
EnumRateLimitTimeInterval (timeInterval)
ONE_SECOND- One secondONE_MINUTE- One minuteONE_HOUR- One hourONE_DAY- One dayONE_MONTH- One month
EnumCacheErrorHandlingType (cacheErrorHandlingType)
FAIL- Fail request when cache error occursCONTINUE- 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
endpointRateLimitListarray (even for single endpoint) apiProxyNameis the API Proxy nameendpointNameis the endpoint path (e.g., “/users”), not including HTTP methodendpointHTTPMethodis the HTTP method (e.g., “GET”, “POST”)- If
endpointNameis “ALL”,endpointHTTPMethodshould also be “ALL” or can be omitted - If
endpointHTTPMethodis “ALL”,endpointNameshould also be “ALL” or can be omitted endpointIdis automatically resolved fromendpointNameandendpointHTTPMethod(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
endpointRateLimitListarray - Even for single endpoint, use object format with array inside
- Request body must be an object with
- API Proxy Name:
- Use API Proxy name in
apiProxyName - API Proxy must exist in the project
- Use API Proxy name in
- Endpoint Name and Method:
endpointNameis the endpoint path (e.g., “/users”), not including HTTP methodendpointHTTPMethodis the HTTP method (e.g., “GET”, “POST”, “PUT”, “DELETE”)- Use “ALL” for both
endpointNameandendpointHTTPMethodto apply to all endpoints - Both
endpointNameandendpointHTTPMethodare 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
Related Documentation
- Update Endpoints - Replace all endpoints
- Delete Endpoints - Remove endpoints