## Restore Zaraz historical configuration by ID `zaraz.history.update(HistoryUpdateParams**kwargs) -> Configuration` **put** `/zones/{zone_id}/settings/zaraz/history` Restores a historical published Zaraz configuration by ID for a zone. ### Parameters - `zone_id: str` Identifier. - `body: int` ID of the Zaraz configuration to restore. ### Returns - `class Configuration: …` Zaraz configuration. - `data_layer: bool` Data layer compatibility mode enabled. - `debug_key: str` The key for Zaraz debug mode. - `settings: Settings` General Zaraz settings. - `auto_inject_script: bool` Automatic injection of Zaraz scripts enabled. - `context_enricher: Optional[SettingsContextEnricher]` Details of the worker that receives and edits Zaraz Context object. - `escaped_worker_name: str` - `worker_tag: str` - `cookie_domain: Optional[str]` The domain Zaraz will use for writing and reading its cookies. - `ecommerce: Optional[bool]` Ecommerce API enabled. - `events_api_path: Optional[str]` Custom endpoint for server-side track events. - `hide_external_referer: Optional[bool]` Hiding external referrer URL enabled. - `hide_ip_address: Optional[bool]` Trimming IP address enabled. - `hide_query_params: Optional[bool]` Removing URL query params enabled. - `hide_user_agent: Optional[bool]` Removing sensitive data from User Agent string enabled. - `init_path: Optional[str]` Custom endpoint for Zaraz init script. - `inject_iframes: Optional[bool]` Injection of Zaraz scripts into iframes enabled. - `mc_root_path: Optional[str]` Custom path for Managed Components server functionalities. - `script_path: Optional[str]` Custom endpoint for Zaraz main script. - `track_path: Optional[str]` Custom endpoint for Zaraz tracking requests. - `tools: Dict[str, Tools]` Tools set up under Zaraz configuration, where key is the alpha-numeric tool ID and value is the tool configuration object. - `class ToolsZarazManagedComponent: …` - `blocking_triggers: List[str]` List of blocking trigger IDs. - `component: str` Tool's internal name. - `default_fields: Dict[str, Union[str, bool]]` Default fields for tool's actions. - `str` - `bool` - `enabled: bool` Whether tool is enabled. - `name: str` Tool's name defined by the user. - `permissions: List[str]` List of permissions granted to the component. - `settings: Dict[str, Union[str, bool]]` Tool's settings. - `str` - `bool` - `type: Literal["component"]` - `"component"` - `actions: Optional[Dict[str, NeoEvent]]` Actions configured on a tool. Either this or neoEvents field is required. - `action_type: str` Tool event type. - `blocking_triggers: List[str]` List of blocking triggers IDs. - `data: object` Event payload. - `firing_triggers: List[str]` List of firing triggers IDs. - `default_purpose: Optional[str]` Default consent purpose ID. - `neo_events: Optional[List[NeoEvent]]` DEPRECATED - List of actions configured on a tool. Either this or actions field is required. If both are present, actions field will take precedence. - `action_type: str` Tool event type. - `blocking_triggers: List[str]` List of blocking triggers IDs. - `data: object` Event payload. - `firing_triggers: List[str]` List of firing triggers IDs. - `vendor_name: Optional[str]` Vendor name for TCF compliant consent modal, required for Custom Managed Components and Custom HTML tool with a defaultPurpose assigned. - `vendor_policy_url: Optional[str]` Vendor's Privacy Policy URL for TCF compliant consent modal, required for Custom Managed Components and Custom HTML tool with a defaultPurpose assigned. - `class ToolsWorker: …` - `blocking_triggers: List[str]` List of blocking trigger IDs. - `component: str` Tool's internal name. - `default_fields: Dict[str, Union[str, bool]]` Default fields for tool's actions. - `str` - `bool` - `enabled: bool` Whether tool is enabled. - `name: str` Tool's name defined by the user. - `permissions: List[str]` List of permissions granted to the component. - `settings: Dict[str, Union[str, bool]]` Tool's settings. - `str` - `bool` - `type: Literal["custom-mc"]` - `"custom-mc"` - `worker: ToolsWorkerWorker` Cloudflare worker that acts as a managed component. - `escaped_worker_name: str` - `worker_tag: str` - `actions: Optional[Dict[str, NeoEvent]]` Actions configured on a tool. Either this or neoEvents field is required. - `action_type: str` Tool event type. - `blocking_triggers: List[str]` List of blocking triggers IDs. - `data: object` Event payload. - `firing_triggers: List[str]` List of firing triggers IDs. - `default_purpose: Optional[str]` Default consent purpose ID. - `neo_events: Optional[List[NeoEvent]]` DEPRECATED - List of actions configured on a tool. Either this or actions field is required. If both are present, actions field will take precedence. - `action_type: str` Tool event type. - `blocking_triggers: List[str]` List of blocking triggers IDs. - `data: object` Event payload. - `firing_triggers: List[str]` List of firing triggers IDs. - `vendor_name: Optional[str]` Vendor name for TCF compliant consent modal, required for Custom Managed Components and Custom HTML tool with a defaultPurpose assigned. - `vendor_policy_url: Optional[str]` Vendor's Privacy Policy URL for TCF compliant consent modal, required for Custom Managed Components and Custom HTML tool with a defaultPurpose assigned. - `triggers: Dict[str, Triggers]` Triggers set up under Zaraz configuration, where key is the trigger alpha-numeric ID and value is the trigger configuration. - `exclude_rules: List[TriggersExcludeRule]` Rules defining when the trigger is not fired. - `class TriggersExcludeRuleZarazLoadRule: …` - `id: str` - `match: str` - `op: Literal["CONTAINS", "EQUALS", "STARTS_WITH", 7 more]` - `"CONTAINS"` - `"EQUALS"` - `"STARTS_WITH"` - `"ENDS_WITH"` - `"MATCH_REGEX"` - `"NOT_MATCH_REGEX"` - `"GREATER_THAN"` - `"GREATER_THAN_OR_EQUAL"` - `"LESS_THAN"` - `"LESS_THAN_OR_EQUAL"` - `value: str` - `class TriggersExcludeRuleZarazClickListenerRule: …` - `id: str` - `action: Literal["clickListener"]` - `"clickListener"` - `settings: TriggersExcludeRuleZarazClickListenerRuleSettings` - `selector: str` - `type: Literal["xpath", "css"]` - `"xpath"` - `"css"` - `wait_for_tags: int` - `class TriggersExcludeRuleZarazTimerRule: …` - `id: str` - `action: Literal["timer"]` - `"timer"` - `settings: TriggersExcludeRuleZarazTimerRuleSettings` - `interval: int` - `limit: int` - `class TriggersExcludeRuleZarazFormSubmissionRule: …` - `id: str` - `action: Literal["formSubmission"]` - `"formSubmission"` - `settings: TriggersExcludeRuleZarazFormSubmissionRuleSettings` - `selector: str` - `validate: bool` - `class TriggersExcludeRuleZarazVariableMatchRule: …` - `id: str` - `action: Literal["variableMatch"]` - `"variableMatch"` - `settings: TriggersExcludeRuleZarazVariableMatchRuleSettings` - `match: str` - `variable: str` - `class TriggersExcludeRuleZarazScrollDepthRule: …` - `id: str` - `action: Literal["scrollDepth"]` - `"scrollDepth"` - `settings: TriggersExcludeRuleZarazScrollDepthRuleSettings` - `positions: str` - `class TriggersExcludeRuleZarazElementVisibilityRule: …` - `id: str` - `action: Literal["elementVisibility"]` - `"elementVisibility"` - `settings: TriggersExcludeRuleZarazElementVisibilityRuleSettings` - `selector: str` - `load_rules: List[TriggersLoadRule]` Rules defining when the trigger is fired. - `class TriggersLoadRuleZarazLoadRule: …` - `id: str` - `match: str` - `op: Literal["CONTAINS", "EQUALS", "STARTS_WITH", 7 more]` - `"CONTAINS"` - `"EQUALS"` - `"STARTS_WITH"` - `"ENDS_WITH"` - `"MATCH_REGEX"` - `"NOT_MATCH_REGEX"` - `"GREATER_THAN"` - `"GREATER_THAN_OR_EQUAL"` - `"LESS_THAN"` - `"LESS_THAN_OR_EQUAL"` - `value: str` - `class TriggersLoadRuleZarazClickListenerRule: …` - `id: str` - `action: Literal["clickListener"]` - `"clickListener"` - `settings: TriggersLoadRuleZarazClickListenerRuleSettings` - `selector: str` - `type: Literal["xpath", "css"]` - `"xpath"` - `"css"` - `wait_for_tags: int` - `class TriggersLoadRuleZarazTimerRule: …` - `id: str` - `action: Literal["timer"]` - `"timer"` - `settings: TriggersLoadRuleZarazTimerRuleSettings` - `interval: int` - `limit: int` - `class TriggersLoadRuleZarazFormSubmissionRule: …` - `id: str` - `action: Literal["formSubmission"]` - `"formSubmission"` - `settings: TriggersLoadRuleZarazFormSubmissionRuleSettings` - `selector: str` - `validate: bool` - `class TriggersLoadRuleZarazVariableMatchRule: …` - `id: str` - `action: Literal["variableMatch"]` - `"variableMatch"` - `settings: TriggersLoadRuleZarazVariableMatchRuleSettings` - `match: str` - `variable: str` - `class TriggersLoadRuleZarazScrollDepthRule: …` - `id: str` - `action: Literal["scrollDepth"]` - `"scrollDepth"` - `settings: TriggersLoadRuleZarazScrollDepthRuleSettings` - `positions: str` - `class TriggersLoadRuleZarazElementVisibilityRule: …` - `id: str` - `action: Literal["elementVisibility"]` - `"elementVisibility"` - `settings: TriggersLoadRuleZarazElementVisibilityRuleSettings` - `selector: str` - `name: str` Trigger name. - `description: Optional[str]` Trigger description. - `system: Optional[Literal["pageload"]]` - `"pageload"` - `variables: Dict[str, Variables]` Variables set up under Zaraz configuration, where key is the variable alpha-numeric ID and value is the variable configuration. Values of variables of type secret are not included. - `class VariablesZarazStringVariable: …` - `name: str` - `type: Literal["string"]` - `"string"` - `value: str` - `class VariablesZarazSecretVariable: …` - `name: str` - `type: Literal["secret"]` - `"secret"` - `value: str` - `class VariablesZarazWorkerVariable: …` - `name: str` - `type: Literal["worker"]` - `"worker"` - `value: VariablesZarazWorkerVariableValue` - `escaped_worker_name: str` - `worker_tag: str` - `zaraz_version: int` Zaraz internal version of the config. - `analytics: Optional[Analytics]` Cloudflare Monitoring settings. - `default_purpose: Optional[str]` Consent purpose assigned to Monitoring. - `enabled: Optional[bool]` Whether Advanced Monitoring reports are enabled. - `session_exp_time: Optional[int]` Session expiration time (seconds). - `consent: Optional[Consent]` Consent management configuration. - `enabled: bool` - `button_text_translations: Optional[ButtonTextTranslation]` - `accept_all: Dict[str, str]` Object where keys are language codes. - `confirm_my_choices: Dict[str, str]` Object where keys are language codes. - `reject_all: Dict[str, str]` Object where keys are language codes. - `company_email: Optional[str]` - `company_name: Optional[str]` - `company_street_address: Optional[str]` - `consent_modal_intro_html: Optional[str]` - `consent_modal_intro_html_with_translations: Optional[Dict[str, str]]` Object where keys are language codes. - `cookie_name: Optional[str]` - `custom_css: Optional[str]` - `custom_intro_disclaimer_dismissed: Optional[bool]` - `default_language: Optional[str]` - `hide_modal: Optional[bool]` - `purposes: Optional[Dict[str, ConsentPurposes]]` Object where keys are purpose alpha-numeric IDs. - `description: str` - `name: str` - `purposes_with_translations: Optional[Dict[str, ConsentPurposesWithTranslations]]` Object where keys are purpose alpha-numeric IDs. - `description: Dict[str, str]` Object where keys are language codes. - `name: Dict[str, str]` Object where keys are language codes. - `order: int` - `tcf_compliant: Optional[bool]` - `history_change: Optional[bool]` Single Page Application support enabled. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) configuration = client.zaraz.history.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", body=12345, ) print(configuration.data_layer) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "dataLayer": true, "debugKey": "debugKey", "settings": { "autoInjectScript": true, "contextEnricher": { "escapedWorkerName": "escapedWorkerName", "workerTag": "workerTag" }, "cookieDomain": "cookieDomain", "ecommerce": true, "eventsApiPath": "eventsApiPath", "hideExternalReferer": true, "hideIPAddress": true, "hideQueryParams": true, "hideUserAgent": true, "initPath": "initPath", "injectIframes": true, "mcRootPath": "mcRootPath", "scriptPath": "scriptPath", "trackPath": "trackPath" }, "tools": { "foo": { "blockingTriggers": [ "string" ], "component": "component", "defaultFields": { "foo": "string" }, "enabled": true, "name": "name", "permissions": [ "string" ], "settings": { "foo": "string" }, "type": "component", "actions": { "foo": { "actionType": "actionType", "blockingTriggers": [ "string" ], "data": {}, "firingTriggers": [ "string" ] } }, "defaultPurpose": "defaultPurpose", "neoEvents": [ { "actionType": "actionType", "blockingTriggers": [ "string" ], "data": {}, "firingTriggers": [ "string" ] } ], "vendorName": "vendorName", "vendorPolicyUrl": "vendorPolicyUrl" } }, "triggers": { "foo": { "excludeRules": [ { "id": "id", "match": "match", "op": "CONTAINS", "value": "value" } ], "loadRules": [ { "id": "id", "match": "match", "op": "CONTAINS", "value": "value" } ], "name": "name", "description": "description", "system": "pageload" } }, "variables": { "foo": { "name": "name", "type": "string", "value": "value" } }, "zarazVersion": 0, "analytics": { "defaultPurpose": "defaultPurpose", "enabled": true, "sessionExpTime": 60 }, "consent": { "enabled": true, "buttonTextTranslations": { "accept_all": { "foo": "string" }, "confirm_my_choices": { "foo": "string" }, "reject_all": { "foo": "string" } }, "companyEmail": "companyEmail", "companyName": "companyName", "companyStreetAddress": "companyStreetAddress", "consentModalIntroHTML": "consentModalIntroHTML", "consentModalIntroHTMLWithTranslations": { "foo": "string" }, "cookieName": "cookieName", "customCSS": "customCSS", "customIntroDisclaimerDismissed": true, "defaultLanguage": "defaultLanguage", "hideModal": true, "purposes": { "foo": { "description": "description", "name": "name" } }, "purposesWithTranslations": { "foo": { "description": { "foo": "string" }, "name": { "foo": "string" }, "order": 0 } }, "tcfCompliant": true }, "historyChange": true }, "success": true } ```