Claude Platform Docs

Обновление настроек соответствия требованиям

client.Organization.ComplianceSettings.Update(ctx, body) (*OrganizationComplianceSettings, error)
POST/v1/organizations/compliance_settings

Обновление настроек соответствия требованиям (Compliance Settings) вашей организации.

Установка для state значения enabled включает Compliance API и запускает сбор событий активности организации. Установка значения disabled отключает и то, и другое. Исключение составляют события Access Transparency: они продолжают собираться, пока Compliance API отключён, и лента активности Compliance API возвращает их после его повторного включения. state отражает, включён ли Compliance API.

Запрос, устанавливающий для state его текущее значение, выполняется успешно и оставляет ресурс без изменений. Запрос disabled остаётся в силе до последующего запроса enabled или до следующего действия по подготовке (provisioning) организации, которое включает Access Transparency: включение Access Transparency также включает Compliance API, который предоставляет её события активности, поэтому такая подготовка (включая повторные запуски) снова включает Compliance API даже после запроса disabled. Автоматическая подготовка никогда не отключает настройки соответствия требованиям.

Parameters
body OrganizationComplianceSettingUpdateParams

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 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
Errors

Any method can also return the general HTTP errors.

ErrorCodeSandboxEgressRestrictedHTTP status 403error code sandbox_egress_restricted

The request came from a Claude sandbox with restricted network access, which is not allowed to make this request. Send it from outside the sandbox, or from a sandbox with unrestricted network access.

Обновление настроек соответствия требованиям
package main

import (
	"context"
	"fmt"

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

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