All pages
Powered by GitBook
1 of 1

Loading...

Add Condition to Policy Configuration

Add a new condition to an existing policy's configuration with logical operators

Endpoint

POST /api/private/lifecycle_management/policies/{policy_id}/versions/{version_number}:add_condition`

Description

Add a new condition to an existing policy's configuration. Conditions determine when a policy should execute by evaluating user attributes, system events, or external triggers. Multiple conditions are combined using logical AND operations.

Use this endpoint to:

  • Add additional triggering criteria to existing policies

  • Refine policy targeting without replacing entire configuration

  • Incrementally build complex policy logic

  • Add new conditions based on changing business requirements

New conditions are immediately active for policies in the active state. All conditions must evaluate to true for the policy to execute.

API Reference

Request Examples

Path Parameters

Parameter
Type
Required
Description

Request Body

Field
Type
Required
Description

Condition Object Fields

Field
Type
Required
Description

Response Examples

SCIM-based Condition Strings

When using condition_type: CONDITION_STRING, you can use SCIM filter expressions to define complex conditions:

Example SCIM Conditions

  • department eq "Engineering" - User belongs to Engineering department

  • is_active eq true and department eq "Sales" - Active user in Sales department

  • title co "Manager" - User title contains "Manager"

SCIM Operators

Operator
Description
Example

name

string

Yes

Name of the condition

continue_actions_if_any_error

boolean

No

Whether to continue with other actions if any action fails

state

string

No

Condition state: ENABLED, DISABLED

startDate gt "2024-01-01" - Start date is after January 1, 2024

  • department eq "IT" or department eq "Security" - User in IT or Security departments

  • ew

    Ends with

    email ew "@company.com"

    gt

    Greater than

    salary gt 50000

    ge

    Greater than or equal

    experience ge 5

    lt

    Less than

    age lt 65

    le

    Less than or equal

    projects le 3

    policy_id

    string

    Yes

    Unique identifier of the policy

    version_number

    integer

    Yes

    Version number of the policy version to modify

    workflow

    string

    Yes

    Name of the workflow to add the condition to

    condition

    object

    Yes

    Condition object to add

    condition_type

    string

    Yes

    Type of condition: ANY, CONDITION_STRING

    condition_string

    string

    Conditional

    SCIM-based condition string (required if condition_type is CONDITION_STRING)

    actions_to_run

    array[object]

    No

    eq

    Equal

    department eq "Finance"

    ne

    Not equal

    status ne "inactive"

    co

    Contains

    title co "Director"

    sw

    Starts with

    Actions that run when this condition is true

    email sw "admin"

    Authentication Required

    This endpoint requires a valid Veza API key for authentication.

    See Authentication for more about creating and managing API keys.

    All requests must include the API key as a Bearer token in the Authorization header.

    Example:

    curl -X GET "$BASE_URL/api/preview/keys" \
      -H "authorization: Bearer $VEZA_TOKEN"
    post
    Authorizations
    Path parameters
    policy_idstringRequired
    version_numberinteger · int32Required
    Body
    policy_idstringOptional
    version_numberinteger · int32Optional
    workflowstringOptional
    Responses
    200

    OK

    application/json
    default

    Default error response

    application/json
    post
    {
      "value": {
        "policy_id": "text",
        "version_number": 1,
        "state": 1,
        "config": {
          "workflows": [
            {
              "trigger_type": 1,
              "description": "text",
              "trigger_string": "text",
              "conditions_on_success": [
                {
                  "condition_type": 1,
                  "condition_string": "text",
                  "actions_to_run": [
                    {
                      "name": "text",
                      "type": 1
                    }
                  ],
                  "name": "text",
                  "continue_actions_if_any_error": true,
                  "state": 1
                }
              ],
              "continuous_sync": true,
              "name": "text",
              "state": 1,
              "attribute_to_get_execute_date": "text",
              "local_time_zone_diff_from_utc": 1,
              "local_time_zone_attribute": "text",
              "trigger_at_local_time_hour": 1,
              "execute_date_time_formatters": [
                {
                  "date_formatter": "text",
                  "pipeline_functions": "text"
                }
              ],
              "grace_period_in_sec": 1,
              "skip_trigger_recheck_after_grace_period": true,
              "priority": 1
            }
          ],
          "actions": [
            {
              "name": "text",
              "description": "text",
              "type": 1,
              "config": {
                "@type": "text",
                "ANY_ADDITIONAL_PROPERTY": "anything"
              },
              "conditions_on_success": [
                {
                  "condition_type": 1,
                  "condition_string": "text",
                  "actions_to_run": [
                    {
                      "name": "text",
                      "type": 1
                    }
                  ],
                  "name": "text",
                  "continue_actions_if_any_error": true,
                  "state": 1
                }
              ],
              "action_notification_settings": [
                {
                  "notification_settings": {
                    "notification_type": 1,
                    "notification_id": "text",
                    "type_settings": {
                      "@type": "text",
                      "ANY_ADDITIONAL_PROPERTY": "anything"
                    }
                  },
                  "on_success": true,
                  "on_failure": true
                }
              ],
              "state": 1,
              "run_once": true
            }
          ],
          "attribute_common_transformers": [
            {
              "name": "text",
              "description": "text",
              "entity_type": "text",
              "entity_attribute_transformers": [
                {
                  "destination_attribute": "text",
                  "destination_value_formatter": "text",
                  "continuous_sync": true,
                  "additional_value_formatter": [
                    "text"
                  ],
                  "pipeline_functions": "text",
                  "unique_identifier": true
                }
              ]
            }
          ],
          "lookup_table_references": [
            {
              "name": "text",
              "description": "text",
              "column_names": [
                "text"
              ],
              "lookup_table_id": "text"
            }
          ],
          "mover_properties": [
            "text"
          ],
          "password_complexity_rules": [
            {
              "name": "text",
              "length": 1,
              "use_special_characters": true,
              "use_numbers": true,
              "use_uppercase": true,
              "use_lowercase": true,
              "disallowed_characters": "text"
            }
          ],
          "transformer_functions": [
            {
              "function_expression": "text",
              "definition": {
                "name": "text",
                "description": "text",
                "parameters": [
                  {
                    "name": "text",
                    "description": "text",
                    "type": 1,
                    "allow_empty": true,
                    "optional": true,
                    "valid_values": [
                      "text"
                    ]
                  }
                ],
                "require_no_input": true,
                "return_multiple_values": true,
                "input_is_optional": true
              }
            }
          ]
        },
        "config_version": "text",
        "created_by": "text",
        "created_at": "2025-08-26T13:34:38.457Z",
        "updated_at": "2025-08-26T13:34:38.457Z",
        "published_by": "text",
        "published_at": "2025-08-26T13:34:38.457Z"
      }
    }
    POST /api/private/lifecycle_management/policies/{policy_id}/versions/{version_number}:add_condition HTTP/1.1
    Host: your-tenant.cookiecloud.ai
    Authorization: Bearer JWT
    Content-Type: application/json
    Accept: */*
    Content-Length: 221
    
    {
      "policy_id": "text",
      "version_number": 1,
      "workflow": "text",
      "condition": {
        "condition_type": 1,
        "condition_string": "text",
        "actions_to_run": [
          {
            "name": "text",
            "type": 1
          }
        ],
        "name": "text",
        "continue_actions_if_any_error": true,
        "state": 1
      }
    }