Claude Platform Docs

Update Compliance Settings

client.beta.organization.complianceSettings.update(body, options?): BetaComplianceSettings
POST/v1/organizations/compliance_settings

Update your organization's Compliance Settings.

Setting state to enabled turns on the Compliance API and begins capturing organization activity events. Setting it to disabled turns both off. Access Transparency events are an exception: they are still captured while the Compliance API is disabled, and the Compliance API activity feed returns them once it is enabled again. state reflects whether the Compliance API is enabled.

A request that sets state to its current value succeeds and leaves the resource unchanged. A disabled request stays in effect until a later enabled request or the organization's next provisioning action that enables Access Transparency: enabling Access Transparency also enables the Compliance API, which serves its activity events, so such provisioning (including re-runs) re-enables the Compliance API even after a disabled request. Automated provisioning never disables compliance settings.

Parameters
body: ComplianceSettingUpdateParams { state }

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:
interface BetaComplianceSettingsStateEnabledParam { type: "enabled" }
type: "enabled"
interface BetaComplianceSettingsStateDisabledParam { type: "disabled" }
type: "disabled"
Returns
interface BetaComplianceSettings { type: "compliance_settings"; state }
type: "compliance_settings"
defaultcompliance_settings

Whether the Compliance API is enabled for this organization.

One of the following:
interface BetaComplianceSettingsStateEnabled { type: "enabled" }
type: "enabled"
defaultenabled
interface BetaComplianceSettingsStateDisabled { type: "disabled" }
type: "disabled"
defaultdisabled
Errors

Any method can also return the general HTTP errors.

SandboxEgressRestrictedErrorHTTP status 403error code sandbox_egress_restricted

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

Update Compliance Settings
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  apiKey: process.env["ANTHROPIC_API_KEY"] // This is the default and can be omitted
});

const betaComplianceSettings = await client.beta.organization.complianceSettings.update({
  state: { type: "enabled" }
});

console.log(betaComplianceSettings.state);
Returns Examples
Response 200
{
  "state": {
    "type": "enabled"
  },
  "type": "compliance_settings"
}