Skip to main content

Telephony

Call control plus the SMS, service-number, and conference resources (v2 manager API). Call reporting has its own guide; this page covers the live/operational surface.

Call control

mgr.calls / mgr.Calls / mgr.calls — fetch a call, hang it up, create an inbound test call, and set call session variables.

const { item: call } = await mgr.calls.get(callId);
await mgr.calls.hangup(callId);
const test = await mgr.calls.createTestCall({ /* CreateTestCall */ });
await mgr.calls.setSessionVariables(callId, { variables: { "app.customerId": "abc-123" } });
note

Session-variable keys must be prefixed with app. to take effect — keys without it are ignored by the API.

Cancel & queue calls

Cancel a call, list the calls currently waiting in a queue, or request a callback for a queued caller.

await mgr.calls.cancel(callId);
for await (const q of mgr.calls.listQueued(queueId)) console.log(q.id);
await mgr.calls.queueCallback(queueId, { /* QueueCallbackRequest */ });

SMS

mgr.sms / mgr.Sms / mgr.sms — list (auto-paginated) and fetch SMS records.

for await (const sms of mgr.sms.list()) console.log(sms.id);
const { item } = await mgr.sms.get(smsId);

Send, delete & reporting

Send an outbound SMS, simulate an inbound one (testInbound), delete a record, or page the SMS reporting stream.

const sent = await mgr.sms.send({ /* SmsSendRequest */ });
await mgr.sms.testInbound({ /* SmsSendRequest */ });
await mgr.sms.delete(sent.item.id);
for await (const sms of mgr.sms.report()) console.log(sms.id);

Service numbers

mgr.numbers / mgr.Numbers / mgr.numbers — list, fetch, and update service (phone) numbers, and add tags.

const all = await mgr.numbers.listAll();
const { item } = await mgr.numbers.get(numberId);
await mgr.numbers.addTags(numberId, ["vip", "sales"]);
await mgr.numbers.update(numberId, { /* service-number fields */ });

Conferences

mgr.conferences / mgr.Conferences / mgr.conferences — list and fetch conferences.

for await (const conf of mgr.conferences.list()) console.log(conf.id);
const { item } = await mgr.conferences.get(conferenceId);

Reference