Claude Platform Docs

工作區

列出工作區
$client->beta->organization->workspaces->list(?string afterID, ?string beforeID, ?bool includeArchived, ?int limit): Page<Workspace>
GET/v1/organizations/workspaces
建立工作區
$client->beta->organization->workspaces->create(string name, ?DataResidencyCreateConfig dataResidency, ?string displayColor, ?string externalKeyID, ?array<string,string> tags, ?list<AnthropicBeta> betas): Workspace
POST/v1/organizations/workspaces
取得工作區
$client->beta->organization->workspaces->retrieve(string workspaceID): Workspace
GET/v1/organizations/workspaces/{workspace_id}
更新工作區
$client->beta->organization->workspaces->update(string workspaceID, ?DataResidencyUpdateConfig dataResidency, ?string displayColor, ?string externalKeyID, ?string name, ?array<string,string> tags): Workspace
POST/v1/organizations/workspaces/{workspace_id}
封存工作區
$client->beta->organization->workspaces->archive(string workspaceID): Workspace
POST/v1/organizations/workspaces/{workspace_id}/archive
Models
One of the following:
"global"
"us"
class DataResidency { $allowedInferenceGeos; $defaultInferenceGeo; $workspaceGeo; }
AllowedInferenceGeos allowedInferenceGeos

Permitted inference geo values. 'unrestricted' means all geos are allowed.

DefaultInferenceGeo defaultInferenceGeo

Default inference geo applied when requests omit the parameter.

WorkspaceGeo workspaceGeo

Geographic region for workspace data storage. Immutable after creation.

class DataResidencyCreateConfig { $allowedInferenceGeos; $defaultInferenceGeo; $workspaceGeo; }
?AllowedInferenceGeos allowedInferenceGeos

Permitted inference geo values. Defaults to 'unrestricted' if omitted, which allows all geos. Use the string 'unrestricted' to allow all geos, or a list of specific geos.

?DefaultInferenceGeo defaultInferenceGeo

Default inference geo applied when requests omit the parameter. Defaults to 'global' if omitted. Must be a member of allowed_inference_geos unless allowed_inference_geos is "unrestricted".

?WorkspaceGeo workspaceGeo

Geographic region for workspace data storage. Immutable after creation. Defaults to 'us' if omitted.

class DataResidencyUpdateConfig { $allowedInferenceGeos; $defaultInferenceGeo; }
?AllowedInferenceGeos allowedInferenceGeos

Permitted inference geo values. Use 'unrestricted' to allow all geos, or a list of specific geos.

?DefaultInferenceGeo defaultInferenceGeo

Default inference geo applied when requests omit the parameter. Must be a member of allowed_inference_geos unless allowed_inference_geos is "unrestricted".

One of the following:
"workspace_admin"
"workspace_developer"
"workspace_restricted_developer"
"workspace_user"
class Workspace { $type = 'workspace'; $id; $archivedAt; /* 7 more */ }
class WorkspaceMember { $type = 'workspace_member'; $userID; $workspaceID; $workspaceRole; }
"workspace_member" type

Object type.

For Workspace Members, this is always "workspace_member".

string userID

ID of the User.

string workspaceID

ID of the Workspace.

WorkspaceRole workspaceRole

Role of the Workspace Member.

One of the following:
"workspace_admin"
"workspace_billing"
"workspace_developer"
"workspace_restricted_developer"
"workspace_user"

工作區速率限制

列出工作區速率限制
$client->beta->organization->workspaces->rateLimits->list(string workspaceID, ?GroupType groupType, ?int limit, ?string page): PageCursor<BetaWorkspaceRateLimit>
GET/v1/organizations/workspaces/{workspace_id}/rate_limits

列出為工作區設定的速率限制覆寫。

工作區成員

列出工作區成員
$client->beta->organization->workspaces->members->list(string workspaceID, ?string afterID, ?string beforeID, ?int limit): Page<WorkspaceMember>
GET/v1/organizations/workspaces/{workspace_id}/members
建立工作區成員
$client->beta->organization->workspaces->members->add(string workspaceID, string userID, NoBillingWorkspaceRole workspaceRole): WorkspaceMember
POST/v1/organizations/workspaces/{workspace_id}/members
取得工作區成員
$client->beta->organization->workspaces->members->retrieve(string userID, string workspaceID): WorkspaceMember
GET/v1/organizations/workspaces/{workspace_id}/members/{user_id}
更新工作區成員
$client->beta->organization->workspaces->members->update(string userID, string workspaceID, WorkspaceRole workspaceRole): WorkspaceMember
POST/v1/organizations/workspaces/{workspace_id}/members/{user_id}
刪除工作區成員
$client->beta->organization->workspaces->members->remove(string userID, string workspaceID): MemberRemoveResponse
DELETE/v1/organizations/workspaces/{workspace_id}/members/{user_id}

工作區服務帳戶

列出服務帳戶工作區成員
$client->beta->organization->workspaces->serviceAccounts->list(string workspaceID, ?int limit, ?string page, ?list<AnthropicBeta> betas): PageCursor<ServiceAccountWorkspaceMember>
GET/v1/organizations/workspaces/{workspace_id}/service_accounts

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

建立服務帳戶工作區成員
$client->beta->organization->workspaces->serviceAccounts->add(string workspaceID, string serviceAccountID, NoBillingWorkspaceRole workspaceRole, ?list<AnthropicBeta> betas): ServiceAccountWorkspaceMember
POST/v1/organizations/workspaces/{workspace_id}/service_accounts

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

取得服務帳戶工作區成員
$client->beta->organization->workspaces->serviceAccounts->retrieve(string serviceAccountID, string workspaceID, ?list<AnthropicBeta> betas): ServiceAccountWorkspaceMember
GET/v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id}

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

更新服務帳戶工作區成員
$client->beta->organization->workspaces->serviceAccounts->update(string serviceAccountID, string workspaceID, NoBillingWorkspaceRole workspaceRole, ?list<AnthropicBeta> betas): ServiceAccountWorkspaceMember
POST/v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id}

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

刪除服務帳戶工作區成員
$client->beta->organization->workspaces->serviceAccounts->remove(string serviceAccountID, string workspaceID, ?list<AnthropicBeta> betas): ServiceAccountRemoveResponse
DELETE/v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id}

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