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:



78
79
80
# File 'lib/revox/resources/call.rb', line 78

def initialize(client:)
  @client = client
end

Instance Method Details

#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

#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