---
title: Fraud
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/python)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Fraud

##### [Get Fraud Detection Settings](https://developers.cloudflare.com/api/python/resources/fraud/methods/get)

fraud.get(FraudGetParams\*\*kwargs) -> [FraudSettings](<https://developers.cloudflare.com/api/python/resources/fraud#(resource)%20fraud%20%3E%20(model)%20fraud_settings%20%3E%20(schema)>)

GET/zones/{zone\_id}/fraud\_detection/settings

##### [Update Fraud Detection Settings](https://developers.cloudflare.com/api/python/resources/fraud/methods/update)

fraud.update(FraudUpdateParams\*\*kwargs) -> [FraudSettings](<https://developers.cloudflare.com/api/python/resources/fraud#(resource)%20fraud%20%3E%20(model)%20fraud_settings%20%3E%20(schema)>)

PUT/zones/{zone\_id}/fraud\_detection/settings

##### ModelsExpand Collapse

<details>

<summary>

class FraudSettings: …

</summary>

<details>

<summary>

authentication\_settings: Optional\[AuthenticationSettings]

Configuration for classifying login authentication outcomes based on the origin response. Requires <code>user_profiles</code> to be enabled.

- Success and failure criteria are independently updatable — sending only <code>success_criteria</code> leaves failure codes untouched, and vice versa.
- Omit <code>authentication_settings</code> entirely to leave both unchanged.
- Status codes must not overlap between success and failure criteria.

</summary>

<details>

<summary>

failure\_criteria: Optional\[AuthenticationSettingsFailureCriteria]

Criterion for identifying failed login responses.

</summary>

kind: Literal\["status\_code"]

The type of criterion. Currently only <code>status_code</code> is supported.

<a href="#(resource)%20fraud%20%3E%20(model)%20fraud_settings%20%3E%20(schema)%20%3E%20(property)%20authentication_settings%20%3E%20(property)%20failure_criteria%20%3E%20(property)%20kind">Link to this property</a>

status\_codes: Optional\[List\[int]]

HTTP status codes to match against the origin response.

- Maximum of 10 codes per criterion.
- Each code must be a valid HTTP status code (100-599).
- Codes are deduplicated and sorted on save.
- Omit to leave unchanged on update.
- Provide an empty array <code>[]</code> to clear codes on update.

<a href="#(resource)%20fraud%20%3E%20(model)%20fraud_settings%20%3E%20(schema)%20%3E%20(property)%20authentication_settings%20%3E%20(property)%20failure_criteria%20%3E%20(property)%20status_codes">Link to this property</a>

</details>

<a href="#(resource)%20fraud%20%3E%20(model)%20fraud_settings%20%3E%20(schema)%20%3E%20(property)%20authentication_settings%20%3E%20(property)%20failure_criteria">Link to this property</a>

<details>

<summary>

success\_criteria: Optional\[AuthenticationSettingsSuccessCriteria]

Criterion for identifying successful login responses.

</summary>

kind: Literal\["status\_code"]

The type of criterion. Currently only <code>status_code</code> is supported.

<a href="#(resource)%20fraud%20%3E%20(model)%20fraud_settings%20%3E%20(schema)%20%3E%20(property)%20authentication_settings%20%3E%20(property)%20success_criteria%20%3E%20(property)%20kind">Link to this property</a>

status\_codes: Optional\[List\[int]]

HTTP status codes to match against the origin response.

- Maximum of 10 codes per criterion.
- Each code must be a valid HTTP status code (100-599).
- Codes are deduplicated and sorted on save.
- Omit to leave unchanged on update.
- Provide an empty array <code>[]</code> to clear codes on update.

<a href="#(resource)%20fraud%20%3E%20(model)%20fraud_settings%20%3E%20(schema)%20%3E%20(property)%20authentication_settings%20%3E%20(property)%20success_criteria%20%3E%20(property)%20status_codes">Link to this property</a>

</details>

<a href="#(resource)%20fraud%20%3E%20(model)%20fraud_settings%20%3E%20(schema)%20%3E%20(property)%20authentication_settings%20%3E%20(property)%20success_criteria">Link to this property</a>

</details>

<a href="#(resource)%20fraud%20%3E%20(model)%20fraud_settings%20%3E%20(schema)%20%3E%20(property)%20authentication_settings">Link to this property</a>

<details>

<summary>

user\_profiles: Optional\[Literal\["enabled", "disabled"]]

Whether Fraud User Profiles is enabled for the zone.

</summary>

One of the following:

"enabled"

<a href="#(resource)%20fraud%20%3E%20(model)%20fraud_settings%20%3E%20(schema)%20%3E%20(property)%20user_profiles%20%3E%20(member)%200">Link to this property</a>

"disabled"

<a href="#(resource)%20fraud%20%3E%20(model)%20fraud_settings%20%3E%20(schema)%20%3E%20(property)%20user_profiles%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20fraud%20%3E%20(model)%20fraud_settings%20%3E%20(schema)%20%3E%20(property)%20user_profiles">Link to this property</a>

username\_expressions: Optional\[List\[str]]

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 <code>[]</code> to clear all expressions on update.
- Invalid expressions will result in a 10400 Bad Request with details in the <code>messages</code> array.

<a href="#(resource)%20fraud%20%3E%20(model)%20fraud_settings%20%3E%20(schema)%20%3E%20(property)%20username_expressions">Link to this property</a>

</details>

[Link to this property](<#(resource)%20fraud%20%3E%20(model)%20fraud_settings%20%3E%20(schema)>)