Claude Platform Docs

コンプライアンス設定を更新

client.Beta.Organization.ComplianceSettings.Update(ctx, body) (*BetaComplianceSettings, error)
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
body BetaOrganizationComplianceSettingUpdateParams

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

Returns
type BetaComplianceSettings struct { Type: "compliance_settings"; State }
Type ComplianceSettings
defaultcompliance_settings

Whether the Compliance API is enabled for this organization.

One of the following:
type BetaComplianceSettingsStateEnabled struct { Type: "enabled" }
Type Enabled
defaultenabled
type BetaComplianceSettingsStateDisabled struct { Type: "disabled" }
Type Disabled
defaultdisabled
コンプライアンス設定を更新
package main

import (
	"context"
	"fmt"

	"github.com/anthropics/anthropic-sdk-go"
	"github.com/anthropics/anthropic-sdk-go/option"
)

func main() {
	client := anthropic.NewClient(
		option.WithAPIKey("my-anthropic-api-key"),
	)
	betaComplianceSettings, err := client.Beta.Organization.ComplianceSettings.Update(context.TODO(), anthropic.BetaOrganizationComplianceSettingUpdateParams{
		State: anthropic.BetaComplianceSettingsStateParamUnion{
			OfEnabled: &anthropic.BetaComplianceSettingsStateEnabledParam{},
		},
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaComplianceSettings.State)
}
Returns Examples
Response 200
{
  "state": {
    "type": "enabled"
  },
  "type": "compliance_settings"
}