Skip to main content

ghl_models/v2/
voice_ai.rs

1//! `voice-ai` data models for GoHighLevel API V2 (35 types).
2//!
3//! Generated from HighLevel's official OpenAPI spec for the
4//! **Voice Ai** module. Every endpoint that uses these types, with its
5//! parameters, required scopes and enum values, is documented in the
6//! [`voice-ai` API reference](https://github.com/Shahroz/ghl-rs/blob/main/docs/api/voice-ai.md).
7//!
8//! Enable with `features = ["voice-ai"]`.
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/// `AgentActionResponseDTO` from the GoHighLevel OpenAPI spec.
22#[derive(Debug, Clone, Default, Serialize, Deserialize)]
23pub struct AgentActionResponseDTO {
24    /// Unique identifier for this action
25    /// Required by the API.
26    /// (Optional here so responses that omit it still parse.)
27    #[serde(default, skip_serializing_if = "Option::is_none")]
28    pub id: Option<String>,
29    /// Type of action
30    /// Allowed values: `CALL_TRANSFER`, `DATA_EXTRACTION`, `IN_CALL_DATA_EXTRACTION`,
31    /// `WORKFLOW_TRIGGER`, `SMS`, `APPOINTMENT_BOOKING`, `CUSTOM_ACTION`, `KNOWLEDGE_BASE`.
32    /// Required by the API.
33    /// (Optional here so responses that omit it still parse.)
34    #[serde(
35        rename = "actionType",
36        default,
37        skip_serializing_if = "Option::is_none"
38    )]
39    pub action_type: Option<String>,
40    /// Human-readable name for this action
41    /// Required by the API.
42    /// (Optional here so responses that omit it still parse.)
43    #[serde(default, skip_serializing_if = "Option::is_none")]
44    pub name: Option<String>,
45    /// Action parameters - structure varies by actionType
46    /// Multiple possible shapes in the spec; raw JSON.
47    /// Required by the API.
48    /// (Optional here so responses that omit it still parse.)
49    #[serde(
50        rename = "actionParameters",
51        default,
52        skip_serializing_if = "Option::is_none"
53    )]
54    pub action_parameters: Option<serde_json::Value>,
55}
56
57/// `AgentCreationRequestDTO` from the GoHighLevel OpenAPI spec.
58#[derive(Debug, Clone, Default, Serialize, Deserialize)]
59pub struct AgentCreationRequestDTO {
60    /// Unique identifier for the location where this agent will operate
61    /// Required by the API.
62    #[serde(rename = "locationId")]
63    pub location_id: String,
64    /// Display name for the voice AI agent, between 1-40 characters. Default: "My Agent {random
65    /// 3 digit number}"
66    #[serde(rename = "agentName", default, skip_serializing_if = "Option::is_none")]
67    pub agent_name: Option<String>,
68    /// Name of the business this agent represents. Default: Uses location name
69    #[serde(
70        rename = "businessName",
71        default,
72        skip_serializing_if = "Option::is_none"
73    )]
74    pub business_name: Option<String>,
75    /// Initial greeting spoken when the agent answers calls. Default: Auto generated
76    #[serde(
77        rename = "welcomeMessage",
78        default,
79        skip_serializing_if = "Option::is_none"
80    )]
81    pub welcome_message: Option<String>,
82    /// Custom instructions defining the agent's behavior and personality. Default: Basic prompt
83    /// generated automatically
84    #[serde(
85        rename = "agentPrompt",
86        default,
87        skip_serializing_if = "Option::is_none"
88    )]
89    pub agent_prompt: Option<String>,
90    /// Identifier for the speech synthesis voice from available voice options. Default: Auto
91    /// generated
92    #[serde(rename = "voiceId", default, skip_serializing_if = "Option::is_none")]
93    pub voice_id: Option<String>,
94    #[serde(default, skip_serializing_if = "Option::is_none")]
95    pub language: Option<VoiceAILanguage>,
96    #[serde(
97        rename = "patienceLevel",
98        default,
99        skip_serializing_if = "Option::is_none"
100    )]
101    pub patience_level: Option<PatienceLevel>,
102    /// Maximum call duration in seconds, between 180-900 (3-15 minutes). Default: 300 seconds
103    /// (5 minutes)
104    #[serde(
105        rename = "maxCallDuration",
106        default,
107        skip_serializing_if = "Option::is_none"
108    )]
109    pub max_call_duration: Option<f64>,
110    /// Enables automatic reminders when callers are silent. Default: true
111    #[serde(
112        rename = "sendUserIdleReminders",
113        default,
114        skip_serializing_if = "Option::is_none"
115    )]
116    pub send_user_idle_reminders: Option<bool>,
117    /// Seconds to wait before sending idle reminders, between 1-20. Default: 8 seconds
118    #[serde(
119        rename = "reminderAfterIdleTimeSeconds",
120        default,
121        skip_serializing_if = "Option::is_none"
122    )]
123    pub reminder_after_idle_time_seconds: Option<f64>,
124    /// Phone number for receiving inbound calls to this agent. Default: null
125    #[serde(
126        rename = "inboundNumber",
127        default,
128        skip_serializing_if = "Option::is_none"
129    )]
130    pub inbound_number: Option<String>,
131    /// Identifier for the number pool managing phone number allocation. Default: null
132    #[serde(
133        rename = "numberPoolId",
134        default,
135        skip_serializing_if = "Option::is_none"
136    )]
137    pub number_pool_id: Option<String>,
138    /// Array of workflow IDs to trigger automatically when calls end. Default: []
139    #[serde(
140        rename = "callEndWorkflowIds",
141        default,
142        skip_serializing_if = "Vec::is_empty"
143    )]
144    pub call_end_workflow_ids: Vec<String>,
145    /// Configuration for post-call email notifications to various recipients. Default: []
146    #[serde(
147        rename = "sendPostCallNotificationTo",
148        default,
149        skip_serializing_if = "Option::is_none"
150    )]
151    pub send_post_call_notification_to: Option<SendPostCallNotificationDTO>,
152    /// Time intervals defining when the agent accepts calls, organized by day of week. Default:
153    /// [] (available 24/7)
154    #[serde(
155        rename = "agentWorkingHours",
156        default,
157        skip_serializing_if = "Vec::is_empty"
158    )]
159    pub agent_working_hours: Vec<AgentWorkingHoursDTO>,
160    /// IANA timezone identifier affecting working hours and scheduling. Default: Location
161    /// timezone
162    #[serde(default, skip_serializing_if = "Option::is_none")]
163    pub timezone: Option<String>,
164    /// Prevents this agent from being used as a fallback option. Default: false (Available as
165    /// backup agent)
166    #[serde(
167        rename = "isAgentAsBackupDisabled",
168        default,
169        skip_serializing_if = "Option::is_none"
170    )]
171    pub is_agent_as_backup_disabled: Option<bool>,
172    /// Language translation settings including enablement flag and target language code. Rules:
173    /// (1) translation.enabled can only be true if the agent's language is not en-US; (2) when
174    /// enabled, translation.language must be either the agent's language or en-US; (3) when
175    /// enabled, translation.language is required.
176    #[serde(default, skip_serializing_if = "Option::is_none")]
177    pub translation: Option<TranslationDTO>,
178}
179
180/// `AgentWorkingHoursDTO` from the GoHighLevel OpenAPI spec.
181#[derive(Debug, Clone, Default, Serialize, Deserialize)]
182pub struct AgentWorkingHoursDTO {
183    /// Day of the week for this working hours configuration (Monday=1 to Sunday=7)
184    /// Allowed values: `1`, `2`, `3`, `4`, `5`, `6`, `7`.
185    /// Required by the API.
186    /// (Optional here so responses that omit it still parse.)
187    #[serde(
188        rename = "dayOfTheWeek",
189        default,
190        skip_serializing_if = "Option::is_none"
191    )]
192    pub day_of_the_week: Option<String>,
193    /// Array of time intervals when the agent is available on this day
194    /// Required by the API.
195    /// (Optional here so responses that omit it still parse.)
196    #[serde(default, skip_serializing_if = "Vec::is_empty")]
197    pub intervals: Vec<IntervalDTO>,
198}
199
200/// `AppointmentBookingActionParameters` from the GoHighLevel OpenAPI spec.
201#[derive(Debug, Clone, Default, Serialize, Deserialize)]
202pub struct AppointmentBookingActionParameters {
203    /// Calendar ID to book appointments in
204    /// Required by the API.
205    /// (Optional here so responses that omit it still parse.)
206    #[serde(
207        rename = "calendarId",
208        default,
209        skip_serializing_if = "Option::is_none"
210    )]
211    pub calendar_id: Option<String>,
212    /// Number of days ahead to offer booking dates
213    /// Required by the API.
214    /// (Optional here so responses that omit it still parse.)
215    #[serde(
216        rename = "daysOfOfferingDates",
217        default,
218        skip_serializing_if = "Option::is_none"
219    )]
220    pub days_of_offering_dates: Option<f64>,
221    /// Number of available slots per day
222    /// Required by the API.
223    /// (Optional here so responses that omit it still parse.)
224    #[serde(
225        rename = "slotsPerDay",
226        default,
227        skip_serializing_if = "Option::is_none"
228    )]
229    pub slots_per_day: Option<f64>,
230    /// Hours between available slots
231    /// Required by the API.
232    /// (Optional here so responses that omit it still parse.)
233    #[serde(
234        rename = "hoursBetweenSlots",
235        default,
236        skip_serializing_if = "Option::is_none"
237    )]
238    pub hours_between_slots: Option<f64>,
239}
240
241/// `CallActionSchema` from the GoHighLevel OpenAPI spec.
242#[derive(Debug, Clone, Default, Serialize, Deserialize)]
243pub struct CallActionSchema {
244    /// Action ID reference
245    #[serde(rename = "actionId", default, skip_serializing_if = "Option::is_none")]
246    pub action_id: Option<String>,
247    /// Action type
248    /// Allowed values: `CALL_TRANSFER`, `DATA_EXTRACTION`, `IN_CALL_DATA_EXTRACTION`,
249    /// `WORKFLOW_TRIGGER`, `SMS`, `APPOINTMENT_BOOKING`, `CUSTOM_ACTION`, `KNOWLEDGE_BASE`.
250    /// Required by the API.
251    /// (Optional here so responses that omit it still parse.)
252    #[serde(
253        rename = "actionType",
254        default,
255        skip_serializing_if = "Option::is_none"
256    )]
257    pub action_type: Option<String>,
258    /// Action name
259    /// Required by the API.
260    /// (Optional here so responses that omit it still parse.)
261    #[serde(
262        rename = "actionName",
263        default,
264        skip_serializing_if = "Option::is_none"
265    )]
266    pub action_name: Option<String>,
267    /// Action parameters - structure varies by actionType
268    /// Multiple possible shapes in the spec; raw JSON.
269    #[serde(
270        rename = "actionParameters",
271        default,
272        skip_serializing_if = "Option::is_none"
273    )]
274    pub action_parameters: Option<serde_json::Value>,
275    /// When the action was executed
276    /// Format: date-time (ISO-8601 string).
277    #[serde(
278        rename = "executedAt",
279        default,
280        skip_serializing_if = "Option::is_none"
281    )]
282    pub executed_at: Option<String>,
283    /// When the trigger was received
284    /// Format: date-time (ISO-8601 string).
285    #[serde(
286        rename = "triggerReceivedAt",
287        default,
288        skip_serializing_if = "Option::is_none"
289    )]
290    pub trigger_received_at: Option<String>,
291}
292
293/// `CallLogDTO` from the GoHighLevel OpenAPI spec.
294#[derive(Debug, Clone, Default, Serialize, Deserialize)]
295pub struct CallLogDTO {
296    /// Unique identifier for the call
297    /// Required by the API.
298    /// (Optional here so responses that omit it still parse.)
299    #[serde(default, skip_serializing_if = "Option::is_none")]
300    pub id: Option<String>,
301    /// Associated contact ID
302    #[serde(rename = "contactId", default, skip_serializing_if = "Option::is_none")]
303    pub contact_id: Option<String>,
304    /// Agent ID associated with the call
305    /// Required by the API.
306    /// (Optional here so responses that omit it still parse.)
307    #[serde(rename = "agentId", default, skip_serializing_if = "Option::is_none")]
308    pub agent_id: Option<String>,
309    /// Whether the agent is deleted
310    /// Required by the API.
311    /// (Optional here so responses that omit it still parse.)
312    #[serde(
313        rename = "isAgentDeleted",
314        default,
315        skip_serializing_if = "Option::is_none"
316    )]
317    pub is_agent_deleted: Option<bool>,
318    /// Caller phone number
319    #[serde(
320        rename = "fromNumber",
321        default,
322        skip_serializing_if = "Option::is_none"
323    )]
324    pub from_number: Option<String>,
325    /// Timestamp when the call was created
326    /// Format: date-time (ISO-8601 string).
327    /// Required by the API.
328    /// (Optional here so responses that omit it still parse.)
329    #[serde(rename = "createdAt", default, skip_serializing_if = "Option::is_none")]
330    pub created_at: Option<String>,
331    /// Call duration in seconds
332    /// Required by the API.
333    /// (Optional here so responses that omit it still parse.)
334    #[serde(default, skip_serializing_if = "Option::is_none")]
335    pub duration: Option<f64>,
336    /// Whether this call was a trial call
337    /// Required by the API.
338    /// (Optional here so responses that omit it still parse.)
339    #[serde(rename = "trialCall", default, skip_serializing_if = "Option::is_none")]
340    pub trial_call: Option<bool>,
341    /// Actions performed during the call. Note: The APPOINTMENT_BOOKING action will only be
342    /// visible in executedCallActions from Sep 9th 2025.
343    /// Required by the API.
344    /// (Optional here so responses that omit it still parse.)
345    #[serde(
346        rename = "executedCallActions",
347        default,
348        skip_serializing_if = "Vec::is_empty"
349    )]
350    pub executed_call_actions: Vec<CallActionSchema>,
351    /// Call summary
352    /// Required by the API.
353    /// (Optional here so responses that omit it still parse.)
354    #[serde(default, skip_serializing_if = "Option::is_none")]
355    pub summary: Option<String>,
356    /// Call transcript
357    /// Required by the API.
358    /// (Optional here so responses that omit it still parse.)
359    #[serde(default, skip_serializing_if = "Option::is_none")]
360    pub transcript: Option<String>,
361    /// Transcript translation details
362    #[serde(default, skip_serializing_if = "Option::is_none")]
363    pub translation: Option<TranslationSchema>,
364    /// Dynamic data extracted from the call based on agent configuration
365    #[serde(
366        rename = "extractedData",
367        default,
368        skip_serializing_if = "Option::is_none"
369    )]
370    pub extracted_data: Option<ExtractedDataSchema>,
371    /// Message identifier associated with the call
372    #[serde(rename = "messageId", default, skip_serializing_if = "Option::is_none")]
373    pub message_id: Option<String>,
374}
375
376/// `CallLogsResponseDTO` from the GoHighLevel OpenAPI spec.
377#[derive(Debug, Clone, Default, Serialize, Deserialize)]
378pub struct CallLogsResponseDTO {
379    /// Total number of items
380    /// Required by the API.
381    /// (Optional here so responses that omit it still parse.)
382    #[serde(default, skip_serializing_if = "Option::is_none")]
383    pub total: Option<f64>,
384    /// Page number starting from 1
385    /// Required by the API.
386    /// (Optional here so responses that omit it still parse.)
387    #[serde(default, skip_serializing_if = "Option::is_none")]
388    pub page: Option<f64>,
389    /// Number of items per page
390    /// Required by the API.
391    /// (Optional here so responses that omit it still parse.)
392    #[serde(rename = "pageSize", default, skip_serializing_if = "Option::is_none")]
393    pub page_size: Option<f64>,
394    /// Array of call logs
395    /// Required by the API.
396    /// (Optional here so responses that omit it still parse.)
397    #[serde(rename = "callLogs", default, skip_serializing_if = "Vec::is_empty")]
398    pub call_logs: Vec<CallLogDTO>,
399}
400
401/// `CallTransferActionParameters` from the GoHighLevel OpenAPI spec.
402#[derive(Debug, Clone, Default, Serialize, Deserialize)]
403pub struct CallTransferActionParameters {
404    /// When to trigger this action during the call
405    /// Required by the API.
406    /// (Optional here so responses that omit it still parse.)
407    #[serde(
408        rename = "triggerPrompt",
409        default,
410        skip_serializing_if = "Option::is_none"
411    )]
412    pub trigger_prompt: Option<String>,
413    /// Type of transfer destination (currently only "number" is supported)
414    /// Allowed values: `number`.
415    /// Required by the API.
416    /// (Optional here so responses that omit it still parse.)
417    #[serde(
418        rename = "transferToType",
419        default,
420        skip_serializing_if = "Option::is_none"
421    )]
422    pub transfer_to_type: Option<String>,
423    /// Phone number to transfer to. Must start with +, include country code, contain only
424    /// numbers, and be 11-16 characters long (e.g., +12345678901).
425    /// Required by the API.
426    /// (Optional here so responses that omit it still parse.)
427    #[serde(
428        rename = "transferToValue",
429        default,
430        skip_serializing_if = "Option::is_none"
431    )]
432    pub transfer_to_value: Option<String>,
433    /// Message to tell the caller before transferring
434    /// Required by the API.
435    /// (Optional here so responses that omit it still parse.)
436    #[serde(
437        rename = "triggerMessage",
438        default,
439        skip_serializing_if = "Option::is_none"
440    )]
441    pub trigger_message: Option<String>,
442    /// Whether to play whisper message to the receiving party
443    #[serde(
444        rename = "hearWhisperMessage",
445        default,
446        skip_serializing_if = "Option::is_none"
447    )]
448    pub hear_whisper_message: Option<bool>,
449}
450
451/// `CreateActionResponseDTO` from the GoHighLevel OpenAPI spec.
452#[derive(Debug, Clone, Default, Serialize, Deserialize)]
453pub struct CreateActionResponseDTO {
454    /// Unique identifier for the created action
455    /// Required by the API.
456    /// (Optional here so responses that omit it still parse.)
457    #[serde(default, skip_serializing_if = "Option::is_none")]
458    pub id: Option<String>,
459    /// Type of action
460    /// Allowed values: `CALL_TRANSFER`, `DATA_EXTRACTION`, `IN_CALL_DATA_EXTRACTION`,
461    /// `WORKFLOW_TRIGGER`, `SMS`, `APPOINTMENT_BOOKING`, `CUSTOM_ACTION`, `KNOWLEDGE_BASE`.
462    /// Required by the API.
463    /// (Optional here so responses that omit it still parse.)
464    #[serde(
465        rename = "actionType",
466        default,
467        skip_serializing_if = "Option::is_none"
468    )]
469    pub action_type: Option<String>,
470    /// Human-readable name for this action
471    /// Required by the API.
472    /// (Optional here so responses that omit it still parse.)
473    #[serde(default, skip_serializing_if = "Option::is_none")]
474    pub name: Option<String>,
475    /// Action parameters - structure varies by actionType
476    /// Multiple possible shapes in the spec; raw JSON.
477    /// Required by the API.
478    /// (Optional here so responses that omit it still parse.)
479    #[serde(
480        rename = "actionParameters",
481        default,
482        skip_serializing_if = "Option::is_none"
483    )]
484    pub action_parameters: Option<serde_json::Value>,
485}
486
487/// `CreateAgentResponseDTO` from the GoHighLevel OpenAPI spec.
488#[derive(Debug, Clone, Default, Serialize, Deserialize)]
489pub struct CreateAgentResponseDTO {
490    /// Unique identifier for the created agent
491    /// Required by the API.
492    /// (Optional here so responses that omit it still parse.)
493    #[serde(default, skip_serializing_if = "Option::is_none")]
494    pub id: Option<String>,
495    /// Unique identifier for the location where this agent operates
496    /// Required by the API.
497    /// (Optional here so responses that omit it still parse.)
498    #[serde(
499        rename = "locationId",
500        default,
501        skip_serializing_if = "Option::is_none"
502    )]
503    pub location_id: Option<String>,
504    /// Display name of the voice AI agent
505    /// Required by the API.
506    /// (Optional here so responses that omit it still parse.)
507    #[serde(rename = "agentName", default, skip_serializing_if = "Option::is_none")]
508    pub agent_name: Option<String>,
509    /// Name of the business this agent represents
510    /// Required by the API.
511    /// (Optional here so responses that omit it still parse.)
512    #[serde(
513        rename = "businessName",
514        default,
515        skip_serializing_if = "Option::is_none"
516    )]
517    pub business_name: Option<String>,
518    /// Greeting message spoken when the agent answers calls
519    /// Required by the API.
520    /// (Optional here so responses that omit it still parse.)
521    #[serde(
522        rename = "welcomeMessage",
523        default,
524        skip_serializing_if = "Option::is_none"
525    )]
526    pub welcome_message: Option<String>,
527    /// Custom instructions defining the agent's behavior
528    /// Required by the API.
529    /// (Optional here so responses that omit it still parse.)
530    #[serde(
531        rename = "agentPrompt",
532        default,
533        skip_serializing_if = "Option::is_none"
534    )]
535    pub agent_prompt: Option<String>,
536    /// Identifier for the speech synthesis voice being used
537    /// Required by the API.
538    /// (Optional here so responses that omit it still parse.)
539    #[serde(rename = "voiceId", default, skip_serializing_if = "Option::is_none")]
540    pub voice_id: Option<String>,
541    /// Language code for the agent's speech and understanding
542    /// Required by the API.
543    /// (Optional here so responses that omit it still parse.)
544    #[serde(default, skip_serializing_if = "Option::is_none")]
545    pub language: Option<String>,
546    /// Current tolerance level for caller response delays
547    /// Required by the API.
548    /// (Optional here so responses that omit it still parse.)
549    #[serde(
550        rename = "patienceLevel",
551        default,
552        skip_serializing_if = "Option::is_none"
553    )]
554    pub patience_level: Option<String>,
555    /// Maximum call duration in seconds, between 180-900
556    /// Required by the API.
557    /// (Optional here so responses that omit it still parse.)
558    #[serde(
559        rename = "maxCallDuration",
560        default,
561        skip_serializing_if = "Option::is_none"
562    )]
563    pub max_call_duration: Option<f64>,
564    /// Indicates whether automatic idle reminders are enabled
565    /// Required by the API.
566    /// (Optional here so responses that omit it still parse.)
567    #[serde(
568        rename = "sendUserIdleReminders",
569        default,
570        skip_serializing_if = "Option::is_none"
571    )]
572    pub send_user_idle_reminders: Option<bool>,
573    /// Seconds to wait before sending idle reminders, between 1-20
574    /// Required by the API.
575    /// (Optional here so responses that omit it still parse.)
576    #[serde(
577        rename = "reminderAfterIdleTimeSeconds",
578        default,
579        skip_serializing_if = "Option::is_none"
580    )]
581    pub reminder_after_idle_time_seconds: Option<f64>,
582    /// Phone number for receiving inbound calls
583    #[serde(
584        rename = "inboundNumber",
585        default,
586        skip_serializing_if = "Option::is_none"
587    )]
588    pub inbound_number: Option<String>,
589    /// Identifier for the number pool managing this agent's phone allocation
590    #[serde(
591        rename = "numberPoolId",
592        default,
593        skip_serializing_if = "Option::is_none"
594    )]
595    pub number_pool_id: Option<String>,
596    /// Array of workflow IDs triggered automatically when calls end
597    #[serde(
598        rename = "callEndWorkflowIds",
599        default,
600        skip_serializing_if = "Vec::is_empty"
601    )]
602    pub call_end_workflow_ids: Vec<String>,
603    /// Current post-call notification settings including recipient configuration
604    #[serde(
605        rename = "sendPostCallNotificationTo",
606        default,
607        skip_serializing_if = "Option::is_none"
608    )]
609    pub send_post_call_notification_to: Option<SendPostCallNotificationSchema>,
610    /// Time intervals when the agent accepts calls, organized by day of week
611    #[serde(
612        rename = "agentWorkingHours",
613        default,
614        skip_serializing_if = "Vec::is_empty"
615    )]
616    pub agent_working_hours: Vec<AgentWorkingHoursDTO>,
617    /// IANA timezone identifier for working hours and scheduling
618    /// Required by the API.
619    /// (Optional here so responses that omit it still parse.)
620    #[serde(default, skip_serializing_if = "Option::is_none")]
621    pub timezone: Option<String>,
622    /// Indicates whether this agent is excluded from backup scenarios
623    /// Required by the API.
624    /// (Optional here so responses that omit it still parse.)
625    #[serde(
626        rename = "isAgentAsBackupDisabled",
627        default,
628        skip_serializing_if = "Option::is_none"
629    )]
630    pub is_agent_as_backup_disabled: Option<bool>,
631    /// Current language translation settings including enablement status and target language
632    #[serde(default, skip_serializing_if = "Option::is_none")]
633    pub translation: Option<TranslationSchema>,
634}
635
636/// `CreateSingleActionDTO` from the GoHighLevel OpenAPI spec.
637#[derive(Debug, Clone, Default, Serialize, Deserialize)]
638pub struct CreateSingleActionDTO {
639    /// Agent ID to attach the action to
640    /// Required by the API.
641    #[serde(rename = "agentId")]
642    pub agent_id: String,
643    /// Location ID
644    /// Required by the API.
645    #[serde(rename = "locationId")]
646    pub location_id: String,
647    /// Type of action
648    /// Allowed values: `CALL_TRANSFER`, `DATA_EXTRACTION`, `IN_CALL_DATA_EXTRACTION`,
649    /// `WORKFLOW_TRIGGER`, `SMS`, `APPOINTMENT_BOOKING`, `CUSTOM_ACTION`, `KNOWLEDGE_BASE`.
650    /// Required by the API.
651    #[serde(rename = "actionType")]
652    pub action_type: String,
653    /// Human-readable name for this action
654    /// Required by the API.
655    pub name: String,
656    /// Action parameters - structure varies by actionType
657    /// Multiple possible shapes in the spec; raw JSON.
658    /// Required by the API.
659    #[serde(rename = "actionParameters")]
660    pub action_parameters: serde_json::Value,
661}
662
663/// `CustomActionApiDetailsDTO` from the GoHighLevel OpenAPI spec.
664#[derive(Debug, Clone, Default, Serialize, Deserialize)]
665pub struct CustomActionApiDetailsDTO {
666    /// API endpoint URL
667    /// Required by the API.
668    /// (Optional here so responses that omit it still parse.)
669    #[serde(default, skip_serializing_if = "Option::is_none")]
670    pub url: Option<String>,
671    /// HTTP method
672    /// Allowed values: `POST`, `GET`.
673    /// Required by the API.
674    /// (Optional here so responses that omit it still parse.)
675    #[serde(default, skip_serializing_if = "Option::is_none")]
676    pub method: Option<String>,
677    /// Whether authentication is required
678    #[serde(
679        rename = "authenticationRequired",
680        default,
681        skip_serializing_if = "Option::is_none"
682    )]
683    pub authentication_required: Option<bool>,
684    /// Authentication token or API key (required if authenticationRequired is true)
685    #[serde(
686        rename = "authenticationValue",
687        default,
688        skip_serializing_if = "Option::is_none"
689    )]
690    pub authentication_value: Option<String>,
691    /// HTTP headers to include
692    #[serde(default, skip_serializing_if = "Vec::is_empty")]
693    pub headers: Vec<CustomActionHeaderDTO>,
694    /// API parameters to send
695    #[serde(default, skip_serializing_if = "Vec::is_empty")]
696    pub parameters: Vec<CustomActionParameterDTO>,
697}
698
699/// `CustomActionHeaderDTO` from the GoHighLevel OpenAPI spec.
700#[derive(Debug, Clone, Default, Serialize, Deserialize)]
701pub struct CustomActionHeaderDTO {
702    /// HTTP header name
703    /// Required by the API.
704    /// (Optional here so responses that omit it still parse.)
705    #[serde(default, skip_serializing_if = "Option::is_none")]
706    pub key: Option<String>,
707    /// HTTP header value
708    /// Required by the API.
709    /// (Optional here so responses that omit it still parse.)
710    #[serde(default, skip_serializing_if = "Option::is_none")]
711    pub value: Option<String>,
712}
713
714/// `CustomActionParameterDTO` from the GoHighLevel OpenAPI spec.
715#[derive(Debug, Clone, Default, Serialize, Deserialize)]
716pub struct CustomActionParameterDTO {
717    /// Parameter name
718    /// Required by the API.
719    /// (Optional here so responses that omit it still parse.)
720    #[serde(default, skip_serializing_if = "Option::is_none")]
721    pub name: Option<String>,
722    /// Parameter description
723    #[serde(default, skip_serializing_if = "Option::is_none")]
724    pub description: Option<String>,
725    /// Parameter type
726    #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
727    pub type_: Option<String>,
728    /// Example parameter value
729    #[serde(default, skip_serializing_if = "Option::is_none")]
730    pub example: Option<String>,
731}
732
733/// `CustomActionParameters` from the GoHighLevel OpenAPI spec.
734#[derive(Debug, Clone, Default, Serialize, Deserialize)]
735pub struct CustomActionParameters {
736    /// When to call the custom API
737    /// Required by the API.
738    /// (Optional here so responses that omit it still parse.)
739    #[serde(
740        rename = "triggerPrompt",
741        default,
742        skip_serializing_if = "Option::is_none"
743    )]
744    pub trigger_prompt: Option<String>,
745    /// Message to tell the caller
746    /// Required by the API.
747    /// (Optional here so responses that omit it still parse.)
748    #[serde(
749        rename = "triggerMessage",
750        default,
751        skip_serializing_if = "Option::is_none"
752    )]
753    pub trigger_message: Option<String>,
754    /// API endpoint configuration
755    /// Required by the API.
756    /// (Optional here so responses that omit it still parse.)
757    #[serde(
758        rename = "apiDetails",
759        default,
760        skip_serializing_if = "Option::is_none"
761    )]
762    pub api_details: Option<CustomActionApiDetailsDTO>,
763    /// Selected response paths to extract from API response. Required: at least 1 value if the
764    /// method is GET. Should be empty if the method is POST.
765    #[serde(
766        rename = "selectedPaths",
767        default,
768        skip_serializing_if = "Vec::is_empty"
769    )]
770    pub selected_paths: Vec<String>,
771}
772
773/// `DataExtractionActionParameters` from the GoHighLevel OpenAPI spec.
774#[derive(Debug, Clone, Default, Serialize, Deserialize)]
775pub struct DataExtractionActionParameters {
776    /// ID of the contact field to be updated with the extracted data
777    /// Required by the API.
778    /// (Optional here so responses that omit it still parse.)
779    #[serde(
780        rename = "contactFieldId",
781        default,
782        skip_serializing_if = "Option::is_none"
783    )]
784    pub contact_field_id: Option<String>,
785    /// Description of what data to extract
786    /// Required by the API.
787    /// (Optional here so responses that omit it still parse.)
788    #[serde(default, skip_serializing_if = "Option::is_none")]
789    pub description: Option<String>,
790    /// Example values to help Agent understand the expected format. At least one example is
791    /// required, maximum 5 examples allowed.
792    /// Required by the API.
793    /// (Optional here so responses that omit it still parse.)
794    #[serde(default, skip_serializing_if = "Vec::is_empty")]
795    pub examples: Vec<String>,
796    /// Whether to overwrite existing field value if already set, default is false
797    #[serde(
798        rename = "overwriteExistingValue",
799        default,
800        skip_serializing_if = "Option::is_none"
801    )]
802    pub overwrite_existing_value: Option<bool>,
803}
804
805/// `ExtractedDataSchema` from the GoHighLevel OpenAPI spec.
806#[derive(Debug, Clone, Default, Serialize, Deserialize)]
807pub struct ExtractedDataSchema {
808    /// The spec defines no fields for this schema.
809    #[serde(flatten)]
810    pub extra: serde_json::Map<String, serde_json::Value>,
811}
812
813/// `GetActionResponseDTO` from the GoHighLevel OpenAPI spec.
814#[derive(Debug, Clone, Default, Serialize, Deserialize)]
815pub struct GetActionResponseDTO {
816    /// Unique identifier for the action
817    /// Required by the API.
818    /// (Optional here so responses that omit it still parse.)
819    #[serde(default, skip_serializing_if = "Option::is_none")]
820    pub id: Option<String>,
821    /// Type of action
822    /// Allowed values: `CALL_TRANSFER`, `DATA_EXTRACTION`, `IN_CALL_DATA_EXTRACTION`,
823    /// `WORKFLOW_TRIGGER`, `SMS`, `APPOINTMENT_BOOKING`, `CUSTOM_ACTION`, `KNOWLEDGE_BASE`.
824    /// Required by the API.
825    /// (Optional here so responses that omit it still parse.)
826    #[serde(
827        rename = "actionType",
828        default,
829        skip_serializing_if = "Option::is_none"
830    )]
831    pub action_type: Option<String>,
832    /// Human-readable name for this action
833    /// Required by the API.
834    /// (Optional here so responses that omit it still parse.)
835    #[serde(default, skip_serializing_if = "Option::is_none")]
836    pub name: Option<String>,
837    /// Action parameters - structure varies by actionType
838    /// Multiple possible shapes in the spec; raw JSON.
839    /// Required by the API.
840    /// (Optional here so responses that omit it still parse.)
841    #[serde(
842        rename = "actionParameters",
843        default,
844        skip_serializing_if = "Option::is_none"
845    )]
846    pub action_parameters: Option<serde_json::Value>,
847}
848
849/// `GetAgentResponseDTO` from the GoHighLevel OpenAPI spec.
850#[derive(Debug, Clone, Default, Serialize, Deserialize)]
851pub struct GetAgentResponseDTO {
852    /// Unique identifier for the created agent
853    /// Required by the API.
854    /// (Optional here so responses that omit it still parse.)
855    #[serde(default, skip_serializing_if = "Option::is_none")]
856    pub id: Option<String>,
857    /// Unique identifier for the location where this agent operates
858    /// Required by the API.
859    /// (Optional here so responses that omit it still parse.)
860    #[serde(
861        rename = "locationId",
862        default,
863        skip_serializing_if = "Option::is_none"
864    )]
865    pub location_id: Option<String>,
866    /// Display name of the voice AI agent
867    /// Required by the API.
868    /// (Optional here so responses that omit it still parse.)
869    #[serde(rename = "agentName", default, skip_serializing_if = "Option::is_none")]
870    pub agent_name: Option<String>,
871    /// Name of the business this agent represents
872    /// Required by the API.
873    /// (Optional here so responses that omit it still parse.)
874    #[serde(
875        rename = "businessName",
876        default,
877        skip_serializing_if = "Option::is_none"
878    )]
879    pub business_name: Option<String>,
880    /// Greeting message spoken when the agent answers calls
881    /// Required by the API.
882    /// (Optional here so responses that omit it still parse.)
883    #[serde(
884        rename = "welcomeMessage",
885        default,
886        skip_serializing_if = "Option::is_none"
887    )]
888    pub welcome_message: Option<String>,
889    /// Custom instructions defining the agent's behavior
890    /// Required by the API.
891    /// (Optional here so responses that omit it still parse.)
892    #[serde(
893        rename = "agentPrompt",
894        default,
895        skip_serializing_if = "Option::is_none"
896    )]
897    pub agent_prompt: Option<String>,
898    /// Identifier for the speech synthesis voice being used
899    /// Required by the API.
900    /// (Optional here so responses that omit it still parse.)
901    #[serde(rename = "voiceId", default, skip_serializing_if = "Option::is_none")]
902    pub voice_id: Option<String>,
903    /// Language code for the agent's speech and understanding
904    /// Required by the API.
905    /// (Optional here so responses that omit it still parse.)
906    #[serde(default, skip_serializing_if = "Option::is_none")]
907    pub language: Option<String>,
908    /// Current tolerance level for caller response delays
909    /// Required by the API.
910    /// (Optional here so responses that omit it still parse.)
911    #[serde(
912        rename = "patienceLevel",
913        default,
914        skip_serializing_if = "Option::is_none"
915    )]
916    pub patience_level: Option<String>,
917    /// Maximum call duration in seconds, between 180-900
918    /// Required by the API.
919    /// (Optional here so responses that omit it still parse.)
920    #[serde(
921        rename = "maxCallDuration",
922        default,
923        skip_serializing_if = "Option::is_none"
924    )]
925    pub max_call_duration: Option<f64>,
926    /// Indicates whether automatic idle reminders are enabled
927    /// Required by the API.
928    /// (Optional here so responses that omit it still parse.)
929    #[serde(
930        rename = "sendUserIdleReminders",
931        default,
932        skip_serializing_if = "Option::is_none"
933    )]
934    pub send_user_idle_reminders: Option<bool>,
935    /// Seconds to wait before sending idle reminders, between 1-20
936    /// Required by the API.
937    /// (Optional here so responses that omit it still parse.)
938    #[serde(
939        rename = "reminderAfterIdleTimeSeconds",
940        default,
941        skip_serializing_if = "Option::is_none"
942    )]
943    pub reminder_after_idle_time_seconds: Option<f64>,
944    /// Phone number for receiving inbound calls
945    #[serde(
946        rename = "inboundNumber",
947        default,
948        skip_serializing_if = "Option::is_none"
949    )]
950    pub inbound_number: Option<String>,
951    /// Identifier for the number pool managing this agent's phone allocation
952    #[serde(
953        rename = "numberPoolId",
954        default,
955        skip_serializing_if = "Option::is_none"
956    )]
957    pub number_pool_id: Option<String>,
958    /// Array of workflow IDs triggered automatically when calls end
959    #[serde(
960        rename = "callEndWorkflowIds",
961        default,
962        skip_serializing_if = "Vec::is_empty"
963    )]
964    pub call_end_workflow_ids: Vec<String>,
965    /// Current post-call notification settings including recipient configuration
966    #[serde(
967        rename = "sendPostCallNotificationTo",
968        default,
969        skip_serializing_if = "Option::is_none"
970    )]
971    pub send_post_call_notification_to: Option<SendPostCallNotificationSchema>,
972    /// Time intervals when the agent accepts calls, organized by day of week
973    #[serde(
974        rename = "agentWorkingHours",
975        default,
976        skip_serializing_if = "Vec::is_empty"
977    )]
978    pub agent_working_hours: Vec<AgentWorkingHoursDTO>,
979    /// IANA timezone identifier for working hours and scheduling
980    /// Required by the API.
981    /// (Optional here so responses that omit it still parse.)
982    #[serde(default, skip_serializing_if = "Option::is_none")]
983    pub timezone: Option<String>,
984    /// Indicates whether this agent is excluded from backup scenarios
985    /// Required by the API.
986    /// (Optional here so responses that omit it still parse.)
987    #[serde(
988        rename = "isAgentAsBackupDisabled",
989        default,
990        skip_serializing_if = "Option::is_none"
991    )]
992    pub is_agent_as_backup_disabled: Option<bool>,
993    /// Current language translation settings including enablement status and target language
994    #[serde(default, skip_serializing_if = "Option::is_none")]
995    pub translation: Option<TranslationSchema>,
996    /// Raw actions configured for this agent with complete actionParameters structure
997    /// Required by the API.
998    /// (Optional here so responses that omit it still parse.)
999    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1000    pub actions: Vec<AgentActionResponseDTO>,
1001}
1002
1003/// `GetAgentsResponseDTO` from the GoHighLevel OpenAPI spec.
1004#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1005pub struct GetAgentsResponseDTO {
1006    /// Total number of items
1007    /// Required by the API.
1008    /// (Optional here so responses that omit it still parse.)
1009    #[serde(default, skip_serializing_if = "Option::is_none")]
1010    pub total: Option<f64>,
1011    /// Page number starting from 1
1012    /// Required by the API.
1013    /// (Optional here so responses that omit it still parse.)
1014    #[serde(default, skip_serializing_if = "Option::is_none")]
1015    pub page: Option<f64>,
1016    /// Number of items per page
1017    /// Required by the API.
1018    /// (Optional here so responses that omit it still parse.)
1019    #[serde(rename = "pageSize", default, skip_serializing_if = "Option::is_none")]
1020    pub page_size: Option<f64>,
1021    /// Required by the API.
1022    /// (Optional here so responses that omit it still parse.)
1023    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1024    pub agents: Vec<GetAgentResponseDTO>,
1025}
1026
1027/// `InCallDataExtractionActionParameters` from the GoHighLevel OpenAPI spec.
1028#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1029pub struct InCallDataExtractionActionParameters {
1030    /// ID of the contact field to be updated with the extracted data
1031    /// Required by the API.
1032    /// (Optional here so responses that omit it still parse.)
1033    #[serde(
1034        rename = "contactFieldId",
1035        default,
1036        skip_serializing_if = "Option::is_none"
1037    )]
1038    pub contact_field_id: Option<String>,
1039    /// Description of what data to extract
1040    /// Required by the API.
1041    /// (Optional here so responses that omit it still parse.)
1042    #[serde(default, skip_serializing_if = "Option::is_none")]
1043    pub description: Option<String>,
1044    /// Example values to help Agent understand the expected format. At least one example is
1045    /// required, maximum 5 examples allowed.
1046    /// Required by the API.
1047    /// (Optional here so responses that omit it still parse.)
1048    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1049    pub examples: Vec<String>,
1050    /// Whether to overwrite existing field value if already set, default is false
1051    #[serde(
1052        rename = "overwriteExistingValue",
1053        default,
1054        skip_serializing_if = "Option::is_none"
1055    )]
1056    pub overwrite_existing_value: Option<bool>,
1057}
1058
1059/// `IntervalDTO` from the GoHighLevel OpenAPI spec.
1060#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1061pub struct IntervalDTO {
1062    /// Starting hour of the working interval in 24-hour format (0-23)
1063    /// Required by the API.
1064    /// (Optional here so responses that omit it still parse.)
1065    #[serde(rename = "startHour", default, skip_serializing_if = "Option::is_none")]
1066    pub start_hour: Option<f64>,
1067    /// Ending hour of the working interval in 24-hour format (0-23)
1068    /// Required by the API.
1069    /// (Optional here so responses that omit it still parse.)
1070    #[serde(rename = "endHour", default, skip_serializing_if = "Option::is_none")]
1071    pub end_hour: Option<f64>,
1072    /// Starting minute of the working interval (0-59)
1073    /// Required by the API.
1074    /// (Optional here so responses that omit it still parse.)
1075    #[serde(
1076        rename = "startMinute",
1077        default,
1078        skip_serializing_if = "Option::is_none"
1079    )]
1080    pub start_minute: Option<f64>,
1081    /// Ending minute of the working interval (0-59)
1082    /// Required by the API.
1083    /// (Optional here so responses that omit it still parse.)
1084    #[serde(rename = "endMinute", default, skip_serializing_if = "Option::is_none")]
1085    pub end_minute: Option<f64>,
1086}
1087
1088/// `KnowledgeBaseParameters` from the GoHighLevel OpenAPI spec.
1089#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1090pub struct KnowledgeBaseParameters {
1091    /// When to query the knowledge base
1092    /// Required by the API.
1093    /// (Optional here so responses that omit it still parse.)
1094    #[serde(
1095        rename = "triggerPrompt",
1096        default,
1097        skip_serializing_if = "Option::is_none"
1098    )]
1099    pub trigger_prompt: Option<String>,
1100    /// Knowledge base ID to query
1101    /// Required by the API.
1102    /// (Optional here so responses that omit it still parse.)
1103    #[serde(
1104        rename = "knowledgeBaseId",
1105        default,
1106        skip_serializing_if = "Option::is_none"
1107    )]
1108    pub knowledge_base_id: Option<String>,
1109}
1110
1111/// `PatchAgentDTO` from the GoHighLevel OpenAPI spec.
1112#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1113pub struct PatchAgentDTO {
1114    /// Display name for the voice AI agent, between 1-40 characters. Default: "My Agent {random
1115    /// 3 digit number}"
1116    #[serde(rename = "agentName", default, skip_serializing_if = "Option::is_none")]
1117    pub agent_name: Option<String>,
1118    /// Name of the business this agent represents. Default: Uses location name
1119    #[serde(
1120        rename = "businessName",
1121        default,
1122        skip_serializing_if = "Option::is_none"
1123    )]
1124    pub business_name: Option<String>,
1125    /// Initial greeting spoken when the agent answers calls. Default: Auto generated
1126    #[serde(
1127        rename = "welcomeMessage",
1128        default,
1129        skip_serializing_if = "Option::is_none"
1130    )]
1131    pub welcome_message: Option<String>,
1132    /// Custom instructions defining the agent's behavior and personality. Default: Basic prompt
1133    /// generated automatically
1134    #[serde(
1135        rename = "agentPrompt",
1136        default,
1137        skip_serializing_if = "Option::is_none"
1138    )]
1139    pub agent_prompt: Option<String>,
1140    /// Identifier for the speech synthesis voice from available voice options. Default: Auto
1141    /// generated
1142    #[serde(rename = "voiceId", default, skip_serializing_if = "Option::is_none")]
1143    pub voice_id: Option<String>,
1144    #[serde(default, skip_serializing_if = "Option::is_none")]
1145    pub language: Option<VoiceAILanguage>,
1146    #[serde(
1147        rename = "patienceLevel",
1148        default,
1149        skip_serializing_if = "Option::is_none"
1150    )]
1151    pub patience_level: Option<PatienceLevel>,
1152    /// Maximum call duration in seconds, between 180-900 (3-15 minutes). Default: 300 seconds
1153    /// (5 minutes)
1154    #[serde(
1155        rename = "maxCallDuration",
1156        default,
1157        skip_serializing_if = "Option::is_none"
1158    )]
1159    pub max_call_duration: Option<f64>,
1160    /// Enables automatic reminders when callers are silent. Default: true
1161    #[serde(
1162        rename = "sendUserIdleReminders",
1163        default,
1164        skip_serializing_if = "Option::is_none"
1165    )]
1166    pub send_user_idle_reminders: Option<bool>,
1167    /// Seconds to wait before sending idle reminders, between 1-20. Default: 8 seconds
1168    #[serde(
1169        rename = "reminderAfterIdleTimeSeconds",
1170        default,
1171        skip_serializing_if = "Option::is_none"
1172    )]
1173    pub reminder_after_idle_time_seconds: Option<f64>,
1174    /// Phone number for receiving inbound calls to this agent. Default: null
1175    #[serde(
1176        rename = "inboundNumber",
1177        default,
1178        skip_serializing_if = "Option::is_none"
1179    )]
1180    pub inbound_number: Option<String>,
1181    /// Identifier for the number pool managing phone number allocation. Default: null
1182    #[serde(
1183        rename = "numberPoolId",
1184        default,
1185        skip_serializing_if = "Option::is_none"
1186    )]
1187    pub number_pool_id: Option<String>,
1188    /// Array of workflow IDs to trigger automatically when calls end. Default: []
1189    #[serde(
1190        rename = "callEndWorkflowIds",
1191        default,
1192        skip_serializing_if = "Vec::is_empty"
1193    )]
1194    pub call_end_workflow_ids: Vec<String>,
1195    /// Configuration for post-call email notifications to various recipients. Default: []
1196    #[serde(
1197        rename = "sendPostCallNotificationTo",
1198        default,
1199        skip_serializing_if = "Option::is_none"
1200    )]
1201    pub send_post_call_notification_to: Option<SendPostCallNotificationDTO>,
1202    /// Time intervals defining when the agent accepts calls, organized by day of week. Default:
1203    /// [] (available 24/7)
1204    #[serde(
1205        rename = "agentWorkingHours",
1206        default,
1207        skip_serializing_if = "Vec::is_empty"
1208    )]
1209    pub agent_working_hours: Vec<AgentWorkingHoursDTO>,
1210    /// IANA timezone identifier affecting working hours and scheduling. Default: Location
1211    /// timezone
1212    #[serde(default, skip_serializing_if = "Option::is_none")]
1213    pub timezone: Option<String>,
1214    /// Prevents this agent from being used as a fallback option. Default: false (Available as
1215    /// backup agent)
1216    #[serde(
1217        rename = "isAgentAsBackupDisabled",
1218        default,
1219        skip_serializing_if = "Option::is_none"
1220    )]
1221    pub is_agent_as_backup_disabled: Option<bool>,
1222    /// Language translation settings including enablement flag and target language code. Rules:
1223    /// (1) translation.enabled can only be true if the agent's language is not en-US; (2) when
1224    /// enabled, translation.language must be either the agent's language or en-US; (3) when
1225    /// enabled, translation.language is required.
1226    #[serde(default, skip_serializing_if = "Option::is_none")]
1227    pub translation: Option<TranslationDTO>,
1228}
1229
1230/// `PatchAgentResponseDTO` from the GoHighLevel OpenAPI spec.
1231#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1232pub struct PatchAgentResponseDTO {
1233    /// Unique identifier for the created agent
1234    /// Required by the API.
1235    /// (Optional here so responses that omit it still parse.)
1236    #[serde(default, skip_serializing_if = "Option::is_none")]
1237    pub id: Option<String>,
1238    /// Unique identifier for the location where this agent operates
1239    /// Required by the API.
1240    /// (Optional here so responses that omit it still parse.)
1241    #[serde(
1242        rename = "locationId",
1243        default,
1244        skip_serializing_if = "Option::is_none"
1245    )]
1246    pub location_id: Option<String>,
1247    /// Display name of the voice AI agent
1248    /// Required by the API.
1249    /// (Optional here so responses that omit it still parse.)
1250    #[serde(rename = "agentName", default, skip_serializing_if = "Option::is_none")]
1251    pub agent_name: Option<String>,
1252    /// Name of the business this agent represents
1253    /// Required by the API.
1254    /// (Optional here so responses that omit it still parse.)
1255    #[serde(
1256        rename = "businessName",
1257        default,
1258        skip_serializing_if = "Option::is_none"
1259    )]
1260    pub business_name: Option<String>,
1261    /// Greeting message spoken when the agent answers calls
1262    /// Required by the API.
1263    /// (Optional here so responses that omit it still parse.)
1264    #[serde(
1265        rename = "welcomeMessage",
1266        default,
1267        skip_serializing_if = "Option::is_none"
1268    )]
1269    pub welcome_message: Option<String>,
1270    /// Custom instructions defining the agent's behavior
1271    /// Required by the API.
1272    /// (Optional here so responses that omit it still parse.)
1273    #[serde(
1274        rename = "agentPrompt",
1275        default,
1276        skip_serializing_if = "Option::is_none"
1277    )]
1278    pub agent_prompt: Option<String>,
1279    /// Identifier for the speech synthesis voice being used
1280    /// Required by the API.
1281    /// (Optional here so responses that omit it still parse.)
1282    #[serde(rename = "voiceId", default, skip_serializing_if = "Option::is_none")]
1283    pub voice_id: Option<String>,
1284    /// Language code for the agent's speech and understanding
1285    /// Required by the API.
1286    /// (Optional here so responses that omit it still parse.)
1287    #[serde(default, skip_serializing_if = "Option::is_none")]
1288    pub language: Option<String>,
1289    /// Current tolerance level for caller response delays
1290    /// Required by the API.
1291    /// (Optional here so responses that omit it still parse.)
1292    #[serde(
1293        rename = "patienceLevel",
1294        default,
1295        skip_serializing_if = "Option::is_none"
1296    )]
1297    pub patience_level: Option<String>,
1298    /// Maximum call duration in seconds, between 180-900
1299    /// Required by the API.
1300    /// (Optional here so responses that omit it still parse.)
1301    #[serde(
1302        rename = "maxCallDuration",
1303        default,
1304        skip_serializing_if = "Option::is_none"
1305    )]
1306    pub max_call_duration: Option<f64>,
1307    /// Indicates whether automatic idle reminders are enabled
1308    /// Required by the API.
1309    /// (Optional here so responses that omit it still parse.)
1310    #[serde(
1311        rename = "sendUserIdleReminders",
1312        default,
1313        skip_serializing_if = "Option::is_none"
1314    )]
1315    pub send_user_idle_reminders: Option<bool>,
1316    /// Seconds to wait before sending idle reminders, between 1-20
1317    /// Required by the API.
1318    /// (Optional here so responses that omit it still parse.)
1319    #[serde(
1320        rename = "reminderAfterIdleTimeSeconds",
1321        default,
1322        skip_serializing_if = "Option::is_none"
1323    )]
1324    pub reminder_after_idle_time_seconds: Option<f64>,
1325    /// Phone number for receiving inbound calls
1326    #[serde(
1327        rename = "inboundNumber",
1328        default,
1329        skip_serializing_if = "Option::is_none"
1330    )]
1331    pub inbound_number: Option<String>,
1332    /// Identifier for the number pool managing this agent's phone allocation
1333    #[serde(
1334        rename = "numberPoolId",
1335        default,
1336        skip_serializing_if = "Option::is_none"
1337    )]
1338    pub number_pool_id: Option<String>,
1339    /// Array of workflow IDs triggered automatically when calls end
1340    #[serde(
1341        rename = "callEndWorkflowIds",
1342        default,
1343        skip_serializing_if = "Vec::is_empty"
1344    )]
1345    pub call_end_workflow_ids: Vec<String>,
1346    /// Current post-call notification settings including recipient configuration
1347    #[serde(
1348        rename = "sendPostCallNotificationTo",
1349        default,
1350        skip_serializing_if = "Option::is_none"
1351    )]
1352    pub send_post_call_notification_to: Option<SendPostCallNotificationSchema>,
1353    /// Time intervals when the agent accepts calls, organized by day of week
1354    #[serde(
1355        rename = "agentWorkingHours",
1356        default,
1357        skip_serializing_if = "Vec::is_empty"
1358    )]
1359    pub agent_working_hours: Vec<AgentWorkingHoursDTO>,
1360    /// IANA timezone identifier for working hours and scheduling
1361    /// Required by the API.
1362    /// (Optional here so responses that omit it still parse.)
1363    #[serde(default, skip_serializing_if = "Option::is_none")]
1364    pub timezone: Option<String>,
1365    /// Indicates whether this agent is excluded from backup scenarios
1366    /// Required by the API.
1367    /// (Optional here so responses that omit it still parse.)
1368    #[serde(
1369        rename = "isAgentAsBackupDisabled",
1370        default,
1371        skip_serializing_if = "Option::is_none"
1372    )]
1373    pub is_agent_as_backup_disabled: Option<bool>,
1374    /// Current language translation settings including enablement status and target language
1375    #[serde(default, skip_serializing_if = "Option::is_none")]
1376    pub translation: Option<TranslationSchema>,
1377}
1378
1379/// Tolerance level for caller response delays. Default: "high"
1380/// Allowed values: `low`, `medium`, `high`.
1381/// Kept as `String` so new upstream values don't break deserialization.
1382pub type PatienceLevel = String;
1383
1384/// `SMSParameters` from the GoHighLevel OpenAPI spec.
1385#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1386pub struct SMSParameters {
1387    /// When to send the SMS
1388    /// Required by the API.
1389    /// (Optional here so responses that omit it still parse.)
1390    #[serde(
1391        rename = "triggerPrompt",
1392        default,
1393        skip_serializing_if = "Option::is_none"
1394    )]
1395    pub trigger_prompt: Option<String>,
1396    /// Message to tell the caller
1397    /// Required by the API.
1398    /// (Optional here so responses that omit it still parse.)
1399    #[serde(
1400        rename = "triggerMessage",
1401        default,
1402        skip_serializing_if = "Option::is_none"
1403    )]
1404    pub trigger_message: Option<String>,
1405    /// SMS message content to send
1406    /// Required by the API.
1407    /// (Optional here so responses that omit it still parse.)
1408    #[serde(
1409        rename = "messageBody",
1410        default,
1411        skip_serializing_if = "Option::is_none"
1412    )]
1413    pub message_body: Option<String>,
1414}
1415
1416/// `SendPostCallNotificationDTO` from the GoHighLevel OpenAPI spec.
1417#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1418pub struct SendPostCallNotificationDTO {
1419    /// Enables post-call notifications to all admin users in the location. Default: true
1420    /// Required by the API.
1421    pub admins: bool,
1422    /// Enables post-call notifications to all users in the location. Default: false
1423    /// Required by the API.
1424    #[serde(rename = "allUsers")]
1425    pub all_users: bool,
1426    /// Enables post-call notifications to the user assigned to the contact. Default: false
1427    /// Required by the API.
1428    #[serde(rename = "contactAssignedUser")]
1429    pub contact_assigned_user: bool,
1430    /// Array of specific user IDs to receive post-call notifications. Default: []
1431    /// Required by the API.
1432    #[serde(
1433        rename = "specificUsers",
1434        default,
1435        skip_serializing_if = "Vec::is_empty"
1436    )]
1437    pub specific_users: Vec<String>,
1438    /// Array of custom email addresses to receive post-call notifications. Default: []
1439    /// Required by the API.
1440    #[serde(
1441        rename = "customEmails",
1442        default,
1443        skip_serializing_if = "Vec::is_empty"
1444    )]
1445    pub custom_emails: Vec<String>,
1446}
1447
1448/// `SendPostCallNotificationSchema` from the GoHighLevel OpenAPI spec.
1449#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1450pub struct SendPostCallNotificationSchema {
1451    /// Send notifications to admins
1452    #[serde(default, skip_serializing_if = "Option::is_none")]
1453    pub admins: Option<bool>,
1454    /// Send notifications to all users
1455    #[serde(rename = "allUsers", default, skip_serializing_if = "Option::is_none")]
1456    pub all_users: Option<bool>,
1457    /// Send notifications to contact assigned user
1458    #[serde(
1459        rename = "contactAssignedUser",
1460        default,
1461        skip_serializing_if = "Option::is_none"
1462    )]
1463    pub contact_assigned_user: Option<bool>,
1464    /// Specific user IDs to notify
1465    #[serde(
1466        rename = "specificUsers",
1467        default,
1468        skip_serializing_if = "Vec::is_empty"
1469    )]
1470    pub specific_users: Vec<String>,
1471    /// Custom email addresses to notify
1472    #[serde(
1473        rename = "customEmails",
1474        default,
1475        skip_serializing_if = "Vec::is_empty"
1476    )]
1477    pub custom_emails: Vec<String>,
1478}
1479
1480/// `TranslationDTO` from the GoHighLevel OpenAPI spec.
1481#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1482pub struct TranslationDTO {
1483    /// Enables language translation for agent conversations. Default: false
1484    /// Required by the API.
1485    pub enabled: bool,
1486    /// Target language code for translation (e.g., "es" for Spanish, "fr" for French).
1487    #[serde(default, skip_serializing_if = "Option::is_none")]
1488    pub language: Option<String>,
1489}
1490
1491/// `TranslationSchema` from the GoHighLevel OpenAPI spec.
1492#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1493pub struct TranslationSchema {
1494    /// Whether translation is enabled
1495    #[serde(default, skip_serializing_if = "Option::is_none")]
1496    pub enabled: Option<bool>,
1497    /// Translation language code
1498    #[serde(default, skip_serializing_if = "Option::is_none")]
1499    pub language: Option<String>,
1500}
1501
1502/// `UpdateActionResponseDTO` from the GoHighLevel OpenAPI spec.
1503#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1504pub struct UpdateActionResponseDTO {
1505    /// Unique identifier for the created action
1506    /// Required by the API.
1507    /// (Optional here so responses that omit it still parse.)
1508    #[serde(default, skip_serializing_if = "Option::is_none")]
1509    pub id: Option<String>,
1510    /// Type of action
1511    /// Allowed values: `CALL_TRANSFER`, `DATA_EXTRACTION`, `IN_CALL_DATA_EXTRACTION`,
1512    /// `WORKFLOW_TRIGGER`, `SMS`, `APPOINTMENT_BOOKING`, `CUSTOM_ACTION`, `KNOWLEDGE_BASE`.
1513    /// Required by the API.
1514    /// (Optional here so responses that omit it still parse.)
1515    #[serde(
1516        rename = "actionType",
1517        default,
1518        skip_serializing_if = "Option::is_none"
1519    )]
1520    pub action_type: Option<String>,
1521    /// Human-readable name for this action
1522    /// Required by the API.
1523    /// (Optional here so responses that omit it still parse.)
1524    #[serde(default, skip_serializing_if = "Option::is_none")]
1525    pub name: Option<String>,
1526    /// Action parameters - structure varies by actionType
1527    /// Multiple possible shapes in the spec; raw JSON.
1528    /// Required by the API.
1529    /// (Optional here so responses that omit it still parse.)
1530    #[serde(
1531        rename = "actionParameters",
1532        default,
1533        skip_serializing_if = "Option::is_none"
1534    )]
1535    pub action_parameters: Option<serde_json::Value>,
1536}
1537
1538/// `UpdateSingleActionDTO` from the GoHighLevel OpenAPI spec.
1539#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1540pub struct UpdateSingleActionDTO {
1541    /// Agent ID to attach the action to
1542    /// Required by the API.
1543    #[serde(rename = "agentId")]
1544    pub agent_id: String,
1545    /// Location ID
1546    /// Required by the API.
1547    #[serde(rename = "locationId")]
1548    pub location_id: String,
1549    /// Type of action
1550    /// Allowed values: `CALL_TRANSFER`, `DATA_EXTRACTION`, `IN_CALL_DATA_EXTRACTION`,
1551    /// `WORKFLOW_TRIGGER`, `SMS`, `APPOINTMENT_BOOKING`, `CUSTOM_ACTION`, `KNOWLEDGE_BASE`.
1552    /// Required by the API.
1553    #[serde(rename = "actionType")]
1554    pub action_type: String,
1555    /// Human-readable name for this action
1556    /// Required by the API.
1557    pub name: String,
1558    /// Action parameters - structure varies by actionType
1559    /// Multiple possible shapes in the spec; raw JSON.
1560    /// Required by the API.
1561    #[serde(rename = "actionParameters")]
1562    pub action_parameters: serde_json::Value,
1563}
1564
1565/// Language code for the agent's speech and understanding. Default: "en-US"
1566/// Allowed values: `en-US`, `pt-BR`, `es`, `fr`, `de`, `it`, `nl-NL`, `multi`.
1567/// Kept as `String` so new upstream values don't break deserialization.
1568pub type VoiceAILanguage = String;
1569
1570/// `WorkflowTriggerParameters` from the GoHighLevel OpenAPI spec.
1571#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1572pub struct WorkflowTriggerParameters {
1573    /// When to trigger this workflow
1574    /// Required by the API.
1575    /// (Optional here so responses that omit it still parse.)
1576    #[serde(
1577        rename = "triggerPrompt",
1578        default,
1579        skip_serializing_if = "Option::is_none"
1580    )]
1581    pub trigger_prompt: Option<String>,
1582    /// Message to tell the caller
1583    /// Required by the API.
1584    /// (Optional here so responses that omit it still parse.)
1585    #[serde(
1586        rename = "triggerMessage",
1587        default,
1588        skip_serializing_if = "Option::is_none"
1589    )]
1590    pub trigger_message: Option<String>,
1591    /// Workflow ID to trigger
1592    /// Required by the API.
1593    /// (Optional here so responses that omit it still parse.)
1594    #[serde(
1595        rename = "workflowId",
1596        default,
1597        skip_serializing_if = "Option::is_none"
1598    )]
1599    pub workflow_id: Option<String>,
1600}