All pages
Powered by GitBook
1 of 1

Loading...

Update Policy State

Change policy state to control execution behavior (enable, disable, pause)

Endpoint

PATCH /api/private/lifecycle_management/policies/{policy_id}

Description

Change the state of a policy to control its execution behavior. Policy states determine whether the policy actively processes events and executes actions. This endpoint provides a quick way to enable, disable, or pause policy execution without modifying the policy configuration.

Use this endpoint to:

  • Activate draft policies for production use

  • Temporarily disable policies during maintenance

  • Pause problematic policies for troubleshooting

  • Archive obsolete policies without deletion

API Reference

Request Examples

Path Parameters

Parameter
Type
Required
Description

Request Body

Field
Type
Required
Description

Example Request

Response Examples

Policy States

State
Description
Behavior

policy_id

string

Yes

Unique identifier of the policy to update

state

string

Yes

New state for the policy: active, inactive, draft

reason

string

No

Optional reason for the state change (for audit trail)

curl -X PATCH "https://your-tenant.vezacloud.com/api/private/lifecycle_management/policies/policy-123e4567-e89b-12d3-a456-426614174000" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "state": "active",
    "reason": "Policy testing completed, ready for production"
  }'
{
  "data": {
    "id": "policy-123e4567-e89b-12d3-a456-426614174000",
    "name": "Onboarding Access Policy",
    "description": "Automatically provision access for new employees",
    "state": "active",
    "previous_state": "draft",
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-02-15T14:22:00Z",
    "created_by": "[email protected]",
    "updated_by": "[email protected]",
    "state_change_history": [
      {
        "from_state": "draft",
        "to_state": "active",
        "changed_at": "2024-02-15T14:22:00Z",
        "changed_by": "[email protected]",
        "reason": "Policy testing completed, ready for production"
      }
    ]
  }
}

draft

Policy is being developed or tested

Does not execute, can be freely modified

active

Policy is running in production

Actively processes events and executes actions

inactive

Policy is temporarily disabled

Does not execute, but configuration is preserved

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"
patch
Authorizations
Path parameters
value.idstringRequired
Query parameters
update_maskstring · field-maskOptional
Body
Responses
200

OK

application/json
default

Default error response

application/json
patch

The main object for controlling the policy it includes descriptions Has multiple versions of it if, one of which is live and up to one of which is in draft mode, all others are historical

idstringRead-onlyOptional
namestringOptional
descriptionstringOptional
stateinteger · enumOptional
current_version_numberinteger · int32Read-onlyOptional

The version that is currently live and running

draft_version_numberinteger · int32Read-onlyOptional

The version that is being edited and in draft form (0 if there is none)

entity_typestringRead-onlyOptional

The entity type to use for this policy (derived from the data sources passed in)

datasource_idsstring[]Optional

The source of identity data source(s) for this policy (must have one and must be of the same type)

access_profiles_usedstring[]Read-onlyOptional

List of the access profiles that are

provider_external_idsstring[]Read-onlyOptional

List of the providers used by this policy (derived from the data sources passed in)

current_versionall ofRead-onlyOptional
initial_completebooleanRead-onlyOptional
sync_only_when_source_changesbooleanOptional

If true will only sync if the source of identity changes

time_before_sync_if_no_source_changes_in_minutesinteger · int32Optional

If sync_only_when_source_changes is true, how quickly (in minutes) to run a check when no changes are detected (default is 1 day 1440)

safety_limit_settingsall ofOptional

Settings that determine when to block changes and send warnings

safety_limit_warningall ofRead-onlyOptional

Provides information about the most recent safety limit warning, cleared when an extraction is fully processed

no_retry_for_failed_workflowbooleanOptional

if true will not retry failed workflows

max_retries_for_failed_workflowinteger · int32Optional

how many times we will retry a failed workflow (default is 10)

created_bystringRead-onlyOptional
created_atstring · date-timeRead-onlyOptional
updated_atstring · date-timeRead-onlyOptional
{
  "value": {
    "id": "text",
    "name": "text",
    "description": "text",
    "state": 1,
    "current_version_number": 1,
    "draft_version_number": 1,
    "entity_type": "text",
    "datasource_ids": [
      "text"
    ],
    "access_profiles_used": [
      "text"
    ],
    "provider_external_ids": [
      "text"
    ],
    "current_version": {
      "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:03:15.980Z",
      "updated_at": "2025-08-26T13:03:15.980Z",
      "published_by": "text",
      "published_at": "2025-08-26T13:03:15.980Z"
    },
    "initial_complete": true,
    "secondary_source_of_identities": [
      {
        "entity_type": "text",
        "datasource_ids": [
          "text"
        ],
        "provider_external_ids": [
          "text"
        ],
        "correlation_attribute_names": {
          "ANY_ADDITIONAL_PROPERTY": "text"
        },
        "only_enrich_existing": true
      }
    ],
    "sync_only_when_source_changes": true,
    "time_before_sync_if_no_source_changes_in_minutes": 1,
    "identity_attribute_mappings": [
      {
        "identity_attribute": 1,
        "entity_attribute_name": "text"
      }
    ],
    "safety_limit_settings": {
      "enable_change_limit": true,
      "enable_predictive_change_limit": true,
      "max_identities_affected_percentage": 1,
      "max_identities_affected_count": "text",
      "warning_email_addresses": [
        "text"
      ]
    },
    "safety_limit_warning": {
      "warning_type": 1,
      "occurred_at": "2025-08-26T13:03:15.980Z",
      "caused_by_extraction_event": {
        "id": "text",
        "data_source_id": "text",
        "provider_id": "text",
        "provider_type": "text",
        "state": 1,
        "provider_external_id": "text",
        "agent_type": 1,
        "error_message": "text",
        "extracted_at": "2025-08-26T13:03:15.980Z",
        "policy_id": "text",
        "event_type": 1,
        "number_of_identities_affected": "text",
        "disregard_change_limit": true
      },
      "identities_changed_count": "text",
      "predicted_identities_changed_count": "text"
    },
    "no_retry_for_failed_workflow": true,
    "max_retries_for_failed_workflow": 1,
    "event_notification_settings": [
      {
        "event_type": 1,
        "notification_settings": {
          "notification_type": 1,
          "notification_id": "text",
          "type_settings": {
            "@type": "text",
            "ANY_ADDITIONAL_PROPERTY": "anything"
          }
        },
        "on_success": true,
        "on_failure": true
      }
    ],
    "created_by": "text",
    "created_at": "2025-08-26T13:03:15.980Z",
    "updated_at": "2025-08-26T13:03:15.980Z"
  }
}
PATCH /api/private/lifecycle_management/policies/{value.id} HTTP/1.1
Host: your-tenant.cookiecloud.ai
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 910

{
  "name": "text",
  "description": "text",
  "state": 1,
  "datasource_ids": [
    "text"
  ],
  "secondary_source_of_identities": [
    {
      "datasource_ids": [
        "text"
      ],
      "correlation_attribute_names": {
        "ANY_ADDITIONAL_PROPERTY": "text"
      },
      "only_enrich_existing": true
    }
  ],
  "sync_only_when_source_changes": true,
  "time_before_sync_if_no_source_changes_in_minutes": 1,
  "identity_attribute_mappings": [
    {
      "identity_attribute": 1,
      "entity_attribute_name": "text"
    }
  ],
  "safety_limit_settings": {
    "enable_change_limit": true,
    "enable_predictive_change_limit": true,
    "max_identities_affected_percentage": 1,
    "max_identities_affected_count": "text",
    "warning_email_addresses": [
      "text"
    ]
  },
  "no_retry_for_failed_workflow": true,
  "max_retries_for_failed_workflow": 1,
  "event_notification_settings": [
    {
      "event_type": 1,
      "notification_settings": {
        "notification_type": 1,
        "notification_id": "text",
        "type_settings": {
          "@type": "text",
          "ANY_ADDITIONAL_PROPERTY": "anything"
        }
      },
      "on_success": true,
      "on_failure": true
    }
  ]
}