Claude Platform Docs

更新合規設定

organization.compliance_settings.update(**kwargs) -> OrganizationComplianceSettings
POST/v1/organizations/compliance_settings

更新您組織的合規設定。

將 state 設為 enabled 會開啟 Compliance API 並開始擷取組織活動事件。將其設為 disabled 則會同時關閉兩者。state 反映 Compliance API 是否已啟用。

將 state 設為其目前值的請求會成功,且資源保持不變。disabled 請求會持續生效,直到後續的 enabled 請求,或組織下一次啟用 Access Transparency 的佈建動作為止:啟用 Access Transparency 也會啟用提供其活動事件的 Compliance API,因此此類佈建(包括重新執行)即使在 disabled 請求之後也會重新啟用 Compliance API。自動化佈建絕不會停用合規設定。

Parameters

Desired state. Accepts the string shorthand "enabled" or "disabled" in place of the object form; the response always returns the canonical object form.

One of the following:
class ComplianceSettingsStateEnabledParam: type: "enabled"
type: Literal["enabled"]
class ComplianceSettingsStateDisabledParam: type: "disabled"
type: Literal["disabled"]
Returns
class OrganizationComplianceSettings: type: "compliance_settings"; state
type: Literal["compliance_settings"]
defaultcompliance_settings

Whether the Compliance API is enabled for this organization.

One of the following:
class ComplianceSettingsStateEnabled: type: "enabled"
type: Literal["enabled"]
defaultenabled
class ComplianceSettingsStateDisabled: type: "disabled"
type: Literal["disabled"]
defaultdisabled
更新合規設定
import os
from anthropic import Anthropic

client = Anthropic(
    api_key=os.environ.get(
        "ANTHROPIC_API_KEY"
    ),  # This is the default and can be omitted
)
organization_compliance_settings = client.organization.compliance_settings.update(
    state={"type": "enabled"},
)
print(organization_compliance_settings.state)
Returns Examples
Response 200
{
  "state": {
    "type": "enabled"
  },
  "type": "compliance_settings"
}