Skip to content

Why we built voice

We've been running phone calls in beta since September. The version we launched this week isn't the one we built first. Here's why.

A rotary telephone and a smartphone on a call, wired to a card reading POST /v3/voice

For most of its life, Sent has been a messaging company: SMS, WhatsApp and RCS behind one API, one send call, and a router that picks whichever channel actually reaches the recipient.

This fall we shipped phone calls in beta, and about a month later we rebuilt it. Here's why we did both.

Conversations don't stay in one channel

Watch how people talk to a business. They get a text about an appointment. Something comes up, so they call, because calling is faster. After the call they want something in writing for confirmation. The call is the part of the conversation where the stakes are highest and the patience is lowest.

A message thread with a patient: she asks to move tomorrow's dental appointment, gets a link to call, an agent answers and moves it to Friday at 10, and a text confirms the new time

If your platform only covers texting, your customer finds a second vendor for calls. That involves a second key, a second record, a second bill, and more code to join the two.

We already believed this about messaging. Sent exists because businesses shouldn't need to care about whether a message went over SMS, WhatsApp, or RCS - only that it arrived. Voice is the same argument, one channel wider.

Agents made it more urgent

An agent that can text a customer but can't answer when the customer calls back only does half its job.

A lot of small work still lives on the phone, like moving an appointment, and it's too small to staff after hours and too annoying to put behind a menu. It's a great first job for an agent.

We wanted people to give their agents a phone line without knowing how phone calls work.

Version one

What we shipped at the end of September was programmable calling in the form most developers already recognize. A call comes in, Sent asks your server what to do, your server answers: play a greeting, collect keypad input, ring someone, hold, record, start a conference.

We shipped client SDKs for the browser, iOS, and Android so you could place and receive calls from inside your own app.

It worked, and customers built real call flows on it. It's still the right tool for menus, routing calls to people, and in-app calling.

Then we tried to put an agent on it

…and that's where it stopped fitting. Version one answers "what should happen on this call" one step at a time, but a conversation doesn't happen in steps. It's two streams running at once, and both have to be handled live.

To hold anything resembling a natural exchange, you have to recognize speech, decide whether the caller finished or just paused, generate a reply, turn it into speech, and cut it off the instant they interrupt - all fast enough that the pause doesn't feel broken. Every team building an agent would have to build that before touching what they actually set out to do.

We had drawn the line in the wrong place for this kind of call. People got the phone line, but the audio (which was the hard part) stayed on their side.

Version two

We moved the line. Route a number to an agent and Sent owns the phone number, listens to the caller, turns speech into text, speaks the replies in a voice you choose, and carries out actions on the call: transfer, hold, keypad tones, hang up.

Your agent is a program you run. It holds one WebSocket to Sent. When the caller says something, your agent receives text. When it wants to speak, it sends text back. You don’t need to handle any audio or speech stacks.

The "brain" can be any model you like, or plain code with no model at all.

Diagram: the caller calls your number, Sent picks up and exchanges text with your agent over a WebSocket, and sends call events to your app as webhooks

This shape isn’t unique to us, and we didn’t expect it to be. But a few decisions came straight out of thinking about what goes wrong on a live call:

  • What it says is up to the model, but what it does is up to you. You decide which actions an agent can take (transfer, hold, keypad tones, hang up). If the model tries one that isn’t on the list, Sent refuses.
  • There is always a fallback. If your process is down or dies mid-call, the call goes to a number you chose instead of failing. A customer calling your business should never hear silence because a deploy went wrong.
  • Limits live on the agent. Longest call and calls at once are set once, and Sent holds the line on them.

We also wrote the protocol down before we wrote any SDKs. It's a public spec with a public conformance suite, and the Python, TypeScript, .NET, Go, Rust, and Java SDKs all pass the same scenarios before they ship.

Why build it twice

It would have been tidier to wait and only ship version two, but we only found out where the line belonged by building on version one ourselves and feeling where it hurt. That’s how we prefer to work in general.

When the agent path went live, I spent an evening as their first customer and built an after-hours line for a made-up dental clinic (gist here). It moves appointments, puts emergencies through to the dentist on call, and texts the caller a confirmation. Two real phone calls turned up two bugs my tests hadn't.

One conversation

When the agent moved an appointment, the confirmation text was one more request to the same API, with the same key, from the same process that was already on the phone. It followed the same template rules as every other first message we send, and afterwards the call sat in Activities right next to the text it triggered.

A business has one conversation with each customer, and that conversation should live in one place, no matter which channels the customer had it on. That’s the reason why we built voice.

Live now

Our Voice API is live: placing and answering calls, in-app calling, and routing calls to an agent. Numbers are US local numbers for now and calls are switched on per account. Talk to us if you want it turned on: support@sent.dm.

Our docs cover the voice SDKs (browser, iOS, Android) and agent SDKs.

Give your phone number a small, boring job first to try it out. The call nobody picks up at 6:40 in the evening is a good one.

Share

Published on

Read More

One API. Every channel.