'{username}', 'apiKey' => '{apiKey}', )); // Set up Identity service $service = $client->identityService(); // Get user by their ID $user = $service->getUser('{userId}'); // Reset $user->resetApiKey(); // Show the new API key echo $user->getApiKey();