Account-level client for Guava's HTTP API.
Handles authentication, phone numbers, SMS, outbound-call creation, and
agent-code provisioning. Realtime call handling is done via Guava.Agent.
Authentication
# Explicit key
client = Guava.Client.new(api_key: "gva-...")
# From the GUAVA_API_KEY env var, a deploy token, or a CLI session
{:ok, client} = Guava.Client.new()
Summary
Functions
Check whether this SDK version is deprecated. Returns the server's
deprecation_status string (e.g. "supported").
Low-level helper: create an outbound call and return its call_id without
attaching an agent. Most code should instead place the call and run an agent
on it in one step, with Guava.run/1 and a Guava.Channel outbound listener
Create a SIP agent code.
Create a WebRTC agent code for browser connectivity. ttl_seconds optionally
sets an expiry.
Return the resolved HTTP base URL for path.
List the phone numbers on your account.
Build a client, returning {:ok, client} | {:error, %Guava.Error{}}.
Like new/1, but raises Guava.Error when credentials can't be resolved.
Wait for and return the next inbound SMS from from_number to to_number.
Send an outbound SMS.
Return the resolved WebSocket URL for path.
Types
@type result(x) :: {:ok, x} | {:error, Guava.Error.t()}
@type t() :: %Guava.Client{ auth: Guava.Auth.t(), base_url: String.t(), req_options: keyword() }
Functions
Check whether this SDK version is deprecated. Returns the server's
deprecation_status string (e.g. "supported").
Low-level helper: create an outbound call and return its call_id without
attaching an agent. Most code should instead place the call and run an agent
on it in one step, with Guava.run/1 and a Guava.Channel outbound listener:
Guava.run({Guava.Channel, agent: MyAgent, outbound: {from, to, %{}}})
Create a SIP agent code.
@spec create_webrtc_agent(t(), pos_integer() | nil) :: result(String.t())
Create a WebRTC agent code for browser connectivity. ttl_seconds optionally
sets an expiry.
@spec create_webrtc_agent!(t(), pos_integer() | nil) :: String.t()
Return the resolved HTTP base URL for path.
@spec list_numbers(t()) :: result([Guava.PhoneNumberInfo.t()])
List the phone numbers on your account.
@spec list_numbers!(t()) :: [Guava.PhoneNumberInfo.t()]
Build a client, returning {:ok, client} | {:error, %Guava.Error{}}.
Options
:api_key— explicit API key. Falls back toconfig :guava, api_key:, the deploy token file, theGUAVA_API_KEYenv var, then a CLI session.:base_url— override the API base URL.:req_options— extraReqoptions merged into every request (mainly for testing, e.g.plug:).
Like new/1, but raises Guava.Error when credentials can't be resolved.
Wait for and return the next inbound SMS from from_number to to_number.
Polls the inbox for messages received after this call begins, blocking until
one arrives or :timeout elapses. Returns {:ok, message | nil} (nil on
timeout) or {:error, %Guava.Error{}}.
Options
:timeout— max seconds to wait (default60.0).:poll_interval— seconds between polls (default2.0).
Send an outbound SMS.
Return the resolved WebSocket URL for path.