---
title: Get Fraud Detection Settings
---

[Skip to content](#_top)

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

[Fraud](https://developers.cloudflare.com/api/typescript/resources/fraud)

Copy Markdown

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

---

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

# Get Fraud Detection Settings

client.fraud.get(FraudGetParams {zone\_id } params, RequestOptionsoptions?): [FraudSettings](<https://developers.cloudflare.com/api/typescript/resources/fraud#(resource)%20fraud%20%3E%20(model)%20fraud_settings%20%3E%20(schema)>) {authentication\_settings, user\_profiles, username\_expressions }

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

Retrieve Fraud Detection settings for a zone.

##### Security

<details>

<summary>API Token</summary>



The preferred authorization scheme for interacting with the Cloudflare API. <a href="https://developers.cloudflare.com/fundamentals/api/get-started/create-token/">Create a token</a>.

**Example:**<code>Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY</code>

</details>

<details>

<summary>API Email + API Key</summary>



The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

**Example:**<code>X-Auth-Email: user@example.com</code>

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

**Example:**<code>X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194</code>

</details>

##### Accepted Permissions (at least one required)

`Fraud Detection Read``Fraud Detection Write`

##### ParametersExpand Collapse

<details>

<summary>

params: FraudGetParams {zone\_id }

</summary>

zone\_id: string

Identifier.

maxLength32

<a href="#(resource)%20fraud%20%3E%20(method)%20get%20%3E%20(params)%20default%20%3E%20(param)%20zone_id">Link to this property</a>

</details>

[Link to this property](<#(resource)%20fraud%20%3E%20(method)%20get%20%3E%20(params)%20default>)

##### ReturnsExpand Collapse

<details>

<summary>

FraudSettings {authentication\_settings, user\_profiles, username\_expressions }

</summary>

<details>

<summary>

authentication\_settings?: AuthenticationSettings {failure\_criteria, success\_criteria }

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?: FailureCriteria {kind, status\_codes }

Criterion for identifying failed login responses.

</summary>

kind: "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?: Array&lt;number&gt;

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?: SuccessCriteria {kind, status\_codes }

Criterion for identifying successful login responses.

</summary>

kind: "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?: Array&lt;number&gt;

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?: "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?: Array&lt;string&gt;

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)>)

### Get Fraud Detection Settings

TypeScript

HTTPTypeScriptPythonGoTerraform

```
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.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' });

console.log(fraudSettings.authentication_settings);
```

200 example

```
{
  "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": {
    "authentication_settings": {
      "failure_criteria": {
        "kind": "status_code",
        "status_codes": [
          200,
          201
        ]
      },
      "success_criteria": {
        "kind": "status_code",
        "status_codes": [
          200,
          201
        ]
      }
    },
    "user_profiles": "disabled",
    "username_expressions": [
      "http.request.body.form[\"username\"][0]",
      "lookup_json_string(http.request.body.raw, \"username\")"
    ]
  }
}
```

##### Returns Examples

200 example

```
{
  "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": {
    "authentication_settings": {
      "failure_criteria": {
        "kind": "status_code",
        "status_codes": [
          200,
          201
        ]
      },
      "success_criteria": {
        "kind": "status_code",
        "status_codes": [
          200,
          201
        ]
      }
    },
    "user_profiles": "disabled",
    "username_expressions": [
      "http.request.body.form[\"username\"][0]",
      "lookup_json_string(http.request.body.raw, \"username\")"
    ]
  }
}
```