Skip to main content

Crate ghl_models

Crate ghl_models 

Source
Expand description

Rust data models (DTOs) for the GoHighLevel (HighLevel) CRM API — 2417 types generated from HighLevel’s official OpenAPI specifications.

Both API versions are covered side by side: v2 (1081 types, the current stable API, Version: 2021-07-28) and v3 (1336 types, Version: v3).

[dependencies]
ghl-models = { version = "0.3", features = ["invoices", "payments"] }
use ghl_models::v2::invoices::{CreateInvoiceDto, InvoiceItemDto};

let invoice = CreateInvoiceDto {
    alt_id: location_id,
    alt_type: "location".into(),   // the only legal value
    name: "August retainer".into(),
    currency: "USD".into(),
    ..Default::default()
};

§Every module is a cargo feature

Nothing is enabled by default, because compiling everything means thousands of structs: one module builds in ~1.3s, all 45 take ~30s. Use features = ["full"] only for exploration.

FeatureAPI v2 module (structs)API v3 module (structs)
ad-managerv2::ad_manager (107)
ad-publishingv3::ad_publishing (108)
affiliate-managerv2::affiliate_manager (13)v3::affiliate_manager (13)
agent-studiov2::agent_studio (14)v3::agent_studio (14)
associationsv2::associations (5)v3::associations (5)
blogsv2::blogs (13)v3::blogs (13)
brand-boardsv2::brand_boards (11)v3::brand_boards (24)
businessesv2::businesses (8)v3::businesses (8)
calendarsv2::calendars (62)v3::calendars (94)
campaignsv2::campaigns (2)v3::campaigns (2)
chat-widgetv3::chat_widget (15)
companiesv2::companies (3)v3::companies (3)
contactsv2::contacts (61)v3::contacts (60)
conversation-aiv2::conversation_ai (28)v3::conversation_ai (28)
conversationsv2::conversations (44)v3::conversations (44)
coursesv2::courses (10)v3::courses (10)
custom-fieldsv2::custom_fields (10)v3::custom_fields (10)
custom-menusv2::custom_menus (9)v3::custom_menus (9)
email-isvv2::email_isv (4)v3::email_isv (4)
emailsv2::emails (12)v3::emails (67)
formsv2::forms (9)v3::forms (9)
funnelsv2::funnels (10)v3::funnels (10)
invoicesv2::invoices (104)v3::invoices (104)
knowledge-basev2::knowledge_base (38)v3::knowledge_base (38)
linksv2::links (6)v3::links (6)
locationsv2::locations (47)v3::locations (53)
marketplacev2::marketplace (13)v3::marketplace (13)
mediasv2::medias (10)v3::medias (10)
oauthv2::oauth (6)v3::oauth (12)
objectsv2::objects (20)v3::objects (20)
opportunitiesv2::opportunities (25)v3::opportunities (26)
paymentsv2::payments (55)v3::payments (55)
phone-systemv2::phone_system (6)v3::phone_system (8)
productsv2::products (64)v3::products (64)
proposalsv2::proposals (21)v3::proposals (21)
saasv3::saas (25)
saas-apiv2::saas_api (20)
snapshotsv2::snapshots (8)v3::snapshots (8)
social-media-postingv2::social_media_posting (107)
social-plannerv3::social_planner (228)
storev2::store (40)v3::store (40)
surveysv2::surveys (9)v3::surveys (9)
usersv2::users (10)v3::users (9)
voice-aiv2::voice_ai (35)v3::voice_ai (35)
workflowsv2::workflows (2)v3::workflows (2)

v3 renames three modules and adds one: ad-managerad-publishing, social-media-postingsocial-planner, saas-apisaas, plus a new chat-widget.

§Generation conventions

ConventionWhy
Fields the spec marks required are non-OptionMatches the spec; you can’t forget a mandatory field
Everything else is Option<T> with skip_serializing_ifPartial updates serialize to only what you set
Arrays are Vec<T> with #[serde(default)]An absent list reads as empty rather than erroring
String enums stay String — allowed values are in each field’s doc commentGoHighLevel adds enum values without notice; a closed Rust enum would turn that into a deserialization failure
Anonymous nested objects and multi-branch compositions are serde_json::ValueThe spec doesn’t name them
A single-$ref allOf wrapper resolves to the referenced typeThose are description wrappers, not real composition
Unknown response fields are ignored, never rejectedUpstream additions can’t break your build
  • ghl-sdk — the async API client (auth, retries, rate limits, pagination). Re-exports this crate under its models feature.
  • ghl-mcp — MCP server exposing GoHighLevel to AI agents.

§Further reading

Regenerate with xtask/generate_models.py after HighLevel updates its specs.

Not affiliated with HighLevel Inc.

Modules§

v2
Data models for GoHighLevel API V2.
v3
Data models for GoHighLevel API V3.