Aggiorna membro service account del workspace
POST/v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id}
Richiede un token di accesso OAuth con lo scope org:admin, ottenuto da ant auth login --scope org:admin o da una regola di workload identity federation; le chiavi API Admin non sono accettate. Consulta Gestire WIF con l'Admin API.
Modifica il ruolo di un service account in un workspace.
Il nuovo workspace_role sostituisce quello attuale. Solo le appartenenze
esplicite possono essere aggiornate; per impostare un ruolo sull'appartenenza
implicita al workspace predefinito, aggiungi esplicitamente il service account con
POST /workspaces/{workspace_id}/service_accounts. I workspace archiviati
restituiscono 400. I service account archiviati non possono essere aggiornati e vengono
rifiutati.
Parameters
Returns
Aggiorna membro service account del workspace
<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
$client = new Client(apiKey: 'my-anthropic-api-key');
$betaServiceAccountWorkspaceMember = $client
->beta
->organization
->workspaces
->serviceAccounts
->update(
'service_account_id',
workspaceID: 'workspace_id',
workspaceRole: NoBillingWorkspaceRole::WORKSPACE_ADMIN,
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"
}