Class: Revox::Resources::Call

Inherits:
Object
  • Object
show all
Defined in:
lib/revox/resources/call.rb,
sig/revox/resources/call.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Call

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Call.

Parameters:



223
224
225
# File 'lib/revox/resources/call.rb', line 223

def initialize(client:)
  @client = client
end

Instance Method Details

#cancel(id, request_options: {}) ⇒ Revox::Models::CallCancelResponse

Cancel a running or scheduled call.

Parameters:

Returns:

See Also:



85
86
87
88
89
90
91
92
# File 'lib/revox/resources/call.rb', line 85

def cancel(id, params = {})
  @client.request(
    method: :post,
    path: ["call/%1$s/cancel", id],
    model: Revox::Models::CallCancelResponse,
    options: params[:request_options]
  )
end

#create(phone_number:, assistant: nil, assistant_id: nil, concurrency: nil, force_now: nil, from_phone_number: nil, metadata: nil, prompt_variables: nil, scheduled_at: nil, request_options: {}) ⇒ Revox::Models::CallCreateResponse

Some parameter documentations has been truncated, see Models::CallCreateParams for more details.

Place a new outbound call order. Provide either an existing assistant ID or a custom assistant configuration. The call can be scheduled for a specific time or started immediately. A single call order may be resolved over multiple call attempts spanning up to a few days, with automatic retries when voicemail is detected. You can also set concurrency limits and pass prompt variables for dynamic personalization.

Parameters:

  • phone_number (String)

    The phone number to call in the E.164 format. Example: +1234567890

  • assistant (Revox::Models::CallCreateParams::Assistant)

    You can provide a custom assistant configuration here. If you don't provide an a

  • assistant_id (String)

    The ID of the assistant to use for this call.

  • concurrency (Revox::Models::CallCreateParams::Concurrency)

    Limit the number of concurrent calls for a given concurrency key.

  • force_now (Boolean)

    The prompt to use for the call. This will be given to the LLM (gpt-4.1)

  • from_phone_number (String)

    The phone number to use for making the call (e.g., +1234567890). If not provided

  • metadata (Hash{Symbol=>String})

    Metadata to store with the call.

  • prompt_variables (Hash{Symbol=>String})

    Variables to interpolate into the prompt. Wether you use an assistant_id or an a

  • scheduled_at (Time, Object)

    Schedule the call to start at a specific date and time (ISO 8601 format). If not

  • request_options (Revox::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



41
42
43
44
45
46
47
48
49
50
# File 'lib/revox/resources/call.rb', line 41

def create(params)
  parsed, options = Revox::CallCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "call",
    body: parsed,
    model: Revox::Models::CallCreateResponse,
    options: options
  )
end

#export(filters:, include_metadata: nil, include_structured_output_fields: nil, request_options: {}) ⇒ Revox::Models::CallExportResponse

Some parameter documentations has been truncated, see Models::CallExportParams for more details.

Export a list of call attempts as a CSV file.

Parameters:

  • filters (Revox::Models::CallExportParams::Filters)
  • include_metadata (Boolean)

    Whether to include the metadata in the CSV file. These are the fields you (optio

  • include_structured_output_fields (Boolean)

    Whether to include the structured output fields in the CSV file. These are gener

  • request_options (Revox::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



112
113
114
115
116
117
118
119
120
121
# File 'lib/revox/resources/call.rb', line 112

def export(params)
  parsed, options = Revox::CallExportParams.dump_request(params)
  @client.request(
    method: :post,
    path: "call/export",
    body: parsed,
    model: Revox::Models::CallExportResponse,
    options: options
  )
end

#pause(id, request_options: {}) ⇒ Revox::Models::CallPauseResponse

Pause a call's retry loop. The current in-progress attempt (if any) will finish, but no new attempts will be started until the call is resumed.

Parameters:

Returns:

See Also:



134
135
136
137
138
139
140
141
# File 'lib/revox/resources/call.rb', line 134

def pause(id, params = {})
  @client.request(
    method: :post,
    path: ["call/%1$s/pause", id],
    model: Revox::Models::CallPauseResponse,
    options: params[:request_options]
  )
end

#phone_history(request_options: {}) ⇒ Revox::Models::CallPhoneHistoryResponse

Returns a map of phone numbers to the number of calls and associated campaigns across the entire organization. Useful for detecting contacts that have already been reached.

Parameters:

Returns:

See Also:



154
155
156
157
158
159
160
161
# File 'lib/revox/resources/call.rb', line 154

def phone_history(params = {})
  @client.request(
    method: :get,
    path: "calls/phone-history",
    model: Revox::Models::CallPhoneHistoryResponse,
    options: params[:request_options]
  )
end

#resume(id, request_options: {}) ⇒ Revox::Models::CallResumeResponse

Resume a previously paused call. The retry loop will continue from where it left off.

Parameters:

Returns:

See Also:



174
175
176
177
178
179
180
181
# File 'lib/revox/resources/call.rb', line 174

def resume(id, params = {})
  @client.request(
    method: :post,
    path: ["call/%1$s/resume", id],
    model: Revox::Models::CallResumeResponse,
    options: params[:request_options]
  )
end

#retrieve(id, request_options: {}) ⇒ Revox::Models::CallRetrieveResponse

Retrieve the full details of a call order by its unique ID. The response includes the call status, call attempts, transcript, recording URL, timestamps, and metadata. Use this endpoint to poll for call completion or inspect results after a call has finished.

Parameters:

  • id (String)

    The ID of the call to get.

  • request_options (Revox::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



66
67
68
69
70
71
72
73
# File 'lib/revox/resources/call.rb', line 66

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["call/%1$s", id],
    model: Revox::Models::CallRetrieveResponse,
    options: params[:request_options]
  )
end

#search(assignee_ids:, assistant_ids:, campaign_ids:, directions:, from_phone_numbers:, outcomes:, page:, page_size:, results:, statuses:, call_ids: nil, query: nil, sort_by: nil, sort_direction: nil, to_phone_number: nil, request_options: {}) ⇒ Revox::Models::CallSearchResponse

Retrieve a paginated list of call attempts. Each entry includes the call status, phone number, assistant used, transcript, and timestamps. Use the page and page_size query parameters to navigate through results.

Parameters:

Returns:

See Also:



209
210
211
212
213
214
215
216
217
218
# File 'lib/revox/resources/call.rb', line 209

def search(params)
  parsed, options = Revox::CallSearchParams.dump_request(params)
  @client.request(
    method: :post,
    path: "call/search",
    body: parsed,
    model: Revox::Models::CallSearchResponse,
    options: options
  )
end