Skip to main content

ghl_models/v3/
agent_studio.rs

1//! `agent-studio` data models for GoHighLevel API V3 (14 types).
2//!
3//! Generated from HighLevel's official OpenAPI spec for the
4//! **Agent Studio** module. Every endpoint that uses these types, with its
5//! parameters, required scopes and enum values, is documented in the
6//! [`agent-studio` API reference](https://github.com/Shahroz/ghl-rs/blob/main/docs/api/agent-studio.md).
7//!
8//! Enable with `features = ["agent-studio"]`.
9// @generated by xtask/generate_models.py — do not edit by hand.
10// Source: https://github.com/GoHighLevel/highlevel-api-docs
11// Doc comments are HighLevel's own field descriptions, reflowed verbatim, so
12// they aren't held to rustdoc's markdown conventions.
13#![allow(
14    missing_docs,
15    clippy::doc_lazy_continuation,
16    clippy::doc_overindented_list_items
17)]
18
19use serde::{Deserialize, Serialize};
20
21/// `CreatePublicAgentDTO` from the GoHighLevel OpenAPI spec.
22#[derive(Debug, Clone, Default, Serialize, Deserialize)]
23pub struct CreatePublicAgentDTO {
24    /// Location ID
25    /// Required by the API.
26    #[serde(rename = "locationId")]
27    pub location_id: String,
28    /// Name of the agent
29    #[serde(default, skip_serializing_if = "Option::is_none")]
30    pub name: Option<String>,
31    /// Description of the agent
32    #[serde(default, skip_serializing_if = "Option::is_none")]
33    pub description: Option<String>,
34    /// Agency ID
35    #[serde(rename = "agencyId", default, skip_serializing_if = "Option::is_none")]
36    pub agency_id: Option<String>,
37    /// Author ID
38    #[serde(rename = "authorId", default, skip_serializing_if = "Option::is_none")]
39    pub author_id: Option<String>,
40    /// Author name
41    #[serde(
42        rename = "authorName",
43        default,
44        skip_serializing_if = "Option::is_none"
45    )]
46    pub author_name: Option<String>,
47    /// Author email
48    #[serde(
49        rename = "authorEmail",
50        default,
51        skip_serializing_if = "Option::is_none"
52    )]
53    pub author_email: Option<String>,
54    /// Status of the agent
55    /// Allowed values: `active`, `inactive`, `archived`.
56    /// Required by the API.
57    pub status: String,
58    /// Version data for the agent including nodes, edges, and configuration
59    /// Required by the API.
60    pub version: serde_json::Value,
61    /// Nodes array (deprecated, prefer using version.nodes)
62    #[serde(default, skip_serializing_if = "Vec::is_empty")]
63    pub nodes: Vec<String>,
64    /// Edges array (deprecated, prefer using version.edges)
65    #[serde(default, skip_serializing_if = "Vec::is_empty")]
66    pub edges: Vec<String>,
67}
68
69/// `CreatePublicAgentResponseDTO` from the GoHighLevel OpenAPI spec.
70#[derive(Debug, Clone, Default, Serialize, Deserialize)]
71pub struct CreatePublicAgentResponseDTO {
72    /// Success status
73    /// Required by the API.
74    /// (Optional here so responses that omit it still parse.)
75    #[serde(default, skip_serializing_if = "Option::is_none")]
76    pub success: Option<bool>,
77    /// Response message
78    /// Required by the API.
79    /// (Optional here so responses that omit it still parse.)
80    #[serde(default, skip_serializing_if = "Option::is_none")]
81    pub message: Option<String>,
82    /// Created agent data with metadata
83    /// Required by the API.
84    /// (Optional here so responses that omit it still parse.)
85    #[serde(default, skip_serializing_if = "Option::is_none")]
86    pub agent: Option<serde_json::Value>,
87    /// Created versions array (initial staging version)
88    /// Required by the API.
89    /// (Optional here so responses that omit it still parse.)
90    #[serde(default, skip_serializing_if = "Vec::is_empty")]
91    pub versions: Vec<serde_json::Value>,
92}
93
94/// `DeletePublicAgentResponseDTO` from the GoHighLevel OpenAPI spec.
95#[derive(Debug, Clone, Default, Serialize, Deserialize)]
96pub struct DeletePublicAgentResponseDTO {
97    /// Success status
98    /// Required by the API.
99    /// (Optional here so responses that omit it still parse.)
100    #[serde(default, skip_serializing_if = "Option::is_none")]
101    pub success: Option<bool>,
102    /// Response message
103    /// Required by the API.
104    /// (Optional here so responses that omit it still parse.)
105    #[serde(default, skip_serializing_if = "Option::is_none")]
106    pub message: Option<String>,
107    /// Deleted agent ID
108    #[serde(rename = "agentId", default, skip_serializing_if = "Option::is_none")]
109    pub agent_id: Option<String>,
110}
111
112/// `ExecutePublicAgentDTO` from the GoHighLevel OpenAPI spec.
113#[derive(Debug, Clone, Default, Serialize, Deserialize)]
114pub struct ExecutePublicAgentDTO {
115    /// Message to send to the agent
116    /// Required by the API.
117    pub message: String,
118    /// Unique session identifier that maintains conversational context across multiple
119    /// interactions within the same agent session. Omit this field for the first message in a
120    /// new session. Include the executionId returned from the previous response to maintain
121    /// context in subsequent messages.
122    #[serde(
123        rename = "executionId",
124        default,
125        skip_serializing_if = "Option::is_none"
126    )]
127    pub execution_id: Option<String>,
128    /// Input variables to pass to the agent. These should match the input variables defined in
129    /// the agent configuration.
130    #[serde(
131        rename = "inputVariables",
132        default,
133        skip_serializing_if = "Option::is_none"
134    )]
135    pub input_variables: Option<serde_json::Value>,
136    /// Published version ID to execute. If not provided, the latest published production
137    /// version will be used.
138    #[serde(rename = "versionId", default, skip_serializing_if = "Option::is_none")]
139    pub version_id: Option<String>,
140    /// Attachments for the message
141    #[serde(default, skip_serializing_if = "Vec::is_empty")]
142    pub attachments: Vec<PublicAttachmentSchema>,
143    /// Location ID
144    /// Required by the API.
145    #[serde(rename = "locationId")]
146    pub location_id: String,
147    /// Contact ID to associate with this execution. When provided, contact data will be
148    /// hydrated and made available to the agent.
149    #[serde(rename = "contactId", default, skip_serializing_if = "Option::is_none")]
150    pub contact_id: Option<String>,
151}
152
153/// `ExecutePublicAgentResponseDTO` from the GoHighLevel OpenAPI spec.
154#[derive(Debug, Clone, Default, Serialize, Deserialize)]
155pub struct ExecutePublicAgentResponseDTO {
156    /// Success status
157    /// Required by the API.
158    /// (Optional here so responses that omit it still parse.)
159    #[serde(default, skip_serializing_if = "Option::is_none")]
160    pub success: Option<bool>,
161    /// Unique session identifier that maintains conversational context across multiple
162    /// interactions within the same agent session. Use this ID in subsequent requests to
163    /// continue the conversation.
164    /// Required by the API.
165    /// (Optional here so responses that omit it still parse.)
166    #[serde(
167        rename = "executionId",
168        default,
169        skip_serializing_if = "Option::is_none"
170    )]
171    pub execution_id: Option<String>,
172    /// Unique identifier for a single interaction cycle, consisting of one user input and the
173    /// corresponding agent response. Each message exchange generates a new interactionId.
174    /// Required by the API.
175    /// (Optional here so responses that omit it still parse.)
176    #[serde(
177        rename = "interactionId",
178        default,
179        skip_serializing_if = "Option::is_none"
180    )]
181    pub interaction_id: Option<String>,
182    /// Agent response text
183    /// Required by the API.
184    /// (Optional here so responses that omit it still parse.)
185    #[serde(default, skip_serializing_if = "Option::is_none")]
186    pub response: Option<String>,
187    /// Response type
188    /// Required by the API.
189    /// (Optional here so responses that omit it still parse.)
190    #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
191    pub type_: Option<String>,
192    /// Expected input type for next interaction
193    /// Required by the API.
194    /// (Optional here so responses that omit it still parse.)
195    #[serde(
196        rename = "nextExpectedInput",
197        default,
198        skip_serializing_if = "Option::is_none"
199    )]
200    pub next_expected_input: Option<String>,
201    /// When end node is added in the graph, this will be true if the agent reached the end node
202    /// in the graph
203    /// Required by the API.
204    /// (Optional here so responses that omit it still parse.)
205    #[serde(
206        rename = "goalCompletion",
207        default,
208        skip_serializing_if = "Option::is_none"
209    )]
210    pub goal_completion: Option<bool>,
211    /// Execution status
212    /// Required by the API.
213    /// (Optional here so responses that omit it still parse.)
214    #[serde(
215        rename = "executionStatus",
216        default,
217        skip_serializing_if = "Option::is_none"
218    )]
219    pub execution_status: Option<String>,
220    /// Whether flow was switched
221    /// Required by the API.
222    /// (Optional here so responses that omit it still parse.)
223    #[serde(
224        rename = "flowSwitch",
225        default,
226        skip_serializing_if = "Option::is_none"
227    )]
228    pub flow_switch: Option<bool>,
229    /// Response attachments
230    /// Required by the API.
231    /// (Optional here so responses that omit it still parse.)
232    #[serde(default, skip_serializing_if = "Vec::is_empty")]
233    pub attachments: Vec<serde_json::Value>,
234    /// Generated outputs
235    /// Required by the API.
236    /// (Optional here so responses that omit it still parse.)
237    #[serde(
238        rename = "generativeOutputs",
239        default,
240        skip_serializing_if = "Vec::is_empty"
241    )]
242    pub generative_outputs: Vec<serde_json::Value>,
243}
244
245/// `GetAgentByIdResponseDTO` from the GoHighLevel OpenAPI spec.
246#[derive(Debug, Clone, Default, Serialize, Deserialize)]
247pub struct GetAgentByIdResponseDTO {
248    /// Success status
249    /// Required by the API.
250    /// (Optional here so responses that omit it still parse.)
251    #[serde(default, skip_serializing_if = "Option::is_none")]
252    pub success: Option<bool>,
253    /// Response message
254    /// Required by the API.
255    /// (Optional here so responses that omit it still parse.)
256    #[serde(default, skip_serializing_if = "Option::is_none")]
257    pub message: Option<String>,
258    /// Agent metadata with all active versions
259    /// Required by the API.
260    /// (Optional here so responses that omit it still parse.)
261    #[serde(default, skip_serializing_if = "Option::is_none")]
262    pub agent: Option<serde_json::Value>,
263    /// Request trace ID for debugging
264    #[serde(rename = "traceId", default, skip_serializing_if = "Option::is_none")]
265    pub trace_id: Option<String>,
266}
267
268/// `GetPublishedAgentsResponseDTO` from the GoHighLevel OpenAPI spec.
269#[derive(Debug, Clone, Default, Serialize, Deserialize)]
270pub struct GetPublishedAgentsResponseDTO {
271    /// Success status
272    /// Required by the API.
273    /// (Optional here so responses that omit it still parse.)
274    #[serde(default, skip_serializing_if = "Option::is_none")]
275    pub success: Option<bool>,
276    /// Response message
277    /// Required by the API.
278    /// (Optional here so responses that omit it still parse.)
279    #[serde(default, skip_serializing_if = "Option::is_none")]
280    pub message: Option<String>,
281    /// List of agents with metadata
282    /// Nested object; raw JSON (see the API docs for its fields).
283    /// Required by the API.
284    /// (Optional here so responses that omit it still parse.)
285    #[serde(default, skip_serializing_if = "Vec::is_empty")]
286    pub agents: Vec<serde_json::Value>,
287    /// Pagination metadata
288    /// Nested object; raw JSON (see the API docs for its fields).
289    /// Required by the API.
290    /// (Optional here so responses that omit it still parse.)
291    #[serde(default, skip_serializing_if = "Option::is_none")]
292    pub pagination: Option<serde_json::Value>,
293}
294
295/// `InternalServerErrorDTO` from the GoHighLevel OpenAPI spec.
296#[derive(Debug, Clone, Default, Serialize, Deserialize)]
297pub struct InternalServerErrorDTO {
298    #[serde(
299        rename = "statusCode",
300        default,
301        skip_serializing_if = "Option::is_none"
302    )]
303    pub status_code: Option<f64>,
304    #[serde(default, skip_serializing_if = "Option::is_none")]
305    pub message: Option<String>,
306}
307
308/// `PromoteAndPublishDTO` from the GoHighLevel OpenAPI spec.
309#[derive(Debug, Clone, Default, Serialize, Deserialize)]
310pub struct PromoteAndPublishDTO {
311    /// Location ID for authorization
312    /// Required by the API.
313    #[serde(rename = "locationId")]
314    pub location_id: String,
315    /// User ID performing the promotion action
316    #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")]
317    pub user_id: Option<String>,
318    /// User name performing the promotion action
319    #[serde(rename = "userName", default, skip_serializing_if = "Option::is_none")]
320    pub user_name: Option<String>,
321    /// User email performing the promotion action
322    #[serde(rename = "userEmail", default, skip_serializing_if = "Option::is_none")]
323    pub user_email: Option<String>,
324}
325
326/// `PromoteAndPublishResponseDTO` from the GoHighLevel OpenAPI spec.
327#[derive(Debug, Clone, Default, Serialize, Deserialize)]
328pub struct PromoteAndPublishResponseDTO {
329    /// Success status
330    /// Required by the API.
331    /// (Optional here so responses that omit it still parse.)
332    #[serde(default, skip_serializing_if = "Option::is_none")]
333    pub success: Option<bool>,
334    /// Response message
335    /// Required by the API.
336    /// (Optional here so responses that omit it still parse.)
337    #[serde(default, skip_serializing_if = "Option::is_none")]
338    pub message: Option<String>,
339    /// Result data with production and new draft version details
340    /// Required by the API.
341    /// (Optional here so responses that omit it still parse.)
342    #[serde(default, skip_serializing_if = "Option::is_none")]
343    pub data: Option<serde_json::Value>,
344}
345
346/// `PublicAttachmentSchema` from the GoHighLevel OpenAPI spec.
347#[derive(Debug, Clone, Default, Serialize, Deserialize)]
348pub struct PublicAttachmentSchema {
349    /// Type of attachment
350    /// Required by the API.
351    #[serde(rename = "type")]
352    pub type_: String,
353    /// URL of the image attachment
354    /// Required by the API.
355    #[serde(rename = "imageUrl")]
356    pub image_url: String,
357}
358
359/// `UpdatePublicAgentMetadataDTO` from the GoHighLevel OpenAPI spec.
360#[derive(Debug, Clone, Default, Serialize, Deserialize)]
361pub struct UpdatePublicAgentMetadataDTO {
362    /// Location ID for authorization (cannot be updated)
363    /// Required by the API.
364    #[serde(rename = "locationId")]
365    pub location_id: String,
366    /// Name of the agent
367    #[serde(default, skip_serializing_if = "Option::is_none")]
368    pub name: Option<String>,
369    /// Description of the agent
370    #[serde(default, skip_serializing_if = "Option::is_none")]
371    pub description: Option<String>,
372    /// Status of the agent
373    /// Allowed values: `active`, `inactive`, `archived`.
374    #[serde(default, skip_serializing_if = "Option::is_none")]
375    pub status: Option<String>,
376}
377
378/// `UpdatePublicAgentResponseDTO` from the GoHighLevel OpenAPI spec.
379#[derive(Debug, Clone, Default, Serialize, Deserialize)]
380pub struct UpdatePublicAgentResponseDTO {
381    /// Success status
382    /// Required by the API.
383    /// (Optional here so responses that omit it still parse.)
384    #[serde(default, skip_serializing_if = "Option::is_none")]
385    pub success: Option<bool>,
386    /// Response message
387    /// Required by the API.
388    /// (Optional here so responses that omit it still parse.)
389    #[serde(default, skip_serializing_if = "Option::is_none")]
390    pub message: Option<String>,
391    /// Updated agent or version data
392    /// Required by the API.
393    /// (Optional here so responses that omit it still parse.)
394    #[serde(default, skip_serializing_if = "Option::is_none")]
395    pub data: Option<serde_json::Value>,
396}
397
398/// `UpdatePublicAgentVersionDTO` from the GoHighLevel OpenAPI spec.
399#[derive(Debug, Clone, Default, Serialize, Deserialize)]
400pub struct UpdatePublicAgentVersionDTO {
401    /// Location ID for authorization
402    /// Required by the API.
403    #[serde(rename = "locationId")]
404    pub location_id: String,
405    /// Version name
406    #[serde(
407        rename = "versionName",
408        default,
409        skip_serializing_if = "Option::is_none"
410    )]
411    pub version_name: Option<String>,
412    /// Description of the version
413    #[serde(default, skip_serializing_if = "Option::is_none")]
414    pub description: Option<String>,
415    /// Complete array of nodes for the agent workflow. Provide all nodes including unchanged
416    /// ones.
417    #[serde(default, skip_serializing_if = "Vec::is_empty")]
418    pub nodes: Vec<serde_json::Value>,
419    /// Complete array of edges connecting the nodes. Provide all edges including unchanged
420    /// ones.
421    #[serde(default, skip_serializing_if = "Vec::is_empty")]
422    pub edges: Vec<serde_json::Value>,
423    /// Global variables accessible throughout the agent workflow
424    #[serde(
425        rename = "globalVariables",
426        default,
427        skip_serializing_if = "Vec::is_empty"
428    )]
429    pub global_variables: Vec<serde_json::Value>,
430    /// Input variables required from user at execution time
431    #[serde(
432        rename = "inputVariables",
433        default,
434        skip_serializing_if = "Vec::is_empty"
435    )]
436    pub input_variables: Vec<serde_json::Value>,
437    /// Runtime variables generated during agent execution
438    #[serde(
439        rename = "runtimeVariables",
440        default,
441        skip_serializing_if = "Vec::is_empty"
442    )]
443    pub runtime_variables: Vec<serde_json::Value>,
444    /// Global configuration including prompts and settings
445    #[serde(
446        rename = "globalConfig",
447        default,
448        skip_serializing_if = "Option::is_none"
449    )]
450    pub global_config: Option<serde_json::Value>,
451    /// User ID performing the update
452    #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")]
453    pub user_id: Option<String>,
454    /// User name performing the update
455    #[serde(rename = "userName", default, skip_serializing_if = "Option::is_none")]
456    pub user_name: Option<String>,
457}