HCC Docs

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, 409 rep_offline or 409 rep_busy;
    • the number: 400 invalid_number (/v1 rejects a malformed to as validation_failed);
    • the caller ID: 422 caller_id_not_owned or 422 no_caller_id;
    • the list: 422 do_not_call;
    • the softphone: 409 conflict, when it isn't set up yet.
  • Outcome. call.outcome and call.completed carry it:
    • completed;
    • rep_unavailable: the rep didn't answer within 20 s, and the customer was never dialed;
    • busy, no_answer or failed: 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 live list. A rep's do_not_call disposition adds the number (source disposition). The dashboard sets which dispositions do that. A lead with a listed number doesn't go in a campaign.
  • Events. call.initiated, call.answered and call.completed carry repId and context.