You are here

public function Users::update in Auth0 Single Sign On 8.2

Update a User. Required scopes:

  • "update:users" - For any call to this endpoint.
  • "update:users_app_metadata" - For any update that includes "user_metadata" or "app_metadata" fields.

@link https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id

Parameters

string $user_id User ID to update.:

array $data User data to update::

  • Only certain fields can be updated; see the @link below for allowed fields.
  • "user_metadata" and "app_metadata" fields are merged, not replaced.

Return value

mixed|string

Throws

\Exception Thrown by the HTTP client when there is a problem with the API call.

File

vendor/auth0/auth0-php/src/API/Management/Users.php, line 52

Class

Users
Class Users. Handles requests to the Users endpoint of the v2 Management API.

Namespace

Auth0\SDK\API\Management

Code

public function update($user_id, array $data) {
  return $this->apiClient
    ->method('patch')
    ->addPath('users', $user_id)
    ->withBody(json_encode($data))
    ->call();
}