You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

ghl-sdk

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ghl-sdk

GoHighLevel SDK

1.2.0
latest
Source
npmnpm
Version published
Weekly downloads
89
61.82%
Maintainers
1
Weekly downloads
 
Created
Source

GoHighLevel SDK for JavaScript

NPM Version GitHub License GitHub last commit (branch)

Installation

npm install ghl-sdk  
yarn add ghl-sdk  
pnpm add ghl-sdk  

Overview

The library is organized into distinct client modules — each responsible for a specific set of API interactions aligned with the structure described in official GHL API documentation. For example, the OAuthClient handles authentication and token management, while the LocationsClient encapsulates the location-specific endpoints. Both type definitions and retry logic are included. The pagination should be considered separately for each particular method and use case as there is no consistency across different modules of the underlying GHL API.

Quick Start

import { OAuthClient, LocationsClient, FormsClient } from 'ghl-sdk';  

// Replace this with your own valid GHL credentials
const client_id = '64720d51b50eb849194247ce-lzdnsr6z';
const client_secret = '5060d220-a031-4f39-9cr0-0424e08ffba5';
const grant_type = 'authorization_code';
const user_type = 'Location';
const code = '86b68a0da12ba59f9a85abf2f5bafde171321bdd';
const locationId = 've9EPM428h8vShlRW1KT';

// Exchange OAuth code for access token
const oauthClient = new OAuthClient();
const { access_token } = await oauthClient.getAccessToken({
  client_id,
  client_secret,
  grant_type,
  user_type,
  code,
});

// Fetch location details
const locationsClient = new LocationsClient(accessToken);
const { location } = await locationsClient.findById(locationId);  
console.log(location.name);  

// Fetch the available forms for location
const formsClient = new FormsClient(accessToken);
const { forms, total } = await formsClient.find({ locationId, limit: 100 });
console.log(`Fetched ${forms.length} forms out of ${total}`);

Client Modules

Here's the list of all available client modules and their methods in relation to the official GoHighLevel API documentation. All the type definition details can be found on the auto-generated typedoc pages.

BlogsClient

Client MethodAPI Documentation Reference
findAuthorsGet All Authors
findCategoriesGet All Categories
checkSlugCheck Url Slug
createCreate Blog Post
updateUpdate Blog Post

BusinessesClient

Client MethodAPI Documentation Reference
findByLocationGet Businesses By Location
findByIdGet Business
createCreate Business
updateUpdate Business
removeDelete Business

CalendarsClient

Client MethodAPI Documentation Reference
findGet Calendars
findByIdGet Calendar
createCreate Calendar
updateUpdate Calendar
removeDelete Calendar
findFreeSlotsGet Free Slots
findGroupsGet Groups
createGroupCreate Calendar Group
validateGroupSlugValidate Group Slug
removeGroupDelete Group
updateGroupUpdate Group
updateGroupStatusDisable Group
findEventsGet Calendar Events
findBlockedSlotsGet Blocked Slots
findAppointmentByIdGet Appointment
updateAppointmentUpdate Appointment
createAppointmentCreate Appointment
createBlockSlotCreate Block Slot
updateBlockSlotUpdate Block Slot
removeEventDelete Event
findAppointmentNotesGet Notes
createAppointmentNoteCreate Note
updateAppointmentNoteUpdate Note
removeAppointmentNoteDelete Note
findResourceByIdGet Calendar Resource
updateResourceUpdate Calendar Resource
deleteResourceDelete Calendar Resource
findResourcesByTypeList Calendar Resources
createCalendarResourceCreate Calendar Resource
findNotificationsGet Notifications
createNotificationsCreate Notification
findNotificationByIdGet Notification
updateNotificationUpdate Notification
removeNotificationDelete A Calendar Notification

CampaignsClient

Client MethodAPI Documentation Reference
findGet Campaigns

CompaniesClient

Client MethodAPI Documentation Reference
findByIdGet Company

ContactsClient

Client MethodAPI Documentation Reference
findByIdGet Contact
updateUpdate Contact
removeDelete Contact
upsertUpsert Contact
findByBusinessGet Contacts By BusinessId
createCreate Contact
findGet Contacts
findTasksGet All Tasks
createTaskCreate Task
findTaskByIdGet Task
updateTaskUpdate Task
removeTaskDelete Task
updateTaskStatusUpdate Task Completed
findAppointmentsGet Appointments For Contact
addTagsAdd Tags
removeTagsRemove Tags
findNotesGet All Notes
createNoteCreate Notes
findNoteByIdGet Note
updateNoteGet Note
removeNoteDelete Note
addToCampaignAdd Contact To Campaign
removeFromCampaignRemove Contact From Campaign
removeFromEveryCampaignRemove Contact From Every Campaign
addToWorkflowAdd Contact To Workflow
addRemoveFromBusinessAdd/Remove Contacts From Business
searchSearch Contacts
findDuplicatesGet Duplicate Contact
addFollowersAdd Followers
removeFollowersRemove Followers

ConversationsClient

Client MethodAPI Documentation Reference
findByIdGet Conversation
updateUpdate Conversation
removeDelete Conversation
createCreate Conversation
searchSearch Conversations
findEmailByIdGet Email By Id
cancelScheduledEmailCancel A Scheduled Email Message
findMessageByIdGet Message By Message Id
findMessagesByConversationIdGet Messages By Conversation Id
sendMessageSend A New Message
addInboundMessageAdd An Inbound Message
addOutboundMessageAdd An External Outbound Call
cancelScheduledMessageCancel A Scheduled Message
uploadFileAttachmentsUpload File Attachments
updateMessageStatusUpdate Message Status
findMessageRecordingGet Recording By Message ID
findMessageTranscriptionGet Transcription By Message ID
downloadMessageTranscriptionDownload Transcription By Message ID

CoursesClient

Client MethodAPI Documentation Reference
importImport Courses

CustomFieldsClient

Client MethodAPI Documentation Reference
findByIdGet Custom Field / Folder By Id
updateUpdate Custom Field By Id
removeDelete Custom Field By Id
findByObjectKeyGet Custom Fields By Object Key
createFolderCreate Custom Field Folder
updateFolderUpdate Custom Field Folder Name
removeFolderDelete Custom Field Folder
createCreate Custom Field

CustomMenusClient

Client MethodAPI Documentation Reference
findByIdGet Custom Menu Link
removeDelete Custom Menu Link
updateUpdate Custom Menu Link
findGet Custom Menu Links
createCreate Custom Menu Link

EmailsClient

Client MethodAPI Documentation Reference
createCreate A New Template
findFetch Email Templates
removeDelete A Template
updateUpdate A Template

FormsClient

Client MethodAPI Documentation Reference
findGet Forms
updloadCustomFilesUpload Files To Custom Fields
findSubmissionsGet Forms Submissions

FunnelsClient

Client MethodAPI Documentation Reference
findFunnelsFetch List Of Funnels
findPagesFetch List Of Funnel Pages
countPagesFetch Count Of Funnel Pages
createRedirectCreate Redirect
updateRedirectUpdate Redirect By Id
removeRedirectDelete Redirect By Id
findRedirectsFetch List Of Redirects

InvoicesClient

Client MethodAPI Documentation Reference
generateInvoiceNumberGenerate Invoice Number
findByIdGet Invoice
updateUpdate Invoice
removeDelete Invoice
voidByIdVoid Invoice
sendSend Invoice
recordPaymentRecord A Manual Payment For An Invoice
createCreate Invoice
findList Invoices
createTemplateCreate Template
findTemplatesList Templates
findTemplateByIdGet An Template
updateTemplateUpdate Template
removeTemplateDelete Template
createScheduleCreate Invoice Schedule
findSchedulesList Schedules
findScheduleByIdGet An Schedule
updateScheduleUpdate Schedule
removeScheduleDelete Schedule
createScheduledInvoiceSchedule An Schedule Invoice
manageAutoPaymentManage Auto payment For An Schedule Invoice
cancelScheduledInvoiceCancel An Scheduled Invoice
createText2PayCreate & Send

LCEmailClient

Client MethodAPI Documentation Reference
verifyEmail Verification

LinksClient

Client MethodAPI Documentation Reference
updateUpdate Link
removeDelete Link
findGet Links
createCreate Link

LocationsClient

Client MethodAPI Documentation Reference
findByIdGet Sub-Account (Formerly Location)
updatePut Sub-Account (Formerly Location)
removeDelete Sub-Account (Formerly Location)
createCreate Sub-Account (Formerly Location)
searchSearch
findCustomFieldsGet Custom Fields
createCustomFieldCreate Custom Field
findCustomFieldByIdGet Custom Field
updateCustomFieldUpdate Custom Field
removeCustomFieldDelete Custom Field
uploadCustomFieldFileUploads File to customFields
findCustomValuesGet Custom Values
createCustomValueCreate Custom Value
findCustomValueByIdGet Custom Value
updateCustomValueUpdate Custom Value
removeCustomValueDelete Custom Value
findTemplatesGET all or email/sms templates
removeTemplateDELETE an email/sms template
findTagsGet Tags
createTagCreate Tag
findTagByIdGet Tag By Id
updateTagUpdate Tag
removeTagDelete Tag
searchTasksTask Search Filter
findTimezonesFetch Timezones

MediaClient

Client MethodAPI Documentation Reference
findFilesGet List Of Files
uploadFileUpload File Into Media Library
deleteFileDelete File Or Folder

OAuthClient

Client MethodAPI Documentation Reference
getAccessTokenGet Access Token
findInstalledLocationsGet Locations Where App Is Installed
getLocationTokenGet Location Access Token From Agency Token

ObjectsClient

Client MethodAPI Documentation Reference
findByKeyGet Object Schema By Key / Id
updateByKeyUpdate Object Schema By Key / Id
findByLocationGet All Objects For A Location
createCreate Custom Object
findRecordByIdGet Record By Id
updateRecordUpdate Record
deleteRecordDelete Record
createRecordCreate Record
searchRecordsSearch Object Records

OpportunitiesClient

Client MethodAPI Documentation Reference
findByIdGet Opportunity
removeDelete Opportunity
updateUpdate Opportunity
updateStatusUpdate Opportunity Status
upsertUpsert Opportunity
createCreate Opportunity
searchSearch Opportunity
findPipelinesGet Pipelines
addFollowersAdd Followers
removeFollowersRemove Followers

PaymentsClient

Client MethodAPI Documentation Reference
createWhiteLabelIntegrationProviderCreate White-label Integration Provider
findWhiteLabelIntegrationProvidersList White-label Integration Providers
findOrdersList Orders
findOrderByIdGet Order by ID
createOrderFullfillmentCreate Order Fulfillment
findOrderFullfillmentsList Fulfillment
findTransactionsList Transactions
findTransactionByIdGet Transaction by ID
findSubscriptionsList Subscriptions
findSubscriptionByIdGet Subscription by ID
createCustomIntegrationProviderCreate New Integration
removeCustomIntegrationProviderDeleting An Existing Integration
findCustomIntegrationConnectionFetch Given Provider Config
connectCustomIntegrationCreate New Provider Config
disconnectCustomIntegrationDisconnect Existing Provider Config

ProductsClient

Client MethodAPI Documentation Reference
findByIdGet Product By ID
removeDelete Product By ID
updateUpdate Product By ID
createCreate Product
findList Products
createPriceCreate Price For A Product
findPricesList Prices For A Product
findPriceByIdGet Price By ID For A Product
updatePriceUpdate Price By ID For A Product
removePriceDelete Price By ID For A Product

SaasClient

Client MethodAPI Documentation Reference
findLocationsGet Locations By StripeId With CompanyId
updateUpdate SaaS Subscription
bulkDisableDisable SaaS For Locations
enableEnable SaaS For Location
pausePause Location
updateRebillingUpdate Rebilling

SnapshotsClient

Client MethodAPI Documentation Reference
findGet Snapshots
createShareLinkCreate Snapshot Share Link
findPushBetweenDatesGet Snapshot Push Between Dates
findLastPushByLocationIdGet Last Snapshot Push

SurveysClient

Client MethodAPI Documentation Reference
findGet Surveys
findSubmissionsGet Surveys Submissions

UsersClient

Client MethodAPI Documentation Reference
findByIdGet User
updateUpdate User
removeRemove User
findByLocationGet User By Location
createCreate User
searchSearch Users

WorkflowsClient

Client MethodAPI Documentation Reference
findByLocationIdGet Workflow

Keywords

HighLevel

FAQs

Package last updated on 09 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts