## Update Fraud Detection Settings `client.fraud.update(FraudUpdateParamsparams, RequestOptionsoptions?): FraudSettings` **put** `/zones/{zone_id}/fraud_detection/settings` Update Fraud Detection settings for a zone. Notes on `username_expressions` behavior: - If omitted or set to null, expressions are not modified. - If provided as an empty array `[]`, all expressions will be cleared. ### Parameters - `params: FraudUpdateParams` - `zone_id: string` Path param: Identifier. - `user_profiles?: "enabled" | "disabled"` Body param: Whether Fraud User Profiles is enabled for the zone. - `"enabled"` - `"disabled"` - `username_expressions?: Array` Body param: List of expressions to detect usernames in write HTTP requests. - Maximum of 10 expressions. - Omit or set to null to leave unchanged on update. - Provide an empty array `[]` to clear all expressions on update. - Invalid expressions will result in a 10400 Bad Request with details in the `messages` array. ### Returns - `FraudSettings` - `user_profiles?: "enabled" | "disabled"` Whether Fraud User Profiles is enabled for the zone. - `"enabled"` - `"disabled"` - `username_expressions?: Array` List of expressions to detect usernames in write HTTP requests. - Maximum of 10 expressions. - Omit or set to null to leave unchanged on update. - Provide an empty array `[]` to clear all expressions on update. - Invalid expressions will result in a 10400 Bad Request with details in the `messages` array. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const fraudSettings = await client.fraud.update({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', username_expressions: [], }); console.log(fraudSettings.user_profiles); ``` #### 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" } } ], "success": true, "result": { "user_profiles": "disabled", "username_expressions": [ "http.request.body.form[\"username\"][0]", "lookup_json_string(http.request.body.raw, \"username\")" ] } } ```