Outbound for reps
Click-to-call: place a call for a rep from your CRM. The rep's desk softphone rings first, and the customer is dialed once the rep answers. Reps dial from the desk's dialer too.
const call = await hcc.reps.dial('rep_123', {
to: '+14155550123',
from: '+14155550100', // optional: the rep's caller ID, the workspace's, or the first number
context: { leadId: 'l_1' }, // up to 4 KB, on the call and its events
});
// or: hcc.calls.create({ to, repId: 'rep_123', from?, context? })
await hcc.reps.update('rep_123', { defaultCallerId: '+14155550100' });
await hcc.dnc.add('+14155550123', { reason: 'asked to stop' });
await hcc.dnc.check('+14155550123'); // the entry, or null
await hcc.dnc.remove('+14155550123');
for await (const n of hcc.dnc.list()) console.log(n.e164, n.source);- Refusals. The checks run in this order, before anything rings, and every attempt is audited:
- the rep: 404
not_found, 409rep_offlineor 409rep_busy; - the number: 400
invalid_number(/v1rejects a malformedtoasvalidation_failed); - the caller ID: 422
caller_id_not_ownedor 422no_caller_id; - the list: 422
do_not_call; - the softphone: 409
conflict, when it isn't set up yet.
- the rep: 404
- Outcome.
call.outcomeandcall.completedcarry it:completed;rep_unavailable: the rep didn't answer within 20 s, and the customer was never dialed;busy,no_answerorfailed: from the customer leg;cancelled: the rep hung up while the customer rang.
- Wrap-up. A rep who was on the call goes to wrap-up (30 s by default, set in the dashboard). A rep who never answered gets their old state back.
- Do Not Call list. It is per API key environment. The desk uses the
livelist. A rep'sdo_not_calldisposition adds the number (sourcedisposition). The dashboard sets which dispositions do that. A lead with a listed number doesn't go in a campaign. - Events.
call.initiated,call.answeredandcall.completedcarryrepIdandcontext.