UNPKG

@anthropic-ai/sdk

Version:
96 lines • 4.72 kB
import { APIResource } from "../../../../../core/resource.mjs"; import { buildHeaders } from "../../../../../internal/headers.mjs"; import { startApiCallSpan } from "../../../../../internal/tracing.mjs"; export class Configuration extends APIResource { /** * Retrieve the organization's Claude Code managed settings mode and RBAC Group * order. * * **Accepted credentials:** an organization-level Admin API key with the * `read:claude_code_managed_settings` scope. * * Every request must include the beta header * `anthropic-beta: ce-claude-code-managed-settings-2026-10-06`. A request without * it, or from an organization not enabled for this beta, returns `404`. The Claude * Code Managed Settings API is in beta and is available to Claude Enterprise * organizations only. * * @example * ```ts * const betaClaudeCodeManagedSettingsConfiguration = * await client.beta.organization.claudeCode.managedSettings.configuration.retrieve(); * ``` */ retrieve(params = {}, options) { const { betas } = params ?? {}; return this._client.get('/v1/organizations/claude_code/managed_settings/configuration', { ...options, headers: buildHeaders([ { 'anthropic-beta': [...(betas ?? []), 'ce-claude-code-managed-settings-2026-10-06'].toString() }, options?.headers, ]), __qualifiers: { beta: 'true' }, __span: startApiCallSpan(this._client, 'anthropic.organization.claude_code.managed_settings.configuration.retrieve', options, { route: '/v1/organizations/claude_code/managed_settings/configuration' }), }); } /** * Change the organization's Claude Code managed settings mode, the RBAC Group * order, or both, in one atomic write. * * To change the order, send `rbac_group_order` with the `rbac_group_order_version` * from the read the change is based on. If the order has changed since that read, * the request returns `409`: read it again and retry. To switch modes only if the * order has not changed, send the current `rbac_group_order` and * `rbac_group_order_version` with the new `mode`. * * A switch to `rbac_groups` mode with no RBAC Group settings and no default * settings copies the organization settings into a new default, in the same write, * so members keep the settings they had. The copy does not follow later changes to * the organization settings. If the organization settings cannot be copied, the * request returns `400` and changes nothing. If they cannot be read, are over 1 * MiB or are not valid, setting the default settings first avoids the copy. * * After a switch to `rbac_groups` mode, a member in no listed RBAC Group receives * the default settings, or no settings if no default is set, not the organization * settings. * * **Accepted credentials:** an organization-level Admin API key with the * `write:claude_code_managed_settings` scope. * * Every request must include the beta header * `anthropic-beta: ce-claude-code-managed-settings-2026-10-06`. A request without * it, or from an organization not enabled for this beta, returns `404`. The Claude * Code Managed Settings API is in beta and is available to Claude Enterprise * organizations only. * * A write that returns `503` may have applied. Retrying it is safe. * * @throws {CMEKKeyDisabledError} * @throws {BetaRequestBodyTimeoutError} * @throws {BetaSettingsDocumentLimitExceededError} * @throws {BetaSettingsHistoryLimitExceededError} * @throws {SandboxEgressRestrictedError} * * @example * ```ts * const betaClaudeCodeManagedSettingsConfiguration = * await client.beta.organization.claudeCode.managedSettings.configuration.update( * {}, * ); * ``` */ update(params, options) { const { betas, ...body } = params; return this._client.post('/v1/organizations/claude_code/managed_settings/configuration', { body, ...options, headers: buildHeaders([ { 'anthropic-beta': [...(betas ?? []), 'ce-claude-code-managed-settings-2026-10-06'].toString() }, options?.headers, ]), __qualifiers: { beta: 'true' }, __span: startApiCallSpan(this._client, 'anthropic.organization.claude_code.managed_settings.configuration.update', options, { route: '/v1/organizations/claude_code/managed_settings/configuration' }), }); } } //# sourceMappingURL=configuration.mjs.map