Skip to navigation

Sales calls in three steps

Add calling to your own app. A key, one server route file, and the phone on your page.

Sales calls let the people using your app call prospects from the browser while Rydhm listens: it writes down both sides, suggests what to ask next, leaves voicemails and writes up every call.

Before you start, in the Rydhm app under Sales calls → Numbers, switch on Use for sales calls for the number your calls come from (or get one). That’s the only setup. You don’t add reps: the person signed in to your app becomes one the first time their phone starts.

Building an app other teams connect to, like a CRM? Give them a Connect Rydhm button instead of a key. See Connect Rydhm.

1

Get a key

In Developers → Sales calls, click Create a key for sales calls (it has calls:read and calls:write). Put it on your server as RYDHM_API_KEY. Never in a web page.

2

Add two routes to your server

One route gives the signed-in person their phone. The other starts a call.

3

Add the phone to your page

@rydhm/web does the microphone, the ringing and the live suggestions. You draw the buttons.

Step 2: your server

server.ts
import { Rydhm } from "@rydhm/sdk";
const rydhm = new Rydhm(); // RYDHM_API_KEY
// The signed-in person's phone. The first time, Rydhm adds them as a rep (by your user id).
app.post("/api/rydhm/phone", requireUser, async (req, res) => {
res.json(await rydhm.reps.softphoneToken(req.user.id, { name: req.user.name }));
});
// Start a call from that phone. Rydhm picks your number for sales calls.
app.post("/api/rydhm/call", requireUser, async (req, res) => {
res.json(await rydhm.repCalls.create({ rep: req.user.id, to: req.body.to, suggestions: true }));
});

rep can also be { "id": "usr_42", "name": "Asha Patel" }: the rep is added (or their name updated) with the call itself. Send an Idempotency-Key header (your activity id) on POST /v1/rep-calls so a retry never dials twice.

Step 3: your page

page.ts
import { Softphone } from "@rydhm/web";
const post = (url: string, body?: unknown) =>
fetch(url, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(body) })
.then((r) => r.json());
const getToken = () => post("/api/rydhm/phone");
const phone = new Softphone({ token: await getToken(), refreshToken: getToken });
callButton.onclick = async () => phone.join(await post("/api/rydhm/call", { to: prospect.phone }));
phone.on("suggestion", (s) => showTip(s.text)); // what to ask next

That’s a working dialer. While the page is open, a prospect calling back rings it (phone.on("incoming", …)). See Browser softphone.

When something is missing

The API says what to fix in plain words:

ErrorWhat it means
no_number (400)No number is switched on for sales calls yet. Choose one in Sales calls → Numbers.
pool_exhausted (429)Every number for sales calls made its calls for today (80 each by default, so carriers don’t mark them as spam). Add a number, or raise the daily limit under Numbers → Advanced.
rep_not_found (404)You started a call for someone whose phone never started. Send rep as { id, name }, or name with the softphone token.
outside_calling_hours (400)It’s before 8 am or after 9 pm where the prospect is. retryAt says when you may call.

More

  • Voicemail and hang up: when a machine answers, Rydhm can leave the voicemail for the person (POST /v1/rep-calls/{id}/voicemail). See AI voicemail.
  • Call updates: a webhook for call.completed and call.summary.ready, or one live stream per person. See Rep calls and Webhooks.
  • Call records: GET /v1/rep-calls/{id} and GET /v1/rep-calls/{id}/transcript once a call ends. See Rep calls.