Ana içeriğe atla

Overview

Updates the condition in an RLCL. Completely replaces the existing condition with the new one provided in the request body. All existing condition rules are removed and replaced with the new condition rules.

Endpoint

PUT /apiops/projects/{projectName}/rlcl/{rlclName}/condition/

Authentication

Requires a Personal API Access Token.
Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer Yes
Content-Typeapplication/jsonYes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
rlclNamestringYesRLCL name

Request Body

Full JSON Body Example - Simple Condition

{
  "conditionRuleList": [
    {
      "conditionCriteria": "VALUE",
      "firstVariable": {
        "name": "userTypeHeader",
        "type": "HEADER",
        "headerName": "X-User-Type"
      },
      "variableDataType": "STRING",
      "valueComparisonOperator": "EQ",
      "secondValueSource": "VALUE",
      "secondValue": "PREMIUM"
    }
  ]
}

Full JSON Body Example - Complex Condition with Multiple Rules

{
  "conditionRuleList": [
    {
      "conditionCriteria": "OR",
      "conditionRuleList": [
        {
          "conditionCriteria": "VALUE",
          "firstVariable": {
            "name": "userTypeHeader",
            "type": "HEADER",
            "headerName": "X-User-Type"
          },
          "variableDataType": "STRING",
          "valueComparisonOperator": "EQ",
          "secondValueSource": "VALUE",
          "secondValue": "PREMIUM"
        },
        {
          "conditionCriteria": "VALUE",
          "firstVariable": {
            "name": "apiVersionHeader",
            "type": "HEADER",
            "headerName": "X-API-Version"
          },
          "variableDataType": "STRING",
          "valueComparisonOperator": "EQ",
          "secondValueSource": "VALUE",
          "secondValue": "v2"
        }
      ]
    }
  ]
}

Request Body Fields

FieldTypeRequiredDefaultDescription
conditionRuleListarray[object]Yes-List of condition rules. See ConditionRuleDTO

ConditionRuleDTO (conditionRuleList item)

FieldTypeRequiredDescription
conditionRuleListarray[object]NoNested condition rules (for complex conditions)
conditionCriteriastringYesCondition criteria. See EnumConditionCriteria
firstVariableobjectYesFirst variable for comparison. See Variable Object
variableDataTypestringYesVariable data type. See EnumConditionVariableDataType
dateFormatstringNoDate format for date comparisons
valueComparisonOperatorstringYesComparison operator. See EnumConditionValueComparisonOperator
secondValueSourcestringYesSecond value source. See EnumConditionValueSource
secondValuestringNo*Static value for comparison (required if secondValueSource is VALUE)
secondVariableobjectNo*Second variable for comparison (required if secondValueSource is VARIABLE)

EnumConditionCriteria (conditionCriteria)

  • VALUE - Value comparison (used for actual comparison operations)
  • NOT - Negation (negates the condition)
  • AND - Logical AND (all nested conditions must match)
  • OR - Logical OR (any nested condition must match)
For actual value comparisons, use VALUE. Use AND/OR/NOT for combining multiple conditions.

EnumConditionVariableDataType (variableDataType)

  • STRING - String data type
  • NUMERIC - Numeric data type
  • DATE - Date data type
BOOLEAN is not supported. Use STRING with EQ/NE operators for boolean-like comparisons.

EnumConditionValueComparisonOperator (valueComparisonOperator)

  • LT - Less than
  • LE - Less than or equal to
  • GT - Greater than
  • GE - Greater than or equal to
  • EQ - Equal to
  • NE - Not equal to
  • STARTS_WITH - Starts with (string only)
  • ENDS_WITH - Ends with (string only)
  • CONTAINS - Contains (string only)
  • NOT_CONTAINS - Does not contain (string only)
  • IS_EMPTY - Value exists and is empty
  • IS_NOT_EMPTY - Value exists and is not empty
  • IS_EXISTS - Value exists
  • IS_NOT_EXISTS - Value does not exist
  • IN - Value is in list
  • NOT_IN - Value is not in list

EnumConditionValueSource (secondValueSource)

  • VALUE - Static value (use secondValue field)
  • VARIABLE - Variable value (use secondVariable field)

Variable Object (firstVariable/secondVariable)

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)

Important Notes

  • Complete Replacement: The existing condition is completely replaced with the new condition provided in the request body
  • All existing condition rules are removed and replaced with the new condition rules
  • If the new condition is empty or invalid, it will be reset to the default condition (AND rule)
  • Conditions are evaluated before applying rate limiting
  • If condition evaluates to false, RLCL is not applied
  • Nested conditions are supported for complex logic

Response

Success Response (200 OK)

{
  "success": true
}

Error Response (400 Bad Request)

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

cURL Example

curl -X PUT \
  "https://demo.apinizer.com/apiops/projects/MyProject/rlcl/PremiumUserRLCL/condition/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "conditionRuleList": [
      {
        "conditionCriteria": "VALUE",
        "firstVariable": {
          "name": "userTypeHeader",
          "type": "HEADER",
          "headerName": "X-User-Type"
        },
        "variableDataType": "STRING",
        "valueComparisonOperator": "EQ",
        "secondValueSource": "VALUE",
        "secondValue": "PREMIUM"
      }
    ]
  }'

Permissions

  • User must have IDENTITY + MANAGE permission in the project

Notes and Warnings

  • Complete Replacement:
    • The existing condition is completely replaced with the new condition
    • All existing condition rules are removed and replaced
  • Condition Evaluation:
    • Condition is evaluated before applying rate limiting
    • If condition is false, RLCL is not applied
  • Nested Conditions:
    • Complex conditions can be created using nested rules
    • Use conditionRuleList for nested logic