Claude Platform Docs

Workspaces

Add Workspace To Service Account
client.Organization.ServiceAccounts.Workspaces.Add(ctx, serviceAccountID, body) (*ServiceAccountWorkspaceMember, error)
POST/v1/organizations/service_accounts/{service_account_id}/workspaces

Requires an OAuth access token with the org:admin scope, from ant auth login --scope org:admin or a workload identity federation rule; Admin API keys are not accepted. See Manage WIF with the Admin API.

List Workspaces For Service Account
client.Organization.ServiceAccounts.Workspaces.List(ctx, serviceAccountID, query) (*PageCursor[ServiceAccountWorkspaceMember], error)
GET/v1/organizations/service_accounts/{service_account_id}/workspaces

Requires an OAuth access token with the org:admin scope, from ant auth login --scope org:admin or a workload identity federation rule; Admin API keys are not accepted. See Manage WIF with the Admin API.

Remove Workspace From Service Account
client.Organization.ServiceAccounts.Workspaces.Remove(ctx, workspaceID, body) (*OrganizationServiceAccountWorkspaceRemoveResponse, error)
DELETE/v1/organizations/service_accounts/{service_account_id}/workspaces/{workspace_id}

Requires an OAuth access token with the org:admin scope, from ant auth login --scope org:admin or a workload identity federation rule; Admin API keys are not accepted. See Manage WIF with the Admin API.