Skip to content
Dashboard
Theme
Theme

Replace the environment's bot and abuse protection settings

PUT /v1/user_management/bot_protection: Replace the environment's bot and abuse protection settings.

View Markdown

PUT /v1/user_management/bot_protection

Rules run in list order and the first match decides (allow stops evaluation). The rules engine needs a Business plan, the developer’s own Turnstile keys and new-device emails a Pro plan (plan_limit_reached otherwise); the managed CAPTCHA, device signals and the detections log are on every plan. captcha_provider: managed needs OhAuthCat’s widget to be configured for the deployment (parameter_invalid otherwise). Changes apply to the hosted pages within seconds.

Scope
users:write
Auth
Secret key (sk_…)
Since
1.0
  • OhAuthCat-Version string

    Minor version; defaults to the environment’s pin.

  • captcha_mode string Required

    one of off, adaptive, always

  • captcha_provider string Required

    one of managed, own

  • turnstile_site_key string or null

    max length 128

  • turnstile_secret string

    The developer’s Turnstile secret, sealed at rest and never returned. Omit to keep the stored one.

    min length 1 · max length 256

  • clear_turnstile_secret boolean

  • device_tracking boolean Required

  • new_device_email boolean Required

  • rules array of BotRule Required

    max items 50

Errors share one shape; see the error code catalogue.

curl -X PUT \
"https://api.ohauthcat.com/v1/user_management/bot_protection" \
-H "Authorization: Bearer $OHAUTHCAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"captcha_mode": "off",
"captcha_provider": "managed",
"device_tracking": true,
"new_device_email": true,
"rules": [
{
"id": "01J9Z3K5V7W8X9Y0Z1A2B3C4D5",
"kind": "country",
"action": "allow",
"challenge": "captcha",
"enabled": true,
"flows": [
"sign_in"
],
"values": [
"enterprise"
],
"not_in": true,
"threshold": 1,
"window_seconds": 60,
"days": 1
}
]
}'
Response 200
{
"object": "bot_protection",
"captcha_mode": "off",
"captcha_provider": "managed",
"turnstile_site_key": "plan",
"turnstile_secret_set": true,
"device_tracking": true,
"new_device_email": true,
"rules": [
{
"id": "01J9Z3K5V7W8X9Y0Z1A2B3C4D5",
"kind": "country",
"action": "allow",
"challenge": "captcha",
"enabled": true,
"flows": [
"sign_in"
],
"values": [
"enterprise"
],
"not_in": true,
"threshold": 1,
"window_seconds": 60,
"days": 1
}
]
}