Class: HighLevel::Resources::VoiceAi
- Defined in:
- lib/high_level/resources/voice_ai.rb
Instance Method Summary collapse
-
#create_action(body:, **_opts) ⇒ Object
Create Agent Action.
-
#create_agent(body:, **_opts) ⇒ Object
Create Agent.
-
#delete_action(action_id:, location_id: nil, agent_id: nil, **_opts) ⇒ Object
Delete Agent Action.
-
#delete_agent(agent_id:, location_id: nil, **_opts) ⇒ Object
Delete Agent.
-
#get_action(action_id:, location_id: nil, **_opts) ⇒ Object
Get Agent Action.
-
#get_agent(agent_id:, location_id: nil, **_opts) ⇒ Object
Get Agent.
-
#get_agents(page: nil, page_size: nil, location_id: nil, query: nil, **_opts) ⇒ Object
List Agents.
-
#get_call_log(call_id:, location_id: nil, **_opts) ⇒ Object
Get Call Log.
-
#get_call_logs(location_id: nil, agent_id: nil, contact_id: nil, call_type: nil, start_date: nil, end_date: nil, action_type: nil, sort_by: nil, sort: nil, page: nil, page_size: nil, **_opts) ⇒ Object
List Call Logs.
-
#patch_agent(agent_id:, body:, location_id: nil, **_opts) ⇒ Object
Patch Agent.
-
#update_action(action_id:, body:, **_opts) ⇒ Object
Update Agent Action.
Methods inherited from Base
Constructor Details
This class inherits a constructor from HighLevel::Resources::Base
Instance Method Details
#create_action(body:, **_opts) ⇒ Object
Create Agent Action
Create a new action for a voice AI agent. Actions define specific behaviors and capabilities for the agent during calls.
97 98 99 100 101 102 103 104 |
# File 'lib/high_level/resources/voice_ai.rb', line 97 def create_action(body:, **_opts) request( method: :post, path: "/voice-ai/actions", security: ["bearer"], body: body ) end |
#create_agent(body:, **_opts) ⇒ Object
Create Agent
Create a new voice AI agent configuration and settings
24 25 26 27 28 29 30 31 |
# File 'lib/high_level/resources/voice_ai.rb', line 24 def create_agent(body:, **_opts) request( method: :post, path: "/voice-ai/agents", security: ["bearer"], body: body ) end |
#delete_action(action_id:, location_id: nil, agent_id: nil, **_opts) ⇒ Object
Delete Agent Action
Delete an existing action from a voice AI agent. This permanently removes the action and its configuration.
133 134 135 136 137 138 139 140 |
# File 'lib/high_level/resources/voice_ai.rb', line 133 def delete_action(action_id:, location_id: nil, agent_id: nil, **_opts) request( method: :delete, path: "/voice-ai/actions/#{action_id}", security: ["bearer"], params: { "locationId" => location_id, "agentId" => agent_id }.compact ) end |
#delete_agent(agent_id:, location_id: nil, **_opts) ⇒ Object
Delete Agent
Delete a voice AI agent and all its configurations
61 62 63 64 65 66 67 68 |
# File 'lib/high_level/resources/voice_ai.rb', line 61 def delete_agent(agent_id:, location_id: nil, **_opts) request( method: :delete, path: "/voice-ai/agents/#{agent_id}", security: ["bearer"], params: { "locationId" => location_id }.compact ) end |
#get_action(action_id:, location_id: nil, **_opts) ⇒ Object
Get Agent Action
Retrieve details of a specific action by its ID. Returns the action configuration including actionParameters.
109 110 111 112 113 114 115 116 |
# File 'lib/high_level/resources/voice_ai.rb', line 109 def get_action(action_id:, location_id: nil, **_opts) request( method: :get, path: "/voice-ai/actions/#{action_id}", security: ["bearer"], params: { "locationId" => location_id }.compact ) end |
#get_agent(agent_id:, location_id: nil, **_opts) ⇒ Object
Get Agent
Retrieve detailed configuration and settings for a specific voice AI agent
36 37 38 39 40 41 42 43 |
# File 'lib/high_level/resources/voice_ai.rb', line 36 def get_agent(agent_id:, location_id: nil, **_opts) request( method: :get, path: "/voice-ai/agents/#{agent_id}", security: ["bearer"], params: { "locationId" => location_id }.compact ) end |
#get_agents(page: nil, page_size: nil, location_id: nil, query: nil, **_opts) ⇒ Object
List Agents
Retrieve a paginated list of agents for given location.
12 13 14 15 16 17 18 19 |
# File 'lib/high_level/resources/voice_ai.rb', line 12 def get_agents(page: nil, page_size: nil, location_id: nil, query: nil, **_opts) request( method: :get, path: "/voice-ai/agents", security: ["bearer"], params: { "page" => page, "pageSize" => page_size, "locationId" => location_id, "query" => query }.compact ) end |
#get_call_log(call_id:, location_id: nil, **_opts) ⇒ Object
Get Call Log
Returns a call log by callId.
85 86 87 88 89 90 91 92 |
# File 'lib/high_level/resources/voice_ai.rb', line 85 def get_call_log(call_id:, location_id: nil, **_opts) request( method: :get, path: "/voice-ai/dashboard/call-logs/#{call_id}", security: ["bearer"], params: { "locationId" => location_id }.compact ) end |
#get_call_logs(location_id: nil, agent_id: nil, contact_id: nil, call_type: nil, start_date: nil, end_date: nil, action_type: nil, sort_by: nil, sort: nil, page: nil, page_size: nil, **_opts) ⇒ Object
List Call Logs
Returns call logs for Voice AI agents scoped to a location. Supports filtering by agent, contact, call type, action types, and date range (interpreted in the provided IANA timezone). Also supports sorting and 1-based pagination.
73 74 75 76 77 78 79 80 |
# File 'lib/high_level/resources/voice_ai.rb', line 73 def get_call_logs(location_id: nil, agent_id: nil, contact_id: nil, call_type: nil, start_date: nil, end_date: nil, action_type: nil, sort_by: nil, sort: nil, page: nil, page_size: nil, **_opts) request( method: :get, path: "/voice-ai/dashboard/call-logs", security: ["bearer"], params: { "locationId" => location_id, "agentId" => agent_id, "contactId" => contact_id, "callType" => call_type, "startDate" => start_date, "endDate" => end_date, "actionType" => action_type, "sortBy" => sort_by, "sort" => sort, "page" => page, "pageSize" => page_size }.compact ) end |
#patch_agent(agent_id:, body:, location_id: nil, **_opts) ⇒ Object
Patch Agent
Partially update an existing voice AI agent
48 49 50 51 52 53 54 55 56 |
# File 'lib/high_level/resources/voice_ai.rb', line 48 def patch_agent(agent_id:, body:, location_id: nil, **_opts) request( method: :patch, path: "/voice-ai/agents/#{agent_id}", security: ["bearer"], params: { "locationId" => location_id }.compact, body: body ) end |
#update_action(action_id:, body:, **_opts) ⇒ Object
Update Agent Action
Update an existing action for a voice AI agent. Modifies the behavior and configuration of an agent action.
121 122 123 124 125 126 127 128 |
# File 'lib/high_level/resources/voice_ai.rb', line 121 def update_action(action_id:, body:, **_opts) request( method: :put, path: "/voice-ai/actions/#{action_id}", security: ["bearer"], body: body ) end |