Skip to main content

Crate ghl_models

Crate ghl_models 

Source
Expand description

§ghl-models

Rust data models (DTOs) for the GoHighLevel API, generated from HighLevel’s official OpenAPI specifications.

Both API versions are covered: v2 (the current stable API, Version: 2021-07-28) and v3 (Version: v3). Every API module is behind a cargo feature so you compile only the models you use — enabling everything means thousands of structs.

[dependencies]
ghl-models = { version = "0.1", features = ["contacts", "invoices"] }

§How these types are generated

  • Fields the spec marks required are non-Option; the rest are Option<T> that skip serialization when None, so partial updates work.
  • Arrays are Vec<T> with #[serde(default)] — an absent list reads as empty.
  • String enums are String with the allowed values in the doc comment. GoHighLevel introduces new values without notice, and a closed Rust enum would turn that into a deserialization failure.
  • Anonymous nested objects and multi-branch compositions are serde_json::Value.
  • Unknown fields in responses are ignored, never rejected, so upstream additions can’t break your build.

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.