Get all rules that have been set for your project.
Get Rules
Body parameters
The cursor field allows you to paginate through your results. Each result array is limited to 100 results. If your query returns more than 100 results, you will need to paginate the responses using the cursor. If you receive a response that includes a non-null next_cursor, repeat the request with the next_cursor value set to the cursor field to retrieve the next page of results. Continue to make requests until the next_cursor in the response is null.
The number of results to return per page. The default limit is 10. A maximum of 100 results can be returned by a single get request. If the total size of your result set is greater than one page size, you must paginate the response. See the cursor field.
Response fields
Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
A list of rules for the project
The rule type. The possible values are VISITOR_ID, BROWSER_ID, VISITOR_FINGERPRINT, BROWSER_FINGERPRINT, HARDWARE_FINGERPRINT, NETWORK_FINGERPRINT, CIDR_BLOCK, ASN, or COUNTRY_CODE.
The action (ALLOW, BLOCK, or CHALLENGE) that will be returned for this rule.
A description for the rule.
The visitor ID that a rule was set for.
The browser ID that a rule was set for.
The visitor fingerprint that a rule was set for.
The browser fingerprint that a rule was set for.
The hardware fingerprint that a rule was set for.
The network fingerprint that a rule was set for.
The CIDR block that a rule was set for. If an end user's IP address is within this CIDR block, this rule will be applied.
The ASN that a rule was set for.
The country code that a rule was set for.
The time when the rule was created. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. 2021-12-29T12:33:09Z.
The timestamp when the rule expires. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. 2021-12-29T12:33:09Z.
The time when the rule was last updated. Will be null if the rule has never been updated. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. 2021-12-29T12:33:09Z.
The next_cursor string is returned when your result contains more than one page of results. This value is passed into your next request in the cursor field.
const stytch = require('stytch');
const client = new stytch.Client({
project_id: 'PROJECT_ID',
secret: 'SECRET',
});
const params = {
limit: 10,
};
client.fraud.rules.list(params)
.then(resp => { console.log(resp) })
.catch(err => { console.log(err) });
{
"next_cursor": "",
"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
"rules": [
{
"action": "CHALLENGE",
"browser_id": "",
"visitor_id": "visitor-6139cbcc-4dda-4b1f-b1c0-13c08ec64d72",
"visitor_fingerprint": "",
"browser_fingerprint": "",
"hardware_fingerprint": "",
"network_fingerprint": "",
"asn": "",
"cidr_block":,
"country_code": "",
"description": "",
"rule_type": "VISITOR_ID",
"created_at": "2024-01-01T00:00:00Z",
"expires_at": "2033-01-01T00:00:00Z",
"last_updated_at": "2025-01-01T00:00:00Z"
}
],
"status_code": 200
}
{
"status_code": 401,
"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
"error_type": "unauthorized_credentials",
"error_message": "Unauthorized credentials.",
"error_url": "https://stytch.com/docs/api/errors/401"
}
{
"status_code": 429,
"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
"error_type": "too_many_requests",
"error_message": "Too many requests have been made.",
"error_url": "https://stytch.com/docs/api/errors/429"
}
{
"status_code": 500,
"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
"error_type": "internal_server_error",
"error_message": "Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us know what went wrong.",
"error_url": "https://stytch.com/docs/api/errors/500"
}