Claude Platform Docs

服務帳戶

建立服務帳戶
BetaServiceAccount Beta.Organization.ServiceAccounts.Create(parameters, cancellationToken = default)
POST/v1/organizations/service_accounts

需要具有 org:admin 範圍的 OAuth 存取權杖,可透過 ant auth login --scope org:admin 或工作負載身分聯合規則取得;不接受 Admin API 金鑰。請參閱使用 Admin API 管理 WIF

列出服務帳戶
ServiceAccountListPage Beta.Organization.ServiceAccounts.List(parameters, cancellationToken = default)
GET/v1/organizations/service_accounts

需要具有 org:admin 範圍的 OAuth 存取權杖,可透過 ant auth login --scope org:admin 或工作負載身分聯合規則取得;不接受 Admin API 金鑰。請參閱使用 Admin API 管理 WIF

取得服務帳戶
BetaServiceAccount Beta.Organization.ServiceAccounts.Retrieve(parameters, cancellationToken = default)
GET/v1/organizations/service_accounts/{service_account_id}

需要具有 org:admin 範圍的 OAuth 存取權杖,可透過 ant auth login --scope org:admin 或工作負載身分聯合規則取得;不接受 Admin API 金鑰。請參閱使用 Admin API 管理 WIF

更新服務帳戶
BetaServiceAccount Beta.Organization.ServiceAccounts.Update(parameters, cancellationToken = default)
POST/v1/organizations/service_accounts/{service_account_id}

需要具有 org:admin 範圍的 OAuth 存取權杖,可透過 ant auth login --scope org:admin 或工作負載身分聯合規則取得;不接受 Admin API 金鑰。請參閱使用 Admin API 管理 WIF

封存服務帳戶
BetaServiceAccount Beta.Organization.ServiceAccounts.Archive(parameters, cancellationToken = default)
POST/v1/organizations/service_accounts/{service_account_id}/archive

需要具有 org:admin 範圍的 OAuth 存取權杖,可透過 ant auth login --scope org:admin 或工作負載身分聯合規則取得;不接受 Admin API 金鑰。請參閱使用 Admin API 管理 WIF

Models
class BetaServiceAccount { Type = "service_account"; ID; ArchivedAt; /* 8 more */ }

Named non-human identity within the caller's organization.

A service account is a pure identity: name + org. Authorization lives on whatever references it (federation rules).

class BetaServiceAccountWorkspaceMember { Type = "service_account_workspace_member"; CreatedByActorID; Implicit; /* 3 more */ }
JsonElement Type = "service_account_workspace_member"
required string? CreatedByActorID

Tagged ID (user_.../svac_...) of the actor who created this membership.

required bool? Implicit

True when this is the implicit default-workspace membership every service account has when no explicit membership exists. Implicit memberships have role workspace_user and cannot be removed.

required string ServiceAccountID

Tagged service account ID (svac_...).

required string WorkspaceID

Tagged workspace ID (wrkspc_...).

required BetaWorkspaceRole WorkspaceRole

Role of the service account in this workspace. Service accounts cannot hold the workspace_billing role.

One of the following:
WorkspaceAdmin("workspace_admin")
WorkspaceBilling("workspace_billing")
WorkspaceDeveloper("workspace_developer")
WorkspaceRestrictedDeveloper("workspace_restricted_developer")
WorkspaceUser("workspace_user")

服務帳戶工作區

將工作區新增至服務帳戶
BetaServiceAccountWorkspaceMember Beta.Organization.ServiceAccounts.Workspaces.Add(parameters, cancellationToken = default)
POST/v1/organizations/service_accounts/{service_account_id}/workspaces

需要具有 org:admin 範圍的 OAuth 存取權杖,可透過 ant auth login --scope org:admin 或工作負載身分聯合規則取得;不接受 Admin API 金鑰。請參閱使用 Admin API 管理 WIF

列出服務帳戶的工作區
WorkspaceListPage Beta.Organization.ServiceAccounts.Workspaces.List(parameters, cancellationToken = default)
GET/v1/organizations/service_accounts/{service_account_id}/workspaces

需要具有 org:admin 範圍的 OAuth 存取權杖,可透過 ant auth login --scope org:admin 或工作負載身分聯合規則取得;不接受 Admin API 金鑰。請參閱使用 Admin API 管理 WIF

從服務帳戶移除工作區
WorkspaceRemoveResponse Beta.Organization.ServiceAccounts.Workspaces.Remove(parameters, cancellationToken = default)
DELETE/v1/organizations/service_accounts/{service_account_id}/workspaces/{workspace_id}

需要具有 org:admin 範圍的 OAuth 存取權杖,可透過 ant auth login --scope org:admin 或工作負載身分聯合規則取得;不接受 Admin API 金鑰。請參閱使用 Admin API 管理 WIF