サービスアカウントのワークスペースメンバーを取得
GET/v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id}
org:admin スコープを持つ OAuth アクセストークンが必要です。ant auth login --scope org:admin またはワークロード ID フェデレーションルールから取得してください。Admin APIキーは受け付けられません。Admin API で WIF を管理するを参照してください。
ワークスペースにおけるサービスアカウントのメンバーシップを取得します。
このワークスペースにおけるサービスアカウントの workspace_role を含むメンバーシップレコードを返します。アーカイブ済みのワークスペースは 400 を返します。デフォルトワークスペースの場合、明示的なメンバーシップが存在しないときは暗黙的な(implicit: true)メンバーシップを返します。明示的に追加されたメンバーシップは、割り当てられたロールとともに返されます。アーカイブ済みのサービスアカウントは 404 を返します。
Parameters
Returns
サービスアカウントのワークスペースメンバーを取得
<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
$client = new Client(apiKey: 'my-anthropic-api-key');
$betaServiceAccountWorkspaceMember = $client
->beta
->organization
->workspaces
->serviceAccounts
->retrieve(
'service_account_id',
workspaceID: 'workspace_id',
betas: [AnthropicBeta::MESSAGE_BATCHES_2024_09_24],
);
var_dump($betaServiceAccountWorkspaceMember);Response 200
{
"created_by_actor_id": "created_by_actor_id",
"implicit": true,
"service_account_id": "service_account_id",
"type": "service_account_workspace_member",
"workspace_id": "workspace_id",
"workspace_role": "workspace_admin"
}Returns Examples
Response 200
{
"created_by_actor_id": "created_by_actor_id",
"implicit": true,
"service_account_id": "service_account_id",
"type": "service_account_workspace_member",
"workspace_id": "workspace_id",
"workspace_role": "workspace_admin"
}