Claude Platform Docs

更新使用者

$client->beta->organization->users->update(string userID, Role role): OrganizationUser
POST/v1/organizations/users/{user_id}

更新成員的組織角色。

Parameters
userID: string

ID of the User.

role: Role

New role for the User.

The accepted values depend on the organization type. Console and API organizations accept user, developer, billing, and claude_code_user; admin cannot be assigned through the API. Claude Enterprise organizations accept user and managed.

Returns
class OrganizationUser { $type = 'user'; $id; $addedAt; /* 3 more */ }
"user" type

Object type.

For Users, this is always "user".

string id

ID of the User.

\Datetime addedAt

RFC 3339 datetime string indicating when the User joined the Organization.

string email

Email of the User.

string name

Name of the User.

Organization role of the User.

更新使用者
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

$client = new Client(apiKey: 'my-anthropic-api-key');

$betaOrganizationUser = $client->beta->organization->users->update(
  'user_id', role: 'user'
);

var_dump($betaOrganizationUser);
Returns Examples
Response 200
{
  "id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
  "added_at": "2024-10-30T23:58:27.427722Z",
  "email": "user@emaildomain.com",
  "name": "Jane Doe",
  "role": "admin",
  "type": "user"
}