# SDKs

> All 6 pages of the "SDKs" section of the HighLevel API guides. Every guide page in one file: https://marketplace.gohighlevel.com/docs/llms/guides.txt. Index of all LLM files: https://marketplace.gohighlevel.com/docs/llms.txt

## Contents

- Getting Started with HighLevel SDKs: https://marketplace.gohighlevel.com/docs/sdk/GettingStartedSDK.md
- HighLevel Marketplace CLI: https://marketplace.gohighlevel.com/docs/sdk/marketplace-cli.md
- Marketplace Developer MCP Server: https://marketplace.gohighlevel.com/docs/sdk/marketplace-cli/mcp.md
- HighLevel Node.js SDK: https://marketplace.gohighlevel.com/docs/sdk/node.md
- HighLevel PHP SDK: https://marketplace.gohighlevel.com/docs/sdk/php.md
- HighLevel Python SDK: https://marketplace.gohighlevel.com/docs/sdk/python.md

---

# Getting Started with HighLevel SDKs

Source: https://marketplace.gohighlevel.com/docs/sdk/GettingStartedSDK

HighLevel now ships official SDKs for Node.js, Python, and PHP so you can stop hand-rolling API calls. All three clients deliver the same core features—automatic OAuth flows, PIT support, per-location token storage, webhook helpers, auto refresh tokens and typed service methods—so pick the runtime that matches your stack.

## Pick your language

| SDK | Package | Minimum runtime | Deep dive |
| --- | --- | --- | --- |
| Node.js | `@gohighlevel/api-client` | Node.js 18+ | [Node guide](./node.md) |
| Python | `gohighlevel-api-client` | Python 3.8+ | [Python guide](./python.md) |
| PHP | `gohighlevel/api-client` | PHP 7.4+ | [PHP guide](./php.md) |

## Installation quick reference

```bash
npm install @gohighlevel/api-client
# or
yarn add @gohighlevel/api-client
# or
pnpm add @gohighlevel/api-client
```

  Read the Node guide when you are ready.

```bash
pip install gohighlevel-api-client
# or
poetry add gohighlevel-api-client
```

  Continue with the Python guide.

```bash
composer require gohighlevel/api-client
```

  Dive into the PHP guide.

## What you get out of the box

- **Auto token rotation** – refresh happens transparently once storage is configured.
- **Webhook utilities** – signature validation plus automatic handling of webhook events (INSTALL and UNINSTALL).
- **Token for bulk installation** – if webhook is used, it will generate token for each location in which app is installed and store it in the db

---

# HighLevel Marketplace CLI

Source: https://marketplace.gohighlevel.com/docs/sdk/marketplace-cli

The HighLevel Marketplace CLI provides the `ghl` command for creating, configuring, testing, and publishing apps in the [HighLevel Marketplace developer portal](https://marketplace.gohighlevel.com).

The CLI supports interactive use in a terminal and non-interactive use in scripts, CI pipelines, and AI coding agents. It validates supported changes before sending them to the Marketplace API and can synchronize app configuration through local JSON files.

## Requirements

- Node.js 20.12 or later
- A [HighLevel developer account](https://marketplace.gohighlevel.com)

## Install the CLI

Install the package globally with npm:

```bash
npm install -g @gohighlevel/marketplace-cli
```

Verify the installation:

```bash
ghl --version
```

### Update the CLI

Update to the latest published version with the package manager that installed the CLI:

```bash
ghl update
```

| Command | Description |
| --- | --- |
| `ghl update` | Install the latest published CLI using the detected global package manager. Supports `--dry-run`, `--package-manager auto\|npm\|pnpm\|yarn\|bun\|volta`, and `--json`. |

Use `--dry-run` to print the package-manager command without running it. The package manager is detected automatically by default; pass `--package-manager` to override detection. Run `ghl --version` afterward to verify the installed version.

## Get help

Use the built-in help to explore commands and their current arguments and flags:

| Command | Description |
| --- | --- |
| `ghl --help` | Show the top-level command groups. |
| `ghl help [command]` | Show help for a command or topic. |
| `ghl <command> --help` | Show the arguments, flags, and examples for a specific command. |
| `ghl commands` | List every available command. Add `--json` for machine-readable output. |
| `ghl --version` | Show the installed CLI version. |

Use the full `--help` flag; the short `-h` flag is not supported. `ghl help` also supports `--nested-commands` to include nested command topics. Read commands commonly support `--json`. Destructive commands ask for confirmation in an interactive terminal and require `--force` when run non-interactively.

## Authenticate and select a developer account

Log in through the browser:

```bash
ghl login
```

Use `ghl login --no-browser` to print the approval URL instead of opening it. Use `--profile <name>` to keep separate login identities; the default profile is named `default`.

One login can have access to multiple developer accounts. The following commands manage the active login and account:

| Command | Description |
| --- | --- |
| `ghl login` | Authenticate through the browser. Supports `--no-browser` and `--profile <name>`. |
| `ghl account` | List accessible developer accounts and mark the active account. Supports `--json`. |
| `ghl account switch [accountId]` | Switch the account used by subsequent commands. Omitting the ID opens an interactive picker; scripts must provide it. |
| `ghl logout` | Delete stored login tokens and the current app selection. Unrevealed one-time secrets remain in the local ledger. |

Switching accounts clears the app selection stored for the previous account. Existing app workspaces remain bound to their original apps.

## Quick start

Create an app and synchronize its local configuration:

```bash
ghl login
ghl account
ghl account switch
ghl app create
ghl app pull --with-types
ghl app validate
ghl app diff
ghl app push
ghl app validate --remote
ghl app publish
```

For an existing app, create a local workspace with:

```bash
ghl app pull <appId>
```

After the first pull, run `ghl app pull` anywhere inside that workspace to refresh it.

## Interactive and non-interactive use

When a mutating command runs in a terminal without all its arguments, the CLI prompts for the missing values and pre-fills current values when available.

- Type in searchable pickers to filter long lists. Use `space` or `tab` to select and `enter` to confirm.
- Press `Esc` or `Ctrl+C` to cancel. A cancellation exits successfully without making an API call.
- Non-interactive commands never wait for prompts. They exit with an error that identifies the required flags.
- Use `--json` on supported read commands and check the process exit code before consuming stdout.
- Pass `--force` only after reviewing destructive or irreversible changes.

The CLI exits with code `0` on success or user cancellation and a non-zero code on errors. Human-readable errors and progress indicators are written to stderr; JSON-enabled commands write structured output to stdout.

## App workspaces and selection

Commands resolve the current app in this order:

1. An explicit `--app <id>` flag
2. The nearest parent directory containing `ghl-app.json`
3. The selection saved by `ghl app use` or `ghl app create`

Use `ghl app current` to verify which app and version a command will target.

`ghl app create` creates the remote app, generates a local workspace, and selects the app. `ghl app pull [appId]` creates a workspace for an existing app or refreshes the current one. When creating a workspace non-interactively, pass `--directory <parent>` and `--folder <name>`.

The portal remains the source of truth. Before pushing, `ghl app diff` compares the last pull, local files, and the current portal state. `ghl app push` rejects conflicts, merges non-overlapping set changes, updates only changed API sections, verifies the remote result, and refreshes the local state. Use `--dry-run` to inspect the API plan without changing local or remote state.

Important workspace files include:

| File | Purpose |
| --- | --- |
| `ghl-app.json` | App identity, version binding, listing, profiles, OAuth metadata, support, billing settings, and review configuration. |
| `src/webhooks/ghl-webhooks.json` | Webhook URL and event subscriptions. |
| `src/modules/workflows/actions/<action-name>.json` | One workflow action per file. |
| `src/modules/workflows/actions/code/<action-key>.<version>.js` | Checked JavaScript handler for a code-backed action version. |
| `src/modules/workflows/actions/code/<action-key>.<version>.ts` | Optional TypeScript handler created with `ghl app actions create --typescript`. |
| `src/modules/workflows/triggers/<trigger-name>.json` | One workflow trigger per file. |
| `src/billing/subscription.json` | Marketplace subscription plans. |
| `src/billing/usage-based.json` | Fixed or dynamic usage meters and price tiers. |
| `.ghl/schemas/*.schema.json` | JSON Schemas generated on every pull for app, webhook, workflow action and trigger, subscription, and usage-based JSON. |
| `.vscode/settings.json` | VS Code schema associations, created on pull only when no settings file exists. |
| `ghl-app.d.ts` | Optional readonly TypeScript declarations for every supported app, webhook, workflow, and billing JSON shape. |
| `tsconfig.json` | App TypeScript project configuration, created when absent. An existing `tsconfig.json` or `jsconfig.json` is extended instead of replaced. |
| `tsconfig.actions.json` | Isolated project for type-checking JavaScript and TypeScript workflow actions against the action sandbox. |
| `.ghl/types/actions/*.d.ts` | Generated shared runtime, input, output, and versioned handler declarations for workflow actions. |
| `.ghl/types/actions/eslint.config.actions.mjs` | Reusable ESLint flat-config override with the action sandbox globals. |
| `eslint.config.mjs` | ESLint entry point, generated only when the app has no ESLint configuration. |
| `.ghl/*.json` | Private synchronization baselines used for three-way conflict detection. Do not edit these files. |
| `HIGHLEVEL_APP.md` | Generated guide to the workspace structure and synchronization flow. |
| `AGENTS.md` and `CLAUDE.md` | Generated command and workspace guidance for coding agents. |

Workspace configuration does not contain credentials. Client secrets, SSO keys, review credentials, password defaults, and secret-bearing external-auth values are not exported. Generated manifests use schema version `1`; generated configuration files use mode 0644 and private CLI state uses mode 0600.

Running `ghl app pull` replaces generated JSON with portal values, so run `ghl app diff` first if the workspace may contain unpushed changes. Pulling into an existing folder is allowed only when its `ghl-app.json` belongs to the same app. Developer-created files and customized agent instructions are preserved. Local workflow-action code changes, and portal edits to TypeScript-backed action code, stop the pull with conflict paths; pass `--force` to discard local action changes and accept the portal JavaScript.

## Select and synchronize apps

| Command | Description |
| --- | --- |
| `ghl app list` | List apps. Supports `--search <text>`, `--limit <n>` (default `50`), `--skip <n>`, and `--json`. |
| `ghl app create` | Create a remote app and local workspace, then select it. Non-interactive use requires app type, target user, listing type, and installer rules where applicable. Supports `--json`. |
| `ghl app pull [appId]` | Create or refresh a local workspace. JSON Schemas and editor associations are always generated; add `--with-types` to also generate TypeScript declarations and project configuration. Add `--force` to replace workflow-action conflicts with portal JavaScript. Also supports `--version <versionId\|semver>`, `--directory <parent>`, `--folder <name>`, and `--json`. |
| `ghl app types` | Regenerate TypeScript declarations, workflow-action types, project configuration, JSON Schemas, and VS Code associations without authentication or API calls. Supports `--directory <app-folder>`, `--output <file.d.ts>`, and `--json`. |
| `ghl app validate` | Validate local workspace files without authentication or API calls. Add `--json-schema` to print a configuration schema, or `--remote` for the server publish-readiness checklist. Supports `--json`. |
| `ghl app diff` | Show local changes, portal-only changes, conflicts, and the minimal API plan. Supports `--directory` and `--json`. |
| `ghl app push` | Validate, merge, push only changed sections, verify, and refresh local state. Supports `--directory`, `--dry-run`, and `--json`. |
| `ghl app use [appId]` | Select an app and version. Omitting the ID opens an interactive picker. |
| `ghl app current` | Show the workspace or stored app selection. Supports `--json`. |
| `ghl app info` | Show the selected app and its publish readiness. Supports `--json`. |

For non-interactive app creation, provide `--name`, `--type public|private`, `--target sub-account|agency`, and `--listing white-label|standard`. A sub-account target also requires `--installer everyone|agency-only`; `--installer` is invalid for agency-targeted apps. Use `--directory <parent>` and `--folder <name>` to control the workspace destination. If remote creation succeeds but local initialization fails, recover the app with `ghl app pull <appId>`.

Editing a live version automatically creates and selects a pending draft when required, so subsequent commands continue against the editable version.

## Generate JSON Schemas and TypeScript types

Every pull generates offline draft-07 JSON Schemas for the workspace's JSON files, adds local `$schema` references to generated JSON, and creates VS Code schema associations, so supported editors validate and autocomplete configuration as you type. The CLI compiles the same schemas for `ghl app validate`, so editor and CLI structural rules stay consistent.

| Command | Description |
| --- | --- |
| `ghl app pull --with-types` | Pull the workspace and also generate TypeScript declarations and project configuration. |
| `ghl app types` | Regenerate `ghl-app.d.ts`, workflow-action declarations when actions exist, project configuration, all six JSON Schemas, and VS Code associations without an API call. Use `--output <file.d.ts>` to change the declaration path. |
| `ghl app validate --json-schema` | Print the app configuration schema and exit. |
| `ghl app validate --json-schema --schema <config>` | Print another configuration schema. Supported values are `app`, `webhooks`, `workflow-action`, `workflow-trigger`, `subscription`, and `usage-based`. |

`--schema` requires `--json-schema`, and `--json-schema` cannot be combined with `--remote`.

Type generation creates `tsconfig.json` when absent, or adds the declaration file to the `include` or `files` list of an existing `tsconfig.json` or `jsconfig.json` while preserving comments and developer settings. Workflow action code uses a separate `tsconfig.actions.json` because the action sandbox excludes browser and Node.js globals. Existing `.vscode/settings.json` files and developer-owned ESLint configurations are never replaced.

Application code can import the generated interfaces:

```typescript
import type { GhlAppManifest } from './ghl-app.js'
```

Generated declarations and toolchain configuration contain the marker `Auto generated by @gohighlevel/marketplace-cli`. Regenerate these files with `ghl app types` instead of editing them. The output is deterministic, so identical inputs produce clean diffs. JSON Schemas cover structure only; contextual, remote-catalog, security, code, and cross-file rules are still enforced by the CLI validators.

## Configure the listing and profiles

Section editors are interactive with existing values pre-filled and also support fully flag-driven use. Each editor saves the complete section after merging the supplied values with the current configuration.

| Command | Description |
| --- | --- |
| `ghl app basic-info` | Configure with `--name`, `--tagline`, `--company`, `--website`, repeatable `--category` and `--niche`, and `--logo-url`. |
| `ghl app listing` | Configure with `--type`, `--target`, `--installer`, `--listing`, and `--keywords`. |
| `ghl app profiles` | Configure with `--description`, `--video-url`, `--sub-account` or `--no-sub-account`, `--sub-description`, and `--sub-video-url`. |
| `ghl app support` | Configure with `--email`, `--phone`, `--website`, `--docs-url`, `--terms-url`, `--privacy-url`, and repeatable `--service`. |
| `ghl app review-details` | Configure with `--demo`, `--scopes-demo`, `--credentials`, `--notes`, and `--private-reason`. |

All five commands support `--app <appId>` and require at least one field flag outside a terminal. The CLI enforces Marketplace constraints such as a 20–170 character tagline, one to three categories, up to three niches, 300–5000 character plain-text profile descriptions, HTTPS YouTube preview videos, required support contact details, and public-review requirements. Run each command with `--help` for accepted values.

## Manage media

| Command | Description |
| --- | --- |
| `ghl app media upload <files...>` | Upload and attach a logo or profile screenshots. Use `--logo` for one logo or `--profile agency|sub-account` for screenshots. |
| `ghl app media delete <urls...>` | Detach and delete media. Destructive; scripts must pass `--force`. |

Logo files must be square, 400–800 pixels, and no larger than 512 KB. Screenshots must be 600–1000 pixels wide, have an aspect ratio from 1.5:1 through 1.8:1, and be no larger than 5 MB. Each profile supports at most nine screenshots. Adding the third sub-account screenshot automatically enables the sub-account profile.

## Configure OAuth and client keys

| Command | Description |
| --- | --- |
| `ghl app scopes` | Show the app's current OAuth scopes. Add `--available` for the compatible scope catalog; supports `--json`. |
| `ghl app scopes add [scopes...]` | Add scopes. Omitting scopes opens a searchable picker. Use `--redirect <url>` when saving OAuth configuration for the first time. |
| `ghl app scopes remove [scopes...]` | Remove scopes. Events no longer supported by the remaining scopes are also unsubscribed after confirmation. |
| `ghl app redirect` | Show OAuth redirect URIs. Supports `--json`. |
| `ghl app redirect add [urls...]` | Add redirect URIs. HTTP is supported for local development. |
| `ghl app redirect remove [urls...]` | Remove redirect URIs. Omitting URLs opens a picker of current values. |
| `ghl app redirect default [url]` | Set the default redirect URI for a live, deprecating, or deprecated version. |
| `ghl app keys` | Show OAuth client keys. Supports `--json`. |
| `ghl app keys create [name]` | Create a client ID and reveal-once secret. Add `--reveal` to print the secret immediately instead of retaining it locally; supports `--json`. |
| `ghl app keys delete [keyId]` | Delete a client key and its ledger entry. Destructive; scripts must pass `--force`. |
| `ghl app keys default [keyId]` | Set the default client key. |
| `ghl app sso-key` | Generate or rotate the SSO key. Non-interactive use requires `--force --reveal`. |

All commands in this section accept `--app <appId>`. Adding the first OAuth configuration requires at least one redirect URI. Adding sensitive scopes such as `users.write` or `locations.write` requires confirmation or `--force` in scripts. White-label-friendly apps cannot use HighLevel-branded redirect URLs. A key name is required when creating a key non-interactively.

## Configure webhooks

| Command | Description |
| --- | --- |
| `ghl app webhook` | Show the webhook configuration. Supports `--json`. |
| `ghl app webhook url [url]` | Set the public HTTPS webhook URL in the local workspace and on the portal. |
| `ghl app webhook events` | List events unlocked by the app's current scopes. Supports `--json`. |
| `ghl app webhook subscribe [events...]` | Subscribe to scope-compatible events. Use `--url` for a per-event override. |
| `ghl app webhook unsubscribe [events...]` | Unsubscribe from selected events. |

Webhook mutation commands update and validate the local workspace first, apply only the webhook section remotely, verify the result, and then advance the baseline. A confirmed API rejection restores the previous JSON. If the remote outcome is uncertain, the intended local change remains visible to `ghl app diff` and `ghl app push`.

## Manage workflow actions

Workflow actions are app-scoped and independently versioned. Store one action in each `src/modules/workflows/actions/<action-name>.json` file. The lowercase, hyphenated filename determines the expected underscore-separated `key`; for example, `send-contact-sync-payload.json` requires `send_contact_sync_payload`.

| Command | Description |
| --- | --- |
| `ghl app actions` | List remote actions. Supports workspace selection, `--app`, and `--json`. |
| `ghl app actions pull` | Refresh action JSON, preserve compatible checked JavaScript or TypeScript sources, regenerate the authoring guide, and reset the conflict baseline. Conflicts stop the pull; `--force` accepts portal JavaScript. |
| `ghl app actions create [name]` | Create a local version `1.0` draft with a checked JavaScript handler. Automation supplies `--key <stable_key>`; add `--typescript` to create a native TypeScript handler instead. |
| `ghl app actions validate` | Validate JavaScript handler syntax against the sandbox, or fully type-check and transpile TypeScript, without executing code; then validate local actions and required app scopes. |
| `ghl app actions test <action>` | Execute a local action version through the portal test runner using `--input` or `--input-file`. |
| `ghl app actions diff` | Show three-way changes, conflicts, and create/update/delete operations. Supports `--json`. |
| `ghl app actions push` | Validate and push planned actions independently. Supports `--dry-run`; scripted deletions require `--force`. |
| `ghl app actions delete [key]` | Stage an action deletion locally. Non-interactive staging and the subsequent push require `--force`. |
| `ghl app actions new-version [key]` | Create a server-assigned draft from a published action. |
| `ghl app actions publish [key]` | Publish a complete draft. Automation requires `--notes <change-log> --force`. |

Code-backed actions store their handler in `actions/code/<action-key>.<version>.js` or `.ts` and reference it with `executionConfig.codeFile`. Code files must be UTF-8, no larger than 1 MiB, canonical for the action key and version, and cannot be symbolic links or unreferenced files. `ghl app actions validate` and `push` check these files without executing them.

- **JavaScript** handlers use a generated `// @ts-check` module wrapper with action-specific type references. The CLI validates the wrapper and uploads only the handler body.
- **TypeScript** handlers export one typed default handler. The CLI type-checks and transpiles them in memory before upload; no compiled JavaScript file is written locally.

Both formats are uploaded to the portal as inline JavaScript in `executionConfig.code`. Run `tsc -p tsconfig.actions.json` to type-check action code in CI.

The action sandbox has no `fetch`, Node.js APIs, timers, `crypto`, `URL`, or module loading. Handlers receive `inputData`, `customRequest`, `console`, Lodash (`_`), Moment (`moment`), `fileDownloader`, `_csv`, `_base64`, and `_uuid` through their context. Runtime imports are rejected; type-only imports are removed before upload.

Because the portal stores JavaScript, a pull cannot reconstruct TypeScript from portal code. A pull keeps local JavaScript wrappers, rewrapping portal edits around the new body, and preserves TypeScript while its uploaded JavaScript still matches the portal. Local edits, and portal edits to TypeScript-backed code, stop the pull with conflict paths; `--force` discards local changes and accepts the portal JavaScript.

Use `--publishable` with action validation to enforce release requirements, and optionally target `--action` and `--version`. Action tests accept `--version`, `--input`, `--input-file`, `--location`, and `--json`; `--input` and `--input-file` are mutually exclusive and input defaults to `{}`. An API action test can call its configured endpoint and cause real side effects. The generated `HIGHLEVEL_WORKFLOW_ACTIONS.md` contains the complete JSON authoring reference.

## Manage workflow triggers

Workflow triggers are app-scoped and independently versioned. Store one trigger in each `src/modules/workflows/triggers/<trigger-name>.json` file. As with actions, the hyphenated filename must match the trigger's underscore-separated immutable `key`.

| Command | Description |
| --- | --- |
| `ghl app triggers` | List remote triggers for the current workspace, `--app`, or selected app. |
| `ghl app triggers pull` | Refresh trigger JSON, regenerate the authoring guide, and reset the conflict baseline. |
| `ghl app triggers create [name]` | Create a local version `1.0` draft. Automation supplies `--key <stable_key>`. |
| `ghl app triggers validate` | Validate prerequisites, sample data, filters, variables, callbacks, URLs, secrets, and versions locally. |
| `ghl app triggers diff` | Show three-way changes, conflicts, and create/update/delete operations. |
| `ghl app triggers push` | Validate and push changed triggers independently. Supports `--dry-run`; scripted deletions require `--force`. |
| `ghl app triggers delete [key]` | Stage a local deletion. Non-interactive staging and the subsequent push require `--force`. |
| `ghl app triggers new-version [key]` | Create the next server-assigned draft from a published trigger. |
| `ghl app triggers publish [key]` | Publish after a clean push. Automation requires `--notes <change-log> --force`. |

Add `--publishable`, `--trigger`, and optionally `--version` for targeted release validation. Put representative event data in `customVarsJson`; filter and variable references use dot paths into that data. The generated `HIGHLEVEL_WORKFLOW_TRIGGERS.md` documents all supported fields, callbacks, request and response shapes, and lifecycle rules.

## Manage billing and pricing

The `billing` section in `ghl-app.json` controls the billing model, external billing URL, and trials. Subscription plans and usage meters use an independent JSON-first synchronization flow.

| Command | Description |
| --- | --- |
| `ghl app billing` | Show remote subscription plans and usage meters. |
| `ghl app billing pull` | Refresh local billing manifests and the private billing baseline. |
| `ghl app billing validate` | Validate plans, meters, tiers, product references, version rules, and immutable fields locally. |
| `ghl app billing diff` | Show three-way conflicts and planned plan, meter, and tier operations. |
| `ghl app billing push` | Validate, merge, update only required resources, and verify remote state. Supports `--dry-run`; scripted deletions require `--force`. |
| `ghl app billing plan` | List local subscription plans. |
| `ghl app billing plan create [name]` | Stage a free, monthly, yearly, lifetime, or split agency/location plan. |
| `ghl app billing plan delete [plan]` | Stage plan deletion by ID or exact name. Non-interactive use requires `--force`. |
| `ghl app billing meter` | List local usage meters. |
| `ghl app billing meter create [name]` | Stage fixed or dynamic pricing for supported Marketplace components. |
| `ghl app billing meter delete [meter]` | Stage meter deletion by meter ID or unambiguous product ID. Non-interactive use requires `--force`. |
| `ghl app pricing` | Show portal billing, trial settings, and pricing plans. Supports `--json`. |
| `ghl app pricing setup` | Directly configure free, paid, or freemium portal pricing. |
| `ghl app pricing add` | Directly add a portal pricing plan. |
| `ghl app pricing remove [planId]` | Directly remove a plan. Automation requires the plan ID and `--force`. |

New plan workflows should use `ghl app billing` so local JSON and conflict baselines remain authoritative. The `ghl app pricing` commands remain for compatibility and update the portal directly.

Plans support up to five features and six total plans. After creation, only the plan name and features are editable. Meter prices support six-decimal precision from `0.000001` through `200`. Dynamic pricing is available only for custom products and requires minimum, default, and maximum prices plus a public HTTPS pricing page.

External billing is unavailable for apps created after June 17, 2026. Usage meters are unavailable for template apps and external-billed apps. Workflow action and trigger meters must reference components already registered in the portal.

## Manage versions and publication

| Command | Description |
| --- | --- |
| `ghl app versions` | List all app versions and statuses. |
| `ghl app validate --remote` | Run the server publish-readiness checklist and show fix guidance. |
| `ghl app analyze` | Analyze the draft and recommend the next semantic version. Scope changes require a major version. |
| `ghl app publish` | Publish a private app immediately or submit a public app for review. |
| `ghl app draft` | Create and select a draft from the latest live version. |
| `ghl app withdraw` | Return a version under Marketplace review to draft. Destructive; scripts require `--force`. |
| `ghl app deprecate` | Schedule a live version for deprecation with a date, reason, and optional timezone. |
| `ghl app security-review` | Request a security review for an eligible private live app. |

The first publish uses version `1.0.0`. Later releases must be a patch, minor, or major increment of the current live version. Non-interactive publication requires `--version <x.y.z>`, `--agency-notes`, and `--force`; use `--sub-account-notes` when applicable. Public apps require completed review details and only one version can be in review at a time.

Deprecation must be scheduled at least three days in advance with `--date YYYY-MM-DD` and a user-visible `--reason`; `--timezone` defaults to the local timezone. The newest live version cannot be deprecated, and at least one live version must remain unless the app has only one version.

## Manage sandbox accounts

| Command | Description |
| --- | --- |
| `ghl sandbox` | List sandbox agency accounts and connected apps. Supports `--json`. |
| `ghl sandbox create` | Create a sandbox agency with `--name` and `--password`. |
| `ghl sandbox delete [companyId]` | Delete a sandbox. Omitting the ID opens a picker; scripts require `--force`. |

A developer can have one active sandbox account and must have a phone number on their developer profile. Sandbox passwords must contain at least 12 characters with uppercase, lowercase, number, and special characters. The CLI stores the password in the reveal-once secret ledger and removes its entry when the sandbox is deleted.

## Manage one-time secrets

Client secrets, SSO keys, and sandbox passwords cannot be retrieved from the API after creation. The CLI keeps values it creates in a local ledger until their first reveal.

| Command | Description |
| --- | --- |
| `ghl secrets` | List masked secrets for the selected app. Add `--include-account` for sandbox passwords. |
| `ghl secrets reveal` | Reveal matching values once and atomically remove their local copies. Scripts require `--force`. |

When a ledger write succeeds, creation output shows a masked value. Use the creation command's `--reveal` flag only when a script must receive the value immediately; no local copy is retained in that case. Values created outside the CLI were never captured and must be replaced by rotating them.

## Use the CLI in automation and AI agents

For deterministic non-interactive behavior:

1. Pass all required arguments and flags.
2. Use `--json` on supported read commands and parse stdout only after checking the exit code.
3. Use `--dry-run` before synchronization commands when you need to review the planned API operations.
4. Pass `--force` for a destructive or irreversible operation only after explicitly deciding to perform it.
5. Do not reveal one-time secrets unless the workflow explicitly requires their values.

The CLI validates supported workflows before mutating the API and returns actionable errors for invalid scopes, incomplete publishing details, unsupported versions, and other Marketplace rules.

## Additional resources

- [Marketplace CLI package on npm](https://www.npmjs.com/package/@gohighlevel/marketplace-cli)
- [Marketplace CLI source code](https://github.com/GoHighLevel/marketplace-cli)
- [Marketplace developer portal](https://marketplace.gohighlevel.com)
- [Create a Marketplace app](../oauth/AppCreationGuide.md)
- [Test a Marketplace app](../oauth/AppTestingGuide.md)

---

# Marketplace Developer MCP Server

Source: https://marketplace.gohighlevel.com/docs/sdk/marketplace-cli/mcp

The [HighLevel Marketplace CLI](../marketplace-cli.md) includes a local MCP server, `HighLevelMarketplaceDev`, that connects AI coding assistants to your Marketplace developer account. Once it is set up, you can ask your assistant to answer HighLevel API questions from the official docs, create or pull an app, edit its configuration, add and test workflow actions and triggers, upload media, manage client keys, and release new versions.

The server runs on your machine through the `ghl` command and uses the same login and developer account as the CLI.

## Requirements

- Node.js 20.12 or later
- HighLevel Marketplace CLI 1.1.0 or later
- A [HighLevel developer account](https://marketplace.gohighlevel.com)
- One of the supported AI clients: Claude Code, Codex CLI, Cursor, Gemini CLI, VS Code, or Windsurf

Check your CLI version and update it if needed:

```bash
ghl --version
ghl update
```

New to the CLI? Install it first with `npm install -g @gohighlevel/marketplace-cli`. See [Install the CLI](../marketplace-cli.md#install-the-cli).

## Set up the server

1. Log in to your developer account (you can also do this later from your AI client):

   ```bash
   ghl login
   ```

2. Register the server with your AI clients:

   ```bash
   ghl mcp setup
   ```

   The command lists the supported clients and marks the ones it cannot find on your machine as not detected. Nothing is selected to start with: use the arrow keys and Space to tick each client you want, then press Enter. Only the clients you tick are configured.

3. Restart any AI client that was already open so it loads the server.

4. Confirm that the server is connected:

   | Client | How to check |
   | --- | --- |
   | Claude Code | Run `/mcp` and look for `HighLevelMarketplaceDev`, or run `claude mcp get HighLevelMarketplaceDev` in a terminal. |
   | Codex CLI | Run `codex mcp list`. |
   | Cursor | Open **Settings > Tools & MCP**. |
   | Gemini CLI | Run `/mcp`. |
   | VS Code | Run **MCP: List Servers** from the Command Palette. |
   | Windsurf | Open the MCP servers list in Windsurf settings. |

To configure specific clients without the interactive prompt (for example, in a setup script), pass `--client` once per client:

```bash
ghl mcp setup --client claude --client cursor
```

### Setup options

| Flag | Description |
| --- | --- |
| `--client <id>` | Client to configure: `claude`, `codex`, `cursor`, `gemini`, `vscode`, or `windsurf`. Repeat it for several clients. Required when running non-interactively. |
| `--standalone`, `--no-standalone` | Launch the server through `npx` instead of your installed CLI. On by default only when the CLI itself is running through a package runner such as `npx`. |
| `--cli-version <version>` | Standalone mode only. The CLI version `npx` runs: an exact version such as `1.1.0`, or `latest`. Defaults to the version running setup. |
| `--registry <url>` | Standalone mode only. The npm registry `npx` installs from. Defaults to `https://registry.npmjs.org/`; set it to use a private mirror. |
| `--json` | Print the result as JSON. |

Each client is configured independently, so one failure does not stop the others. Running `ghl mcp setup` again replaces the existing `HighLevelMarketplaceDev` entry. Other servers and settings in the client's configuration are kept.

### Where each client is configured

| Client | Registered with |
| --- | --- |
| Claude Code | `claude mcp add --scope user` (available in every project) |
| Codex CLI | `codex mcp add` |
| Cursor | `~/.cursor/mcp.json` |
| Gemini CLI | `~/.gemini/settings.json` |
| VS Code | Your user `mcp.json`: `~/Library/Application Support/Code/User/mcp.json` on macOS, `~/.config/Code/User/mcp.json` on Linux, `%APPDATA%\Code\User\mcp.json` on Windows |
| Windsurf | `~/.codeium/windsurf/mcp_config.json` |

### Installed and standalone modes

By default, setup registers absolute paths to your Node.js binary and your installed CLI. Editors opened from the Dock or a launcher do not load your shell's `PATH`, so this keeps the server working with Node managers such as nvm, volta, or asdf. If you switch Node.js versions or reinstall the CLI in a different location, run `ghl mcp setup` again.

In standalone mode, clients start the server with `npx`, pinned to a CLI version and registry:

```bash
npx -y --registry=https://registry.npmjs.org/ --package @gohighlevel/marketplace-cli@1.1.0 ghl mcp start
```

Use standalone mode on machines where global npm installs are not allowed, or to pin every client to one CLI version:

```bash
ghl mcp setup --client codex --standalone --cli-version 1.1.0
```

Clients run `ghl mcp start` to launch the server over stdio. You do not need to run it yourself.

## How the server keeps you in control

- **Your CLI session and account.** Tools act as the developer logged in with `ghl login`, in the account selected with `ghl account switch`. The app selected with `ghl app use` is the default app for app tools.
- **Clear read and write tools.** Every tool tells your client whether it only reads or makes changes, so clients that ask before running a tool can ask before changes.
- **Pushes run only the plan you reviewed.** `check-workspace` returns a plan ID for the exact changes it found. `push-workspace` runs only that plan and stops if the files or the portal changed since. When your client supports it, the server also asks you directly, showing every changed field with its old and new value.
- **Secrets stay out of the conversation.** New client secrets and sandbox passwords are saved in the CLI's local secrets store and never appear in tool output. Header secrets are hidden in workflow action test output, and sending a stored secret to a new destination needs your direct approval.
- **Releases only when you ask.** The server instructs the AI to publish, withdraw, or deprecate only on your explicit request.
- **Docs are reference material.** Documentation text is never treated as instructions, so a page cannot make the AI run commands or change files.

## Tools at a glance

| # | Tool | What it does | Changes |
| --- | --- | --- | --- |
| 1 | `login` | Logs in to the developer portal through your browser. | Local session |
| 2 | `get-account` | Shows who is logged in, the available accounts, and the apps in the active account. | Read-only |
| 3 | `switch-account` | Makes another developer account active. | Local session |
| 4 | `search-docs` | Searches the developer docs, API reference, and CLI workspace guides. | Read-only |
| 5 | `fetch-doc` | Reads up to 5 doc pages or API endpoint references in one call. | Read-only |
| 6 | `create-app` | Creates a new app and its local workspace. | Portal and local files |
| 7 | `pull-app` | Writes an app version into a local workspace, or refreshes one. | Local files |
| 8 | `get-app` | Shows an app version, its settings, and its publish readiness. | Read-only |
| 9 | `list-scopes` | Lists OAuth scopes, their token types, and the webhook events they unlock. | Read-only |
| 10 | `scaffold-workflow-module` | Adds draft workflow actions or triggers to a workspace. | Local files |
| 11 | `check-workspace` | Validates a workspace, compares it with the portal, and returns a push plan. | Read-only |
| 12 | `test-workflow-action` | Runs a workflow action through the portal's test runner. | Calls your action's endpoints |
| 13 | `push-workspace` | Pushes the reviewed plan to the portal. | Portal and local files |
| 14 | `update-media` | Sets the logo and adds or removes screenshots. | Portal |
| 15 | `manage-client-keys` | Creates, deletes, or sets the default OAuth client key. | Portal |
| 16 | `manage-sandbox` | Lists, creates, or deletes sandbox agencies. | Portal |
| 17 | `release-workflow-module` | Publishes an action or trigger version, or starts a new version. | Portal and local files |
| 18 | `release-app` | Publishes, withdraws, drafts, deprecates, or requests a security review. | Portal |

### Sign in and choose an account

#### 1. `login`

Opens the developer portal login page in your browser and waits for you to approve it. If you have not approved it within about 45 seconds, the tool returns the login URL and the login keeps waiting in the background for up to 5 minutes. Portal tools work as soon as it completes. If a session already works, the tool reports it instead of logging in again.

Your assistant calls this tool when another tool returns `AUTH_REQUIRED`.

| Parameter | Required | Description |
| --- | --- | --- |
| `force` | No | Log in again even though a session works, for example as another developer. Default `false`. |

**Example prompt:** "Log me in to the HighLevel developer portal."

#### 2. `get-account`

Shows the logged-in developer, the active developer account, the other accounts you can switch to, and the apps in the active account with their app IDs, version, status, and which app is selected. Lists up to 50 apps; use `search` to narrow the list.

| Parameter | Required | Description |
| --- | --- | --- |
| `search` | No | Show only apps whose name contains this text. |

**Example prompt:** "Which apps do I have in my developer account?"

#### 3. `switch-account`

Makes another developer account (team) active for the CLI and these tools, then lists the first apps in it. The app selected in the previous account is cleared. Use it only when you want to work in a different account.

| Parameter | Required | Description |
| --- | --- | --- |
| `accountId` | Yes | The account ID from `get-account`. |

**Example prompt:** "Switch to my agency team account."

### Look up how things work

#### 4. `search-docs`

Searches the HighLevel developer documentation and returns ranked excerpts with links to the matching sections. It covers:

- Marketplace guides: OAuth, scopes, webhooks, billing, external authentication, workflow actions and triggers, and publishing
- Every HighLevel API endpoint
- The CLI's app workspace guides and JSON Schemas

The docs index is cached on your machine, so searches are fast and keep working offline after the first use.

| Parameter | Required | Description |
| --- | --- | --- |
| `query` | Yes | Focused keywords, 2 to 300 characters. Keep exact names such as `X-GHL-Signature`, `contacts.write`, or `ContactCreate`. An endpoint such as `POST /contacts/` also works. |
| `limit` | No | Maximum results, 1 to 10. Default 5. |
| `kind` | No | `all` (default), `guide` for Marketplace guides, `api` for API endpoints, or `cli` for app workspace files and their JSON Schemas. |

**Example prompt:** "How do I verify the webhook signature HighLevel sends?"

#### 5. `fetch-doc`

Reads up to 5 documentation pages in one call, as Markdown. It accepts:

- Documentation URLs from `search-docs`, including `#section` anchors
- API endpoints such as `POST /contacts/` or `GET /contacts/{contactId}`, which return a compact reference: token type, scopes, `Version` header, parameters, and request and response schemas
- CLI workspace guides: `ghl-cli:app`, `ghl-cli:workflow-actions`, `ghl-cli:workflow-triggers`, `ghl-cli:billing`, and `ghl-cli:commands`
- JSON Schemas for workspace files: `ghl-cli:schema/app`, `ghl-cli:schema/webhooks`, `ghl-cli:schema/workflow-action`, `ghl-cli:schema/workflow-trigger`, `ghl-cli:schema/subscription`, and `ghl-cli:schema/usage-based`

For a long guide, it returns the requested section and lists the page's other sections. If an endpoint is not found, it suggests the closest matches.

| Parameter | Required | Description |
| --- | --- | --- |
| `pages` | Yes | 1 to 5 documentation URLs, endpoints, or `ghl-cli:` references. |
| `startIndex` | No | Continue a truncated page from this character offset. Default 0. |
| `maxLength` | No | Characters returned across all pages, 2,000 to 100,000. Default 30,000. |

**Example prompt:** "What scope, token type, and Version header does `GET /contacts/{contactId}` need?"

### Start an app

#### 6. `create-app`

Creates a new app in the developer portal, writes its local workspace, and selects it. Ask for it only when you want a new app; your assistant confirms the name, type, target, installer, and listing with you first. The workspace folder must be outside any existing app workspace.

| Parameter | Required | Description |
| --- | --- | --- |
| `name` | Yes | App name, up to 50 characters. |
| `type` | Yes | `public` (listed in the Marketplace) or `private` (installed by link). |
| `target` | Yes | Who uses the app: `sub-account` or `agency`. |
| `installer` | For sub-account apps | Who may install it: `everyone` (agencies and sub-accounts) or `agency-only`. |
| `listing` | Yes | `standard`, or `white-label` to let agencies rebrand the app. |
| `directory` | Yes | Absolute path of an existing folder to create the workspace folder in. |
| `folder` | No | Workspace folder name. Defaults to the app name. |

**Example prompt:** "Create a private sub-account app called Contact Sync that everyone can install, in `~/code/apps`."

#### 7. `pull-app`

Writes an app version from the developer portal into a local workspace: `ghl-app.json`, webhooks, workflow actions and triggers with their code files, and billing plans and meters. It creates a new workspace folder, or refreshes an existing workspace, and selects the pulled version for the CLI. By default it pulls the latest version, which is the draft when one exists.

It refuses to overwrite local changes you have not pushed (`LOCAL_CHANGES`) unless you pass `force`.

| Parameter | Required | Description |
| --- | --- | --- |
| `appId` | No | The app to pull, from `get-account`. Omit it to refresh the workspace at `directory`. |
| `directory` | Yes | Absolute path of a workspace to refresh, or of the folder to create a new workspace in. |
| `folder` | No | New workspace folder name. Defaults to the app name. |
| `version` | No | Version ID or version number to pull. Defaults to the latest version. |
| `force` | No | Discard unpushed local changes when refreshing. Default `false`. |
| `withTypes` | No | Also write TypeScript declarations and `tsconfig` files for TypeScript workflow actions. Default `false`. |

**Example prompt:** "Pull my Contact Sync app into `~/code/apps` with TypeScript types."

### Review the app

#### 8. `get-app`

Shows one app version as the portal has it, in a single call:

- Status and all versions
- Basic info, OAuth scopes, redirect URIs, and client key names (never secrets)
- Media file names, webhooks, billing, and support details
- Workflow actions and triggers with their versions

For a draft, it also shows **publish readiness**: every missing required field with how to fill it using these tools, what publishing will do (a private app goes live, a public app goes to Marketplace review), and the next version number. For a live or in-review version, it says how the version can change.

| Parameter | Required | Description |
| --- | --- | --- |
| `appId` | No | App ID from `get-account`. Defaults to the app of `directory`, then the selected app. |
| `directory` | No | Absolute path inside an app workspace, used when `appId` is omitted. |

**Example prompt:** "Is my app ready to publish? What is missing?"

#### 9. `list-scopes`

Lists the exact OAuth scope names the developer portal accepts, the token types each scope allows (sub-account or agency), and the webhook events each scope unlocks. Use it to choose scopes for `oauth.allowedScopes` in `ghl-app.json` and events for the webhooks file.

| Parameter | Required | Description |
| --- | --- | --- |
| `query` | No | Words to match in a scope, its label, or a webhook event, such as `contacts` or `ContactCreate`. Omit it to list every scope. |
| `target` | No | Only scopes an app with this target can request: `sub-account` or `agency`. |

**Example prompt:** "Which scope do I need to receive `OpportunityCreate` webhooks?"

### Build and validate

#### 10. `scaffold-workflow-module`

Adds up to 10 draft workflow actions or triggers to a workspace in one call: a JSON file for each, plus a JavaScript or TypeScript handler file for each action. Nothing reaches the portal until you push. The result lists the files to fill in, the guides that describe them, and any prerequisites, such as the `workflows.readonly` scope.

| Parameter | Required | Description |
| --- | --- | --- |
| `directory` | Yes | Absolute path of the app workspace or any folder inside it. |
| `modules` | Yes | 1 to 10 modules, each with `kind` (`action` or `trigger`), a display `name`, and a stable `key` in snake_case that starts with a letter, such as `send_sms`. |
| `typescript` | No | Give new actions a typed TypeScript handler instead of JavaScript. Default `false`. |

**Example prompt:** "Add a workflow action called Send SMS and a trigger called Deal Won to my app."

#### 11. `check-workspace`

Validates every file in an app workspace (app settings, webhooks, workflow actions and triggers, billing) and compares the workspace with the developer portal. For each part it reports errors, your local changes, changes made in the portal since the last pull, and conflicts.

When the changes are valid, it lists exactly what a push would do and returns a **plan ID** for `push-workspace`. If you are not logged in, it checks the local files only. Pointed at a folder that is not a workspace, it lists the workspaces inside that folder.

| Parameter | Required | Description |
| --- | --- | --- |
| `directory` | Yes | Absolute path of the app workspace or any folder inside it. |
| `remote` | No | Also compare with the developer portal. Default `true`; `false` checks local files only. |

**Example prompt:** "Check my app workspace and tell me what would be pushed."

#### 12. `test-workflow-action`

Runs the local, unpushed configuration of a workflow action through the portal's test runner with the input you give it, and returns the action's output and up to 30 lines of console logs. Use it to test changes before you push them. The action may call its real endpoints.

Credential headers are hidden in the output. If the test would send a stored header secret to a URL the portal does not use for that action yet, the server asks for your direct approval first.

| Parameter | Required | Description |
| --- | --- | --- |
| `directory` | Yes | Absolute path of the app workspace or any folder inside it. |
| `key` | Yes | The workflow action key. |
| `input` | No | Input values keyed by field, as a workflow would send them. Up to 64 KB of JSON. |
| `version` | No | The action version to test. Defaults to the draft, otherwise the newest version. |
| `locationId` | No | A sub-account with the app installed, for actions that use location data or external authentication. |

**Example prompt:** "Test the `send_sms` action with phone `+15555550123` and message `Hello`."

#### 13. `push-workspace`

Pushes the plan returned by `check-workspace` to the developer portal: workflow actions first, then triggers, billing, and app settings, in the order the portal requires. It verifies the result and updates the workspace's baseline.

- It refuses with `PLAN_CHANGED` if the files or the portal changed after the plan was made. Run `check-workspace` again and review the new plan.
- When your client supports it, the server asks you directly to approve the push and shows every changed field with its old and new value.
- Editing a live version creates a new draft version; the workspace follows it automatically.
- A version in review cannot be edited. Withdraw it with `release-app` first.
- If one part fails, the push stops and reports what was already applied.

| Parameter | Required | Description |
| --- | --- | --- |
| `directory` | Yes | Absolute path of the app workspace or any folder inside it. |
| `planId` | Yes | The plan ID that `check-workspace` returned for the changes you approved. |

**Example prompt:** "Push those changes."

### Add media and credentials

#### 14. `update-media`

Sets the app logo, adds screenshots to the agency or sub-account profile, and removes attached media, in one call. Every upload is checked before anything is deleted. The result names each file added or removed and the media now on the app.

These changes go to the portal directly, so an open workspace falls behind; refresh it with `pull-app`. Enabling the sub-account profile needs at least 3 screenshots and a valid agency description.

| Parameter | Required | Description |
| --- | --- | --- |
| `appId` | No | Defaults to the app of `directory`, then the selected app. |
| `directory` | No | App workspace whose app is used when `appId` is omitted. |
| `logo` | No | Image file to set as the logo. |
| `screenshots` | No | 1 to 9 image files to add as screenshots. |
| `profile` | No | Profile the screenshots belong to: `agency` (default) or `sub-account`. |
| `remove` | No | 1 to 20 attached media to delete, as file names from `get-app` or URLs. |

Pass at least one of `logo`, `screenshots`, or `remove`.

**Example prompt:** "Upload `./screens/dashboard.png` as an agency screenshot and remove the oldest one."

#### 15. `manage-client-keys`

Creates an OAuth client key, deletes one, or makes one the default for the app. A new key's secret is saved in the CLI's local secrets store and never appears in the conversation; view it once with `ghl secrets reveal`. Deleting a key breaks any integration that uses it.

| Parameter | Required | Description |
| --- | --- | --- |
| `appId` | No | Defaults to the app of `directory`, then the selected app. |
| `directory` | No | App workspace whose app is used when `appId` is omitted. |
| `action` | Yes | `create`, `delete`, or `default`. |
| `name` | For `create` | A name for the new key. |
| `keyId` | For `delete` and `default` | The client key ID from `get-app`. |

**Example prompt:** "Create a client key named Staging for my app."

### Install and try the app

#### 16. `manage-sandbox`

Lists the sandbox agencies you use to install and test apps, creates one, or deletes one with all its data. A new sandbox's password is saved in the CLI's local secrets store; log in with your developer email and view the password once with `ghl secrets reveal`. The portal allows one active sandbox per developer account.

| Parameter | Required | Description |
| --- | --- | --- |
| `action` | Yes | `list`, `create`, or `delete`. |
| `name` | For `create` | The sandbox agency name. |
| `sandboxId` | For `delete` | The company ID from `list`. |

**Example prompt:** "Do I have a sandbox account? If not, create one called QA Sandbox."

### Release

#### 17. `release-workflow-module`

Publishes the pushed draft version of a workflow action or trigger, or starts a new draft version of a published one. Either way, the workspace files are refreshed. Publishing checks the module's release requirements first, such as a trigger's subscription URL, and names the file to fix if one is missing.

| Parameter | Required | Description |
| --- | --- | --- |
| `directory` | Yes | Absolute path of the app workspace or any folder inside it. |
| `action` | Yes | `publish` a draft version, or `new-version` to start a new draft of a published module. |
| `kind` | Yes | `action` or `trigger`. |
| `key` | Yes | The module key. |
| `version` | No | For `publish`: the draft version to publish. Defaults to the current draft. |
| `notes` | For `publish` | The release change log, up to 2,000 characters. |

**Example prompt:** "Publish the `send_sms` action with the change log 'Adds delivery status'."

#### 18. `release-app`

Moves an app version through its release lifecycle. Run it only when you are ready; check readiness with `get-app` first.

| Action | What it does |
| --- | --- |
| `publish` | Publishes the draft. A private app goes live for new installs; a public app is submitted for Marketplace review. The first release is always 1.0.0. Later releases default to the suggested version and need release notes. Readiness is checked first, and only one version can be pending at a time. |
| `withdraw` | Withdraws the version in review. It becomes a draft again so you can edit it. |
| `create-draft` | Creates a new draft from the latest live version. An app can have one draft at a time. |
| `deprecate` | Schedules deprecation of an older live version, with a date at least 3 days ahead and notes for its users. The latest live version cannot be deprecated. Uses your local time zone. |
| `security-review` | Requests a security review of a private app's live version. Available after 4 qualifying agency installs. |

| Parameter | Required | Description |
| --- | --- | --- |
| `action` | Yes | `publish`, `withdraw`, `create-draft`, `deprecate`, or `security-review`. |
| `appId` | No | Defaults to the app of `directory`, then the selected app. |
| `directory` | No | App workspace to keep in sync with the version's new status. |
| `version` | For `deprecate` | For `publish`: the new version number (defaults to the suggested one). For `deprecate`: the live version to retire. |
| `notes` | For `publish` after 1.0.0, and `deprecate` | For `publish`: release notes for agencies. For `deprecate`: notes for users of the version. Up to 2,000 characters. |
| `subAccountNotes` | No | For `publish`: release notes for sub-accounts. |
| `date` | For `deprecate` | Deprecation date as `YYYY-MM-DD`, at least 3 days ahead. |

If a value is not allowed, the error lists what is, for example the allowed version numbers.

**Example prompts:**

- "Publish my app as 1.1.0 with the release notes 'Adds opportunity sync'."
- "Withdraw my app from review."
- "Deprecate version 1.0.0 on 2026-12-31 and tell users to upgrade."

---

# HighLevel Node.js SDK

Source: https://marketplace.gohighlevel.com/docs/sdk/node

The official `@gohighlevel/api-client` package wraps every HighLevel REST endpoint with a typed, promise-based interface. You get automatic OAuth handling, token rotation, retries, and consistent errors without re-implementing request plumbing.

## Installation

The SDK supports any modern Node.js runtime (v18+) and works with npm, yarn, or pnpm. Install it as a regular dependency so it is available anywhere you need to talk to HighLevel.

```bash
npm install @gohighlevel/api-client
```

```bash
yarn add @gohighlevel/api-client
```

```bash
pnpm add @gohighlevel/api-client
```

## Quick Start

### Initialize the client

Set your OAuth credentials (or PIT) through environment variables so that local development and deployments share the same configuration.

```javascript
const { HighLevel } = require('@gohighlevel/api-client');

const highLevel = new HighLevel({
  clientId: process.env.HIGHLEVEL_CLIENT_ID,
  clientSecret: process.env.HIGHLEVEL_CLIENT_SECRET,
});
```

```typescript
import { HighLevel } from '@gohighlevel/api-client';

const highLevel = new HighLevel({
  clientId: process.env.HIGHLEVEL_CLIENT_ID ?? '',
  clientSecret: process.env.HIGHLEVEL_CLIENT_SECRET ?? '',
});
```

### Make your first API call

Every service under `highLevel` mirrors the REST resources (contacts, opportunities, workflows, etc.). Provide the required `locationId` or `companyId` so the SDK can manage tokens for you.

```javascript
async function listContacts() {
  try {
    const response = await highLevel.contacts.searchContactsAdvanced({
      locationId: 'zBG0T99IsBgOoXUrcROH',
      pageLimit: 5,
    });

    console.log(response);
  } catch (error) {
    console.error('HighLevel error:', error);
  }
}

listContacts();
```

## Token storage and refresh

By default, tokens live in memory. In production, inject your own storage adapter (Redis, MongoDB, SQL, etc.) so tokens survive restarts:

```javascript
import { HighLevel, MongoDBSessionStorage } from '@gohighlevel/api-client';

const highLevel = new HighLevel({
  clientId: process.env.HIGHLEVEL_CLIENT_ID,
  clientSecret: process.env.HIGHLEVEL_CLIENT_SECRET,
  sessionStorage: new MongoDBSessionStorage({
    dbUrl: 'mongodb://localhost:27017',
    dbName: 'ghl_sessions'
  })
});
```

The SDK will refresh expired access tokens on-demand and update your storage without extra work.

## Webhook middleware

Use `highLevel.webhooks.subscribe()` to get an Express-compatible middleware that validates signatures, handles INSTALL/UNINSTALL events, and keeps session storage synchronized before your custom logic runs.

```javascript
app.use('/api/webhooks/ghl', highLevel.webhooks.subscribe());
app.post('/api/webhooks/ghl', (req, res) => {
  // Your business logic can rely on the tokens being current.
  res.json({ ok: true });
});
```

**Note**: If you use webhook middleware provided by SDK, in case of bulk installation it will generate and store the token for each location when it receives INSTALL event from highlevel.

## Additional resources

You can find some SDK & additional examples here:

[SDK](https://github.com/GoHighLevel/highlevel-api-sdk)

[npm](https://www.npmjs.com/package/@gohighlevel/api-client)

[Examples](https://github.com/GoHighLevel/ghl-sdk-examples/tree/main/node)

---

# HighLevel PHP SDK

Source: https://marketplace.gohighlevel.com/docs/sdk/php

The `gohighlevel/api-client` composer package is the officially supported SDK for PHP 7.4+ projects. It wraps the full HighLevel API with PSR-18 friendly services, automatic OAuth token rotation, webhook helpers, and pluggable session storage.

## Installation

```bash
composer require gohighlevel/api-client
```

## Quick Start

### Initialize with a Private Integration Token

```php
<?php

require_once __DIR__ . '/vendor/autoload.php';

use HighLevel\HighLevel;
use HighLevel\HighLevelConfig;

$config = new HighLevelConfig([
    'privateIntegrationToken' => $_ENV['GHL_PIT'],
]);

$ghl = new HighLevel($config);
```

### Initialize with OAuth credentials

```php
use HighLevel\HighLevel;
use HighLevel\HighLevelConfig;

$config = new HighLevelConfig([
    'clientId' => $_ENV['GHL_CLIENT_ID'],
    'clientSecret' => $_ENV['GHL_CLIENT_SECRET'],
]);

$ghl = new HighLevel($config);
```

### Make your first API call

```php
use HighLevel\Services\Contacts\Models\SearchBodyV2DTO;

$body = new SearchBodyV2DTO([
    'locationId' => 'zBG0T99IsBgOoXUrcROH',
    'pageLimit' => 1,
]);

$contactsResponse = $ghl->contacts->searchContactsAdvanced($body);

error_log(json_encode($contactsResponse, JSON_PRETTY_PRINT));
```

## Session storage

Use `HighLevel\Storage\MongoDBSessionStorage` provided by SDK to use mongo as storage or extend it to store tokens in MySQL, PostgreSQL, Redis, etc:

```php
<?php
use HighLevel\HighLevel;
use HighLevel\Storage\MongoDBSessionStorage;

$sessionStorage = new MongoDBSessionStorage(
    $config['mongo_url'],
    $config['mongo_db_name'],
    $config['collection_name']
);

$ghl = new HighLevel([
    'clientId' => $config['client_id'],
    'clientSecret' => $config['client_secret'],
    'sessionStorage' => $sessionStorage,
    'logLevel' => 'warn'
]);
```

## Webhook support

SDK provides webhook support which can be used as shown below. It will handle INSTALL and UNINSTALL events sent by HighLevel. It will generate token and store it in the db.

```php
$payload = $request->getBody()->getContents();
$signature = $request->getHeaderLine('x-wh-signature');

$ghl->getWebhookManager()->processWebhook(
    $payload, // pass raw request body as string here
    $signature,
    $_ENV['WEBHOOK_PUBLIC_KEY'],
    $_ENV['GHL_CLIENT_ID']
);
```

Call `verifySignature` directly when you just need validation:

```php
$ghl->getWebhookManager()->verifySignature(
    $payload,
    $signature,
    $_ENV['WEBHOOK_PUBLIC_KEY']
);
```

## Additional resources

You can find some SDK & additional examples here:

[SDK](https://github.com/GoHighLevel/highlevel-api-php)

[packagist](https://packagist.org/packages/gohighlevel/api-client)

[Examples](https://github.com/GoHighLevel/ghl-sdk-examples/tree/main/php)

---

# HighLevel Python SDK

Source: https://marketplace.gohighlevel.com/docs/sdk/python

The official `gohighlevel-api-client` package publishes a async client that speaks to every HighLevel endpoint with the same token automation, webhook helpers, and storage adapters you get on other platforms. Requires Python 3.8+.

## Installation

```bash
pip install gohighlevel-api-client
```

```bash
pipenv install gohighlevel-api-client
```

```bash
poetry add gohighlevel-api-client
```

## Quick Start

### Initialize the client

```python
from highlevel import HighLevel
client = HighLevel(
    client_id="your_client_id",
    client_secret="your_client_secret",
)
```

### Make an API call

The SDK is async-first; wrap your logic in `asyncio.run()` when you are not already inside an async framework.

```python
import asyncio
from highlevel import HighLevel

async def main():
  client = HighLevel(
    client_id="your_client_id",
    client_secret="your_client_secret",
  )

  response = await client.contacts.search_contacts_advanced({
    "locationId": "zBG0T99IsBgOoXUrcROH",
    "pageLimit": 5,
  })

  print(response)

asyncio.run(main())
```

## Session storage

Use in-memory storage for local testing or swap in MongoDB/Redis/etc. for production resiliency.

```python
from highlevel.storage import MongoDBSessionStorage

storage = MongoDBSessionStorage(
  connection_string="mongodb://localhost:27017",
  database_name="ghl_sessions",
  collection_name="jwt_tokens",
)

client = HighLevel(
  client_id="your_client_id",
  client_secret="your_client_secret",
  session_storage=storage,
)
```

## Webhook integration

Hook up the middleware returned by `client.webhooks.subscribe()` to validate signatures, respond to INSTALL/UNINSTALL automatically, and keep session storage synchronized.

```python
client = HighLevel(
  client_id="your_client_id",
  client_secret="your_client_secret"
)

webhook_middleware = client.webhooks.subscribe()

@app.post("/api/webhooks/ghl")
async def handle_ghl_webhook(request):
  await webhook_middleware(request)
  # you custom logic for webhook goes here
  return {"status": "success"}
```

## Additional resources

You can find some SDK & additional examples here:

[SDK](https://github.com/GoHighLevel/highlevel-api-python)

[pypi](https://pypi.org/project/gohighlevel-api-client/)

[Examples](https://github.com/GoHighLevel/ghl-sdk-examples/tree/main/python)
