Claude Platform Docs

取得合規設定

client.Organization.ComplianceSettings.Get(ctx) (*OrganizationComplianceSettings, error)
GET/v1/organizations/compliance_settings

擷取您組織的合規設定。

合規設定是單例資源:每個組織恰好有一個,且無需識別碼即可存取。state 欄位反映 Compliance API 是否已啟用。具有上層組織的組織會讀取從上層組織設定繼承的狀態。

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

Whether the Compliance API is enabled for this organization.

One of the following:
type ComplianceSettingsStateEnabled struct { Type: "enabled" }
Type Enabled
defaultenabled
type ComplianceSettingsStateDisabled 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"),
	)
	organizationComplianceSettings, err := client.Organization.ComplianceSettings.Get(context.TODO())
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", organizationComplianceSettings.State)
}
Returns Examples
Response 200
{
  "state": {
    "type": "enabled"
  },
  "type": "compliance_settings"
}