Skip to main content

ghl_models/v2/
agent_studio.rs

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