# 更新威胁防护策略 (/zh/api-reference/endpoint/threat-protection-update)

<!-- agent-signals: reading_time_min: 2 · est_tokens: 1405 · updated: 2026-07-30 -->
Related: [Search（搜索）](/zh/api-reference/endpoint/search.md), [搜索反馈](/zh/api-reference/endpoint/search-feedback.md), [Scrape](/zh/api-reference/endpoint/scrape.md), [批量抓取](/zh/api-reference/endpoint/batch-scrape.md), [获取批量抓取状态](/zh/api-reference/endpoint/batch-scrape-get.md), [取消批量抓取](/zh/api-reference/endpoint/batch-scrape-delete.md)

对贵组织的[威胁防护](/zh/features/threat-protection)策略进行全量更新。未指定的字段将重置为默认值。仅限团队管理员。

`PUT /team/threat-protection`

完整文档更新。未指定的字段将重置为默认值。Enterprise 功能，仅限团队管理员使用。

## OpenAPI

```json
{
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "properties": {
            "allowRequestOverrides": {
              "description": "单个请求是否可以传入 `threatProtection` 对象。为 false 时，此类请求会被拒绝，并返回 403。",
              "example": true,
              "type": "boolean"
            },
            "blacklist": {
              "description": "精确域名或通配模式（例如 `*.example.com`）将始终被封禁，无需调用分类器。",
              "example": [
                "*.risky.example"
              ],
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "blockedTlds": {
              "description": "要直接封禁的顶级域名，需使用小写且不带前导点。",
              "example": [
                "zip"
              ],
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "failurePolicy": {
              "description": "分类器不可达时的行为：`closed` 时封禁（默认值），`open` 时允许。",
              "enum": [
                "open",
                "closed"
              ],
              "example": "closed",
              "type": "string"
            },
            "mode": {
              "description": "威胁防护模式。`off` 禁用检查；`normal` 使用 Google Web Risk 检查 URL（每扫描 1 个 URL 额外消耗 2 个额度）。",
              "enum": [
                "off",
                "normal"
              ],
              "example": "normal",
              "type": "string"
            },
            "riskScoreThreshold": {
              "description": "归一化分数（0-100）达到或超过该值时，分类器判定结果会被封禁。值越低，规则越严格。",
              "example": 75,
              "maximum": 100,
              "minimum": 0,
              "type": "integer"
            },
            "whitelist": {
              "description": "精确域名或通配模式将始终被允许，其优先级高于其他所有规则。",
              "example": [
                "*.trusted.example"
              ],
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          },
          "required": [
            "mode"
          ],
          "type": "object"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "properties": {
              "data": {
                "properties": {
                  "allowRequestOverrides": {
                    "description": "单个请求是否可以传入 `threatProtection` 对象。为 false 时，此类请求会被拒绝，并返回 403。",
                    "example": true,
                    "type": "boolean"
                  },
                  "blacklist": {
                    "description": "精确域名或通配模式（例如 `*.example.com`）将始终被封禁，无需调用分类器。",
                    "example": [
                      "*.risky.example"
                    ],
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "blockedTlds": {
                    "description": "要直接封禁的顶级域名，需使用小写且不带前导点。",
                    "example": [
                      "zip"
                    ],
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "configured": {
                    "description": "该组织是否已保存策略（而非使用默认值）。",
                    "example": true,
                    "type": "boolean"
                  },
                  "failurePolicy": {
                    "description": "分类器不可达时的行为：`closed` 时封禁（默认值），`open` 时允许。",
                    "enum": [
                      "open",
                      "closed"
                    ],
                    "example": "closed",
                    "type": "string"
                  },
                  "mode": {
                    "description": "威胁防护模式。`off` 禁用检查；`normal` 使用 Google Web Risk 检查 URL（每扫描 1 个 URL 额外消耗 2 个额度）。",
                    "enum": [
                      "off",
                      "normal"
                    ],
                    "example": "normal",
                    "type": "string"
                  },
                  "riskScoreThreshold": {
                    "description": "归一化分数（0-100）达到或超过该值时，分类器判定结果会被封禁。值越低，规则越严格。",
                    "example": 75,
                    "maximum": 100,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "updatedAt": {
                    "format": "date-time",
                    "nullable": true,
                    "type": "string"
                  },
                  "whitelist": {
                    "description": "精确域名或通配模式将始终被允许，其优先级高于其他所有规则。",
                    "example": [
                      "*.trusted.example"
                    ],
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "type": "object"
              },
              "success": {
                "example": true,
                "type": "boolean"
              }
            },
            "type": "object"
          }
        }
      },
      "description": "团队所属组织当前生效的威胁防护策略。"
    },
    "400": {
      "description": "无效的策略文档。"
    },
    "403": {
      "description": "此团队未启用威胁防护，或者在不允许覆盖时发送了请求覆盖。"
    }
  }
}
```
