更新团队的威胁防护策略
curl --request PUT \
--url https://api.firecrawl.dev/v2/team/threat-protection \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mode": "normal",
"allowRequestOverrides": true,
"blacklist": [
"*.risky.example"
],
"blockedTlds": [
"zip"
],
"failurePolicy": "closed",
"riskScoreThreshold": 75,
"whitelist": [
"*.trusted.example"
]
}
'import requests
url = "https://api.firecrawl.dev/v2/team/threat-protection"
payload = {
"mode": "normal",
"allowRequestOverrides": True,
"blacklist": ["*.risky.example"],
"blockedTlds": ["zip"],
"failurePolicy": "closed",
"riskScoreThreshold": 75,
"whitelist": ["*.trusted.example"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
mode: 'normal',
allowRequestOverrides: true,
blacklist: ['*.risky.example'],
blockedTlds: ['zip'],
failurePolicy: 'closed',
riskScoreThreshold: 75,
whitelist: ['*.trusted.example']
})
};
fetch('https://api.firecrawl.dev/v2/team/threat-protection', 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://api.firecrawl.dev/v2/team/threat-protection",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'mode' => 'normal',
'allowRequestOverrides' => true,
'blacklist' => [
'*.risky.example'
],
'blockedTlds' => [
'zip'
],
'failurePolicy' => 'closed',
'riskScoreThreshold' => 75,
'whitelist' => [
'*.trusted.example'
]
]),
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://api.firecrawl.dev/v2/team/threat-protection"
payload := strings.NewReader("{\n \"mode\": \"normal\",\n \"allowRequestOverrides\": true,\n \"blacklist\": [\n \"*.risky.example\"\n ],\n \"blockedTlds\": [\n \"zip\"\n ],\n \"failurePolicy\": \"closed\",\n \"riskScoreThreshold\": 75,\n \"whitelist\": [\n \"*.trusted.example\"\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.firecrawl.dev/v2/team/threat-protection")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mode\": \"normal\",\n \"allowRequestOverrides\": true,\n \"blacklist\": [\n \"*.risky.example\"\n ],\n \"blockedTlds\": [\n \"zip\"\n ],\n \"failurePolicy\": \"closed\",\n \"riskScoreThreshold\": 75,\n \"whitelist\": [\n \"*.trusted.example\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firecrawl.dev/v2/team/threat-protection")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mode\": \"normal\",\n \"allowRequestOverrides\": true,\n \"blacklist\": [\n \"*.risky.example\"\n ],\n \"blockedTlds\": [\n \"zip\"\n ],\n \"failurePolicy\": \"closed\",\n \"riskScoreThreshold\": 75,\n \"whitelist\": [\n \"*.trusted.example\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"allowRequestOverrides": true,
"blacklist": [
"*.risky.example"
],
"blockedTlds": [
"zip"
],
"configured": true,
"failurePolicy": "closed",
"mode": "normal",
"riskScoreThreshold": 75,
"updatedAt": "2023-11-07T05:31:56Z",
"whitelist": [
"*.trusted.example"
]
},
"success": true
}账户端点
更新威胁防护策略
完整文档更新。未指定的字段将重置为默认值。Enterprise 功能,仅限团队管理员使用。
PUT
/
team
/
threat-protection
更新团队的威胁防护策略
curl --request PUT \
--url https://api.firecrawl.dev/v2/team/threat-protection \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mode": "normal",
"allowRequestOverrides": true,
"blacklist": [
"*.risky.example"
],
"blockedTlds": [
"zip"
],
"failurePolicy": "closed",
"riskScoreThreshold": 75,
"whitelist": [
"*.trusted.example"
]
}
'import requests
url = "https://api.firecrawl.dev/v2/team/threat-protection"
payload = {
"mode": "normal",
"allowRequestOverrides": True,
"blacklist": ["*.risky.example"],
"blockedTlds": ["zip"],
"failurePolicy": "closed",
"riskScoreThreshold": 75,
"whitelist": ["*.trusted.example"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
mode: 'normal',
allowRequestOverrides: true,
blacklist: ['*.risky.example'],
blockedTlds: ['zip'],
failurePolicy: 'closed',
riskScoreThreshold: 75,
whitelist: ['*.trusted.example']
})
};
fetch('https://api.firecrawl.dev/v2/team/threat-protection', 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://api.firecrawl.dev/v2/team/threat-protection",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'mode' => 'normal',
'allowRequestOverrides' => true,
'blacklist' => [
'*.risky.example'
],
'blockedTlds' => [
'zip'
],
'failurePolicy' => 'closed',
'riskScoreThreshold' => 75,
'whitelist' => [
'*.trusted.example'
]
]),
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://api.firecrawl.dev/v2/team/threat-protection"
payload := strings.NewReader("{\n \"mode\": \"normal\",\n \"allowRequestOverrides\": true,\n \"blacklist\": [\n \"*.risky.example\"\n ],\n \"blockedTlds\": [\n \"zip\"\n ],\n \"failurePolicy\": \"closed\",\n \"riskScoreThreshold\": 75,\n \"whitelist\": [\n \"*.trusted.example\"\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.firecrawl.dev/v2/team/threat-protection")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mode\": \"normal\",\n \"allowRequestOverrides\": true,\n \"blacklist\": [\n \"*.risky.example\"\n ],\n \"blockedTlds\": [\n \"zip\"\n ],\n \"failurePolicy\": \"closed\",\n \"riskScoreThreshold\": 75,\n \"whitelist\": [\n \"*.trusted.example\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firecrawl.dev/v2/team/threat-protection")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mode\": \"normal\",\n \"allowRequestOverrides\": true,\n \"blacklist\": [\n \"*.risky.example\"\n ],\n \"blockedTlds\": [\n \"zip\"\n ],\n \"failurePolicy\": \"closed\",\n \"riskScoreThreshold\": 75,\n \"whitelist\": [\n \"*.trusted.example\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"allowRequestOverrides": true,
"blacklist": [
"*.risky.example"
],
"blockedTlds": [
"zip"
],
"configured": true,
"failurePolicy": "closed",
"mode": "normal",
"riskScoreThreshold": 75,
"updatedAt": "2023-11-07T05:31:56Z",
"whitelist": [
"*.trusted.example"
]
},
"success": true
}对贵组织的威胁防护策略进行全量更新。未指定的字段将重置为默认值。仅限团队管理员。
授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
application/json
威胁防护模式。off 禁用检查;normal 使用 Google Web Risk 检查 URL(每扫描 1 个 URL 额外消耗 2 个额度)。
可用选项:
off, normal 示例:
"normal"
单个请求是否可以传入 threatProtection 对象。为 false 时,此类请求会被拒绝,并返回 403。
示例:
true
精确域名或通配模式(例如 *.example.com)将始终被封禁,无需调用分类器。
示例:
["*.risky.example"]
要直接封禁的顶级域名,需使用小写且不带前导点。
示例:
["zip"]
分类器不可达时的行为:closed 时封禁(默认值),open 时允许。
可用选项:
open, closed 示例:
"closed"
归一化分数(0-100)达到或超过该值时,分类器判定结果会被封禁。值越低,规则越严格。
必填范围:
0 <= x <= 100示例:
75
精确域名或通配模式将始终被允许,其优先级高于其他所有规则。
示例:
["*.trusted.example"]
⌘I

