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