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