ghl-models
Rust data models (DTOs) for the GoHighLevel (HighLevel) API, generated from HighLevel's official OpenAPI specifications.
2,417 structs covering both API versions — v2 (2,417 total: 1,074 V2 + 1,329 V3 structs and 14 documented string-enum aliases) across 45 API modules, 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.3", = ["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:
Related crates
ghl-sdk— the async API client (auth, retries, rate limits, pagination). Re-exports these models under itsmodelsfeature.ghl-mcp— MCP server exposing GoHighLevel to AI agents.
License: MIT or Apache-2.0. Not affiliated with HighLevel Inc.