Change fraud detection

.md

Change the firm's fraud settings, what Restrict takes, or any number of detectors.

Scopesadmin:write
Permissionmanage_fraud
PUT/v1/admin/fraud/detection

Change any part of the detectors: the firm's settings, what Restrict takes, and any number of detectors. What is left out keeps its value. Each part that is sent is checked whole, by the rules the website uses: half a global is refused rather than merged.

It takes effect at once. Access checks that were cached for a trader are thrown away, so a detector put on Block refuses the next request.

Needs a firm. Our own staff name one with the Propper-Workspace header.

Request

FieldDescription
globalAll five of enabled, sensitivity, notify_admins, escalation_enabled and escalation_score (a whole number from 30 to 100, checked even while escalation is off)
restrictAll four of block_new_orders, hold_payouts, block_purchases and hold_affiliate_payouts, each true or false
detectorsBy key, each with a level and its params. A detector with thresholds needs params, and a threshold left out goes back to its default. An integer is a whole number from min to max, a choice one of its options, a country list up to 250 codes of two letters

At least one of the three.

curl -X PUT "https://api.proppertrading.com/v1/admin/fraud/detection" \
  -H "Authorization: Bearer ptat_9f2c1a44_3b8e7d2f5c9a1b4e6d8f0a2c4e6b8d1f" \
  -H "Propper-Workspace: acme" \
  -H "Content-Type: application/json" \
  -d '{"detectors": {"max_countries": {"level": "flag", "params": {"max_countries": 4, "window_days": 30}}}}'

Response

The detectors as they are now.

Errors

StatusCodeMeaning
400workspace_requiredAsked by our own staff without naming a firm
401invalid_tokenNot a token, or the secret does not match
401revoked_tokenSigned out here or from another device
401expired_tokenNinety days without use, or a set expiry passed
403admin_access_requiredThis account no longer helps run the environment
403insufficient_scopeThis device does not hold admin:write
403workspace_not_permittedThe Propper-Workspace header names an environment this account cannot act in
403forbiddenWithout manage_fraud
422validation_failedNothing to save, a part that is not whole, an unknown detector, a level or threshold out of range. param names the field, such as detectors.shared_ip.params.max_accounts