> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apinizer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Add Endpoints to RLCL

> Adds API endpoints to an existing RLCL. Endpoints added to the RLCL will be subject to the rate limiting rules defined in the 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

```json theme={null}
{
  "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

```json theme={null}
{
  "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

```json theme={null}
{
  "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](/api-reference/appendix/enum-reference#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](/api-reference/appendix/enum-reference#enumratelimittimeinterval)                         |
| targetVariable                          | object\|null | No       | null    | Variable used to identify clients. See [Variable Object](#variable-object-targetvariable)                                                     |
| cacheConnectionTimeoutInSeconds         | integer      | Yes      | -       | Cache connection timeout in seconds                                                                                                           |
| cacheErrorHandlingType                  | string       | Yes      | -       | Cache error handling type. See [EnumCacheErrorHandlingType](/api-reference/appendix/enum-reference#enumcacheerrorhandlingtype)                |
| timeIntervalWindowType                  | string       | Yes      | -       | Time interval window type. See [EnumIntervalWindowType](/api-reference/appendix/enum-reference#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](/api-reference/appendix/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](/api-reference/appendix/variable-definition)                                                    |                                                    |
| headerName         | string  | No\*     | Header name (required if type=HEADER)                                                                                               |                                                    |
| paramType          | string  | No\*     | Parameter type (required if type=PARAMETER). See [EnumVariableParameterType](/api-reference/appendix/variable-definition)           |                                                    |
| 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](/api-reference/appendix/variable-definition)             |                                                    |
| 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](/api-reference/appendix/variable-definition)       |                                                    |
| 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](/api-reference/appendix/variable-definition) |                                                    |
| 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)

```json theme={null}
{
  "success": true
}
```

### Error Response (400 Bad Request)

```json theme={null}
{
  "error": "bad_request",
  "error_description": "endpointRateLimitList value can not be empty!"
}
```

or

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

or

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

## cURL Example

```bash theme={null}
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
      }
    ]
  }'
```

## Permissions

* User must have **`IDENTITY` + `MANAGE`** permission in the project

## 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

## Related Documentation

* [Update Endpoints](/api-reference/rlcl/endpoints/update-endpoints) - Replace all endpoints
* [Delete Endpoints](/api-reference/rlcl/endpoints/delete-endpoints) - Remove endpoints
