ghl-models
Rust data models (DTOs) for the GoHighLevel (HighLevel) API, generated from HighLevel's official OpenAPI specifications.
2,417 types across 45 API modules and both API versions — 1,074 structs for v2, 1,329 for v3, plus 14 documented string-enum aliases. Everything from contacts and invoices to ad-publishing, social-planner, voice-ai and saas.
Usage
Every module is behind a cargo feature, because enabling everything means thousands of structs. Pick what you need:
[]
= { = "0.5", = ["invoices", "payments"] }
use ;
let invoice = CreateInvoiceDto ;
Feature-gating matters: one module compiles in ~1.3s, all 45 take ~30s.
Use features = ["full"] to get everything (mostly useful for exploring in docs.rs).
API versions
| Modules | Operations | Structs | |
|---|---|---|---|
v2 — current stable (Version: 2021-07-28) |
41 | 576 | 1,074 |
v3 — newer (Version: v3) |
42 | 627 | 1,329 |
V3 renames three modules (ad-manager→ad-publishing, social-media-posting→social-planner, saas-api→saas), adds chat-widget, and switches some paths from camelCase to kebab-case (/campaigns/removeAll → /campaigns/remove-all). Both live side by side: ghl_models::v2::* and ghl_models::v3::*.
How these types are generated
- Fields the spec marks
requiredare non-Option; the rest areOption<T>that skip serialization whenNone, so partial updates work naturally. - Arrays are
Vec<T>with#[serde(default)]— an absent list reads as empty. - String enums are
String, with allowed values in the doc comment. GoHighLevel adds enum values without notice, and a closed Rust enum would turn that into a deserialization failure. - Anonymous nested objects and multi-branch compositions (
oneOf/anyOf) becomeserde_json::Value; a single-$refallOfwrapper resolves to the referenced type. - Unknown response fields are ignored, never rejected, so upstream additions can't break your build.
Regenerate after HighLevel updates its specs:
Full reference
Every model, field, and enum value is documented per module in the API reference, and field-by-field on docs.rs. Large repeated value lists (country codes, timezones) live in shared enums.
Related crates
ghl-sdk— the async API client. Its per-module features give you generated typed methods for every v2 endpoint, wired to these DTOs, so you rarely construct requests by hand.ghl-mcp— MCP server exposing GoHighLevel to AI agents.
Changes per release: CHANGELOG.
License: MIT or Apache-2.0. Not affiliated with HighLevel Inc.