gohighlevel-php-sdk

Users Api

Create User

use \MusheAbdulHakim\GoHighLevel\GoHighLevel;


$client = GoHighLevel::client($access_token,'2021-07-28');


$user = $client->user()->create($companyId,[
                'firstName' => $names[0] ?? '',
                'lastName' => $names[1] ?? '',
                'email' => $userEmail,
                'password' => $userPassword,
                'type' => 'account',
                'role' => 'admin',
                'locationIds' => [$locationId],
                'permissions' => json_encode([
                    "campaignsEnabled" => true,
                    "campaignsReadOnly" => true,
                    "contactsEnabled" => true,
                    "workflowsEnabled" => true,
                    "workflowsReadOnly" => true,
                    "triggersEnabled" => true,
                    "funnelsEnabled" => true,
                    "websitesEnabled" => true,
                    "opportunitiesEnabled" => true,
                    "dashboardStatsEnabled" => true,
                    "bulkRequestsEnabled" => true,
                    "appointmentsEnabled" => true,
                    "reviewsEnabled" => true,
                    "onlineListingsEnabled" => true,
                    "phoneCallEnabled" => true,
                    "conversationsEnabled" => true,
                    "assignedDataOnly" => true,
                    "adwordsReportingEnabled" => true,
                    "membershipEnabled" => true,
                    "facebookAdsReportingEnabled" => true,
                    "attributionsReportingEnabled" => true,
                    "settingsEnabled" => true,
                    "tagsEnabled" => true,
                    "leadValueEnabled" => true,
                    "marketingEnabled" => true,
                    "agentReportingEnabled" => true,
                    "botService" => true,
                    "socialPlanner" => true,
                    "bloggingEnabled" => true,
                    "invoiceEnabled" => true,
                    "affiliateManagerEnabled" => true,
                    "contentAiEnabled" => true,
                    "refundsEnabled" => true,
                    "recordPaymentEnabled" => true,
                    "cancelSubscriptionEnabled" => true,
                    "paymentsEnabled" => true,
                    "communitiesEnabled" => true,
                    "exportPaymentsEnabled" => true
                ]),
            ]);


Update User

use \MusheAbdulHakim\GoHighLevel\GoHighLevel;


$client = GoHighLevel::client($access_token,'2021-07-28');
$client->user()->update($userId, [

]);

Delete User

use \MusheAbdulHakim\GoHighLevel\GoHighLevel;


$client = GoHighLevel::client($access_token,'2021-07-28');
$client->user()->delete($userId);

Get User By Location

$client = GoHighLevel::client($access_token,'2021-07-28');
$client->User()->byLocation($locationId)

Get user

$client = GoHighLevel::client($access_token,'2021-07-28');
$client->User()->get($userId)