gohighlevel-php-sdk

Sub-Account (Formerly Location) Resource

Location

The Location (Formerly Location) class is the main resource for managing GoHighLevel locations. It handles all basic CRUD (Create, Read, Update, Delete) operations for a location and provides access to sub-resources for managing custom fields, custom values, tags, templates, and more.


create(array $params): array|string

Creates a new location.


get(string $locationId): array|string

Retrieves a single location by its ID.


update(string $locationId, array $params = []): array|string

Updates an existing location.


delete(string $locationId, array $params = []): array|string

Deletes a location.


tag(): TagContract

Returns an instance of the Tag sub-resource for managing tags within a location.


customField(): CustomFieldContract

Returns an instance of the CustomField sub-resource for managing custom fields within a location.


customValue(): CustomValueContract

Returns an instance of the CustomValue sub-resource for managing custom values within a location.


template(): TemplateContract

Returns an instance of the Template sub-resource for managing templates within a location.


search(): SearchContract

Returns an instance of the Search sub-resource for searching locations and tasks.


timezone(): TimezoneContract

Returns an instance of the Timezone sub-resource for listing timezones.


CustomField

The CustomField class is a sub-resource of Location that manages custom fields. It allows you to create, retrieve, update, and delete custom fields, as well as upload files to file-type fields.


list(string $locationId, array $params = []): array|string

Retrieves all custom fields for a specific location.


create(string $locationId, string $name, string $dataType, array $params): array|string

Creates a new custom field.


get(string $locationId, string $id): array|string

Retrieves a single custom field by its ID.


update(string $locationId, string $id, array $params): array|string

Updates an existing custom field.


delete(string $locationId, string $id): array|string

Deletes a custom field.


upload(string $locationId, array $params): array|string

Uploads a file to a custom field. The params array should contain the file data for a multipart request.


CustomValue

The CustomValue class, a sub-resource of Location, is used to manage custom values. These are dynamic key-value pairs that can be used for things like company logos, brand colors, or default text.


list(string $locationId): array|string

Retrieves all custom values for a location.


create(string $locationId, array $params): array|string

Creates a new custom value.


get(string $locationId, string $id): array|string

Retrieves a single custom value by its ID.


update(string $locationId, string $id, array $params): array|string

Updates an existing custom value.


delete(string $locationId, string $id): array|string

Deletes a custom value.


The Search class is a sub-resource for searching locations and tasks.


search(array $params): array|string

Searches for locations based on various criteria. The query method is an alias for this method.


query(array $params = []): array|string

An alias for the search method.


tasks(string $locationId, array $params = []): array|string

Searches for tasks within a specific location.


Tag

The Tag class, a sub-resource of Location, is used to manage tags associated with a location.


list(string $locationId): array|string

Retrieves all tags for a specific location.


create(string $locationId, array $params): array|string

Creates new tags in a location.


get(string $locationId, string $tagId): array|string

Retrieves a single tag by its ID.


update(string $locationId, string $tagId, array $params): array|string

Updates a tag.


delete(string $locationId, string $tagId): array|string

Deletes a tag.


Template

The Template class is a sub-resource of Location for managing templates.


list(string $locationId, string $originId, array $params = []): array|string

Retrieves a list of templates for a location based on an originId.


delete(string $locationId, string $id): array|string

Deletes a template from a location.


Timezone

The Timezone class is a sub-resource of Location for retrieving timezone information.


list(string $locationId): array|string

Retrieves a list of all available timezones for a location.