Get started →
Documentation

Quickstart

Make your first call with Ruut Voice in under five minutes. You'll need a carrier account with an available phone number and API credentials.

1. Get your credentials

Log in to the dashboard, open the Account Settings page for your carrier, and copy the Account SID and Auth Token. These authenticate every API request.

Treat your Auth Token like a password. Never commit it to source control or expose it in client-side code. Use the server SDK or scoped API keys for production.

2. Install the SDK

Ruut Voice ships a typed TypeScript SDK with a server client and a browser softphone. Or use plain curl — the REST API is standard.

Installbash
npm install @ruut/voice-sdk
client.tsts
import { RuutVoice } from "@ruut/voice-sdk";

const client = new RuutVoice({
  accountSid: process.env.RUUT_ACCOUNT_SID,
  authToken: process.env.RUUT_AUTH_TOKEN,
  baseUrl: "https://voice.ruut.chat",
});

3. Make your first call

Create an outbound call with inline TwiML. The call answers and reads a greeting:

call.tsts
import { VoiceResponse } from "@ruut/voice-sdk";

const twiml = new VoiceResponse()
  .say("Hello from Ruut Voice!")
  .toXml();

const call = await client.calls.create({
  to: "+2348000000001",
  from: "+2348000000002",
  twiml,
  statusCallback: "https://app.example.com/calls/status",
});

console.log(call.sid, call.status); // CA… queued

The same request with curl:

curlbash
curl -X POST "https://voice.ruut.chat/2010-04-01/Accounts/$RUUT_ACCOUNT_SID/Calls" \
  -u "$RUUT_ACCOUNT_SID:$RUUT_AUTH_TOKEN" \
  --data-urlencode "To=+2348000000001" \
  --data-urlencode "From=+2348000000002" \
  --data-urlencode "Twiml=Hello from Ruut Voice!"

4. Receive an inbound call

Buy a number in the dashboard and set its Voice URL to an endpoint on your server that returns TwiML. When someone calls the number, Ruut Voice fetches that URL and executes the returned TwiML:

GET /twiml/helloxml

  Thanks for calling Ruut Voice!

Build the same response with the SDK:

twiml.tsts
import { VoiceResponse } from "@ruut/voice-sdk";

const response = new VoiceResponse()
  .say("Thanks for calling Ruut Voice!", { voice: "alice" })
  .toXml();

5. Receive status callbacks

Every call can push status updates to your server. Set statusCallback on the call (or on the incoming number) and verify the signature before trusting it:

webhooks.tsts
import { parseWebhook, validateWebhookSignature } from "@ruut/voice-sdk";

const valid = await validateWebhookSignature({
  url: "https://app.example.com/calls/status",
  params: req.body,
  signature: req.headers["x-twilio-signature"],
  authToken: process.env.RUUT_AUTH_TOKEN,
});

if (!valid) return res.status(403).end();

const payload = parseWebhook(req.body);
if (payload.CallStatus === "completed") {
  console.log("Call", payload.CallSid, "completed");
}

Next steps