curl --request PATCH \
--url https://{tenantDomain}/api/v2/attack-protection/captcha/policies/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"priority": 2,
"match": {
"auth0_managed": [
"<string>"
],
"geo_country_codes": [
"<string>"
]
},
"action": {
"simple_captcha": {},
"auth_challenge": {
"fail_open": true
},
"recaptcha_v2": {
"site_key": "<string>",
"secret": "<string>"
},
"recaptcha_enterprise": {
"site_key": "<string>",
"project_id": "<string>",
"api_key": "<string>"
},
"hcaptcha": {
"site_key": "<string>",
"secret": "<string>"
},
"friendly_captcha": {
"site_key": "<string>",
"secret": "<string>"
},
"arkose": {
"site_key": "<string>",
"secret": "<string>",
"client_subdomain": "<string>",
"verify_subdomain": "<string>",
"fail_open": true
}
}
}
'import requests
url = "https://{tenantDomain}/api/v2/attack-protection/captcha/policies/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"priority": 2,
"match": {
"auth0_managed": ["<string>"],
"geo_country_codes": ["<string>"]
},
"action": {
"simple_captcha": {},
"auth_challenge": { "fail_open": True },
"recaptcha_v2": {
"site_key": "<string>",
"secret": "<string>"
},
"recaptcha_enterprise": {
"site_key": "<string>",
"project_id": "<string>",
"api_key": "<string>"
},
"hcaptcha": {
"site_key": "<string>",
"secret": "<string>"
},
"friendly_captcha": {
"site_key": "<string>",
"secret": "<string>"
},
"arkose": {
"site_key": "<string>",
"secret": "<string>",
"client_subdomain": "<string>",
"verify_subdomain": "<string>",
"fail_open": True
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
priority: 2,
match: {auth0_managed: ['<string>'], geo_country_codes: ['<string>']},
action: {
simple_captcha: {},
auth_challenge: {fail_open: true},
recaptcha_v2: {site_key: '<string>', secret: '<string>'},
recaptcha_enterprise: {site_key: '<string>', project_id: '<string>', api_key: '<string>'},
hcaptcha: {site_key: '<string>', secret: '<string>'},
friendly_captcha: {site_key: '<string>', secret: '<string>'},
arkose: {
site_key: '<string>',
secret: '<string>',
client_subdomain: '<string>',
verify_subdomain: '<string>',
fail_open: true
}
}
})
};
fetch('https://{tenantDomain}/api/v2/attack-protection/captcha/policies/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/attack-protection/captcha/policies/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'priority' => 2,
'match' => [
'auth0_managed' => [
'<string>'
],
'geo_country_codes' => [
'<string>'
]
],
'action' => [
'simple_captcha' => [
],
'auth_challenge' => [
'fail_open' => true
],
'recaptcha_v2' => [
'site_key' => '<string>',
'secret' => '<string>'
],
'recaptcha_enterprise' => [
'site_key' => '<string>',
'project_id' => '<string>',
'api_key' => '<string>'
],
'hcaptcha' => [
'site_key' => '<string>',
'secret' => '<string>'
],
'friendly_captcha' => [
'site_key' => '<string>',
'secret' => '<string>'
],
'arkose' => [
'site_key' => '<string>',
'secret' => '<string>',
'client_subdomain' => '<string>',
'verify_subdomain' => '<string>',
'fail_open' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenantDomain}/api/v2/attack-protection/captcha/policies/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"priority\": 2,\n \"match\": {\n \"auth0_managed\": [\n \"<string>\"\n ],\n \"geo_country_codes\": [\n \"<string>\"\n ]\n },\n \"action\": {\n \"simple_captcha\": {},\n \"auth_challenge\": {\n \"fail_open\": true\n },\n \"recaptcha_v2\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"recaptcha_enterprise\": {\n \"site_key\": \"<string>\",\n \"project_id\": \"<string>\",\n \"api_key\": \"<string>\"\n },\n \"hcaptcha\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"friendly_captcha\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"arkose\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\",\n \"client_subdomain\": \"<string>\",\n \"verify_subdomain\": \"<string>\",\n \"fail_open\": true\n }\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://{tenantDomain}/api/v2/attack-protection/captcha/policies/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"priority\": 2,\n \"match\": {\n \"auth0_managed\": [\n \"<string>\"\n ],\n \"geo_country_codes\": [\n \"<string>\"\n ]\n },\n \"action\": {\n \"simple_captcha\": {},\n \"auth_challenge\": {\n \"fail_open\": true\n },\n \"recaptcha_v2\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"recaptcha_enterprise\": {\n \"site_key\": \"<string>\",\n \"project_id\": \"<string>\",\n \"api_key\": \"<string>\"\n },\n \"hcaptcha\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"friendly_captcha\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"arkose\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\",\n \"client_subdomain\": \"<string>\",\n \"verify_subdomain\": \"<string>\",\n \"fail_open\": true\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/attack-protection/captcha/policies/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"priority\": 2,\n \"match\": {\n \"auth0_managed\": [\n \"<string>\"\n ],\n \"geo_country_codes\": [\n \"<string>\"\n ]\n },\n \"action\": {\n \"simple_captcha\": {},\n \"auth_challenge\": {\n \"fail_open\": true\n },\n \"recaptcha_v2\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"recaptcha_enterprise\": {\n \"site_key\": \"<string>\",\n \"project_id\": \"<string>\",\n \"api_key\": \"<string>\"\n },\n \"hcaptcha\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"friendly_captcha\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"arkose\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\",\n \"client_subdomain\": \"<string>\",\n \"verify_subdomain\": \"<string>\",\n \"fail_open\": true\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"priority": 2,
"match": {
"auth0_managed": [
"<string>"
],
"geo_country_codes": [
"<string>"
]
},
"action": {
"active_provider_id": "simple_captcha",
"simple_captcha": {},
"auth_challenge": {
"fail_open": true
},
"recaptcha_v2": {
"site_key": "<string>"
},
"recaptcha_enterprise": {
"site_key": "<string>",
"project_id": "<string>"
},
"hcaptcha": {
"site_key": "<string>"
},
"friendly_captcha": {
"site_key": "<string>"
},
"arkose": {
"site_key": "<string>",
"client_subdomain": "<string>",
"verify_subdomain": "<string>",
"fail_open": true
}
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>"
}{
"message": "<string>",
"statusCode": 400,
"error": "Bad Request"
}{
"message": "<string>",
"statusCode": 401,
"error": "Unauthorized"
}{
"message": "<string>",
"statusCode": 403,
"error": "Forbidden"
}{
"message": "<string>",
"statusCode": 404,
"error": "Not Found"
}{
"message": "<string>",
"statusCode": 409,
"error": "Conflict"
}{
"message": "<string>",
"statusCode": 429,
"error": "Too Many Requests"
}Mettre à jour une politique de protection CAPTCHA contre les attaques
Mettre à jour partiellement une politique de protection CAPTCHA contre les attaques. Seuls les champs fournis sont modifiés. Toute valeur fournie pour match ou action remplace entièrement la valeur stockée, sans fusion. Dans action, si un bloc provider est fourni sans le secret du fournisseur ou la clé API, la valeur stockée de l’élément omis est conservée.
curl --request PATCH \
--url https://{tenantDomain}/api/v2/attack-protection/captcha/policies/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"priority": 2,
"match": {
"auth0_managed": [
"<string>"
],
"geo_country_codes": [
"<string>"
]
},
"action": {
"simple_captcha": {},
"auth_challenge": {
"fail_open": true
},
"recaptcha_v2": {
"site_key": "<string>",
"secret": "<string>"
},
"recaptcha_enterprise": {
"site_key": "<string>",
"project_id": "<string>",
"api_key": "<string>"
},
"hcaptcha": {
"site_key": "<string>",
"secret": "<string>"
},
"friendly_captcha": {
"site_key": "<string>",
"secret": "<string>"
},
"arkose": {
"site_key": "<string>",
"secret": "<string>",
"client_subdomain": "<string>",
"verify_subdomain": "<string>",
"fail_open": true
}
}
}
'import requests
url = "https://{tenantDomain}/api/v2/attack-protection/captcha/policies/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"priority": 2,
"match": {
"auth0_managed": ["<string>"],
"geo_country_codes": ["<string>"]
},
"action": {
"simple_captcha": {},
"auth_challenge": { "fail_open": True },
"recaptcha_v2": {
"site_key": "<string>",
"secret": "<string>"
},
"recaptcha_enterprise": {
"site_key": "<string>",
"project_id": "<string>",
"api_key": "<string>"
},
"hcaptcha": {
"site_key": "<string>",
"secret": "<string>"
},
"friendly_captcha": {
"site_key": "<string>",
"secret": "<string>"
},
"arkose": {
"site_key": "<string>",
"secret": "<string>",
"client_subdomain": "<string>",
"verify_subdomain": "<string>",
"fail_open": True
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
priority: 2,
match: {auth0_managed: ['<string>'], geo_country_codes: ['<string>']},
action: {
simple_captcha: {},
auth_challenge: {fail_open: true},
recaptcha_v2: {site_key: '<string>', secret: '<string>'},
recaptcha_enterprise: {site_key: '<string>', project_id: '<string>', api_key: '<string>'},
hcaptcha: {site_key: '<string>', secret: '<string>'},
friendly_captcha: {site_key: '<string>', secret: '<string>'},
arkose: {
site_key: '<string>',
secret: '<string>',
client_subdomain: '<string>',
verify_subdomain: '<string>',
fail_open: true
}
}
})
};
fetch('https://{tenantDomain}/api/v2/attack-protection/captcha/policies/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/attack-protection/captcha/policies/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'priority' => 2,
'match' => [
'auth0_managed' => [
'<string>'
],
'geo_country_codes' => [
'<string>'
]
],
'action' => [
'simple_captcha' => [
],
'auth_challenge' => [
'fail_open' => true
],
'recaptcha_v2' => [
'site_key' => '<string>',
'secret' => '<string>'
],
'recaptcha_enterprise' => [
'site_key' => '<string>',
'project_id' => '<string>',
'api_key' => '<string>'
],
'hcaptcha' => [
'site_key' => '<string>',
'secret' => '<string>'
],
'friendly_captcha' => [
'site_key' => '<string>',
'secret' => '<string>'
],
'arkose' => [
'site_key' => '<string>',
'secret' => '<string>',
'client_subdomain' => '<string>',
'verify_subdomain' => '<string>',
'fail_open' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenantDomain}/api/v2/attack-protection/captcha/policies/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"priority\": 2,\n \"match\": {\n \"auth0_managed\": [\n \"<string>\"\n ],\n \"geo_country_codes\": [\n \"<string>\"\n ]\n },\n \"action\": {\n \"simple_captcha\": {},\n \"auth_challenge\": {\n \"fail_open\": true\n },\n \"recaptcha_v2\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"recaptcha_enterprise\": {\n \"site_key\": \"<string>\",\n \"project_id\": \"<string>\",\n \"api_key\": \"<string>\"\n },\n \"hcaptcha\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"friendly_captcha\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"arkose\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\",\n \"client_subdomain\": \"<string>\",\n \"verify_subdomain\": \"<string>\",\n \"fail_open\": true\n }\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://{tenantDomain}/api/v2/attack-protection/captcha/policies/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"priority\": 2,\n \"match\": {\n \"auth0_managed\": [\n \"<string>\"\n ],\n \"geo_country_codes\": [\n \"<string>\"\n ]\n },\n \"action\": {\n \"simple_captcha\": {},\n \"auth_challenge\": {\n \"fail_open\": true\n },\n \"recaptcha_v2\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"recaptcha_enterprise\": {\n \"site_key\": \"<string>\",\n \"project_id\": \"<string>\",\n \"api_key\": \"<string>\"\n },\n \"hcaptcha\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"friendly_captcha\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"arkose\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\",\n \"client_subdomain\": \"<string>\",\n \"verify_subdomain\": \"<string>\",\n \"fail_open\": true\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/attack-protection/captcha/policies/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"priority\": 2,\n \"match\": {\n \"auth0_managed\": [\n \"<string>\"\n ],\n \"geo_country_codes\": [\n \"<string>\"\n ]\n },\n \"action\": {\n \"simple_captcha\": {},\n \"auth_challenge\": {\n \"fail_open\": true\n },\n \"recaptcha_v2\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"recaptcha_enterprise\": {\n \"site_key\": \"<string>\",\n \"project_id\": \"<string>\",\n \"api_key\": \"<string>\"\n },\n \"hcaptcha\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"friendly_captcha\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"arkose\": {\n \"site_key\": \"<string>\",\n \"secret\": \"<string>\",\n \"client_subdomain\": \"<string>\",\n \"verify_subdomain\": \"<string>\",\n \"fail_open\": true\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"priority": 2,
"match": {
"auth0_managed": [
"<string>"
],
"geo_country_codes": [
"<string>"
]
},
"action": {
"active_provider_id": "simple_captcha",
"simple_captcha": {},
"auth_challenge": {
"fail_open": true
},
"recaptcha_v2": {
"site_key": "<string>"
},
"recaptcha_enterprise": {
"site_key": "<string>",
"project_id": "<string>"
},
"hcaptcha": {
"site_key": "<string>"
},
"friendly_captcha": {
"site_key": "<string>"
},
"arkose": {
"site_key": "<string>",
"client_subdomain": "<string>",
"verify_subdomain": "<string>",
"fail_open": true
}
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>"
}{
"message": "<string>",
"statusCode": 400,
"error": "Bad Request"
}{
"message": "<string>",
"statusCode": 401,
"error": "Unauthorized"
}{
"message": "<string>",
"statusCode": 403,
"error": "Forbidden"
}{
"message": "<string>",
"statusCode": 404,
"error": "Not Found"
}{
"message": "<string>",
"statusCode": 409,
"error": "Conflict"
}{
"message": "<string>",
"statusCode": 429,
"error": "Too Many Requests"
}Autorisations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Paramètres de chemin
Identifiant de la politique de protection CAPTCHA contre les attaques.
^pol_[1-9A-HJ-NP-Za-km-z]{22}$Corps
Champs de la politique de protection CAPTCHA contre les attaques à mettre à jour.
Corps de la requête de mise à jour d’une politique de protection CAPTCHA contre les attaques. Tous les champs sont facultatifs, mais au moins un doit être fourni. Toute valeur fournie pour match ou action remplace intégralement la valeur stockée plutôt que d’être fusionnée avec celle-ci.
Nom de la politique dans un format lisible par une personne.
1 - 255Description de l’objectif de la politique.
Ordre de résolution des conflits. Plus le nombre est petit, plus la priorité est élevée. Doit être unique pour chaque locataire.
x >= 1Critères de correspondance du trafic pour la politique. Il faut préciser exactement un des deux champs : auth0_managed ou geo_country_codes.
- Option 1
- Option 2
Show child attributes
Show child attributes
Configuration CAPTCHA de remplacement pour cette politique.
Show child attributes
Show child attributes
Réponse
La politique de protection CAPTCHA contre les attaques a été mise à jour avec succès.
Une politique de remplacement pour la protection CAPTCHA contre les attaques.
Identifiant de la politique généré par le système.
Nom de la politique lisible par une personne.
1 - 255Ordre de résolution des conflits. Un nombre plus faible indique une priorité plus élevée.
x >= 1Critères de correspondance du trafic pour la politique. Il faut préciser exactement un des deux champs : auth0_managed ou geo_country_codes.
- Option 1
- Option 2
Show child attributes
Show child attributes
Configuration CAPTCHA de remplacement enregistrée pour cette politique.
Show child attributes
Show child attributes
Horodatage au format ISO 8601 de la création de la politique.
Horodatage au format ISO 8601 de la dernière mise à jour de la politique.
Description de l’objectif de la politique.