☎️ Click2Call — документация для разработчиков

← Закрыть OpenAPI JSON

Click2Call developer guide

Click2Call puts Callston calling inside your web app (a CRM, a helpdesk, a back office). Your employees make and receive phone calls from your pages, and a call keeps going while they move between pages.

How it works

There are three pieces. You build two small things: two backend endpoints and a few lines on your pages.

PieceWhere it runsWhat it does
The widgetyour pages (one script tag)Shows the call controls: ready state, the current call, timer, Answer/Decline, mute, keypad, hang up.
Your backendyour serverSigns in the widget for the employee who is logged in, and asks Callston to call a contact. Holds the secret server key.
The call windowa Callston window (or tab, panel, or browser extension)Holds the microphone and the call. The employee opens it once with Enable calls. Reloading or leaving your pages never drops a call.

A call, step by step:

  1. The employee clicks Call next to a contact on your page.
  2. The widget asks your backend to call that contact. It sends only your contact reference, never a phone number.
  3. Your backend looks up the number in your database and sends it to Callston, together with the employee.
  4. Callston checks everything, then the employee's call window places the call.
  5. The widget shows the call (Dialing…, Connected, timer) and its controls.

Phone numbers go from your server to Callston directly. When the integration hides numbers, the employee's browser never receives them.

Quick start

Step 1 — Create an integration in Callston

  1. Open Click2Call in your Callston dashboard (for a business: Business → Click2Call).
  2. Click New integration. Copy the integration id (c2c_…) and the server key (c2ck_…). The server key is shown only once: keep it in your backend's secret store, never in a web page.
  3. Under Allowed origins, add the address of your app exactly as the browser shows it: scheme + host + port, no path. Example: https://crm.example.com. Tip: open your app, run location.origin in the browser console and copy the result.
  4. Choose how you name employees (Agent identifier): their Callston login email, or a UUID.

While you build and test, you can tick Allow all origins (for testing). Switch it off and list your exact origins before going live.

Step 2 — Add a session endpoint to your backend

The widget calls this endpoint on every page load. Your endpoint checks who is logged in, then asks Callston for a widget token for that employee.

The widget sends your endpoint: { "integration_id": "c2c_…", "origin": "https://crm.example.com", "sdk": "1.1.3" }

Your endpoint sends Callston:

POST https://callston.com/api/v1/click2call/sessions
Authorization: Bearer c2ck_…
Content-Type: application/json

{ "integration_id": "c2c_…",
  "agent": { "type": "email", "value": "[email protected]" },
  "origin": "https://crm.example.com" }

Use the origin the widget sent you, not a fixed value. Then return Callston's answer to the widget unchanged (status code and JSON).

Step 3 — Add a call endpoint to your backend

The widget calls this endpoint when the employee clicks a call button. It sends what your page gave it, for example { "integration_id": "c2c_…", "contact_reference": "crm-8842" }. Your endpoint finds the contact's number and sends Callston:

POST https://callston.com/api/v1/click2call/calls
Authorization: Bearer c2ck_…
Idempotency-Key: crm-8842-1727612345
Content-Type: application/json

{ "integration_id": "c2c_…",
  "agent": { "type": "email", "value": "[email protected]" },
  "phone_number": "+14155550101",
  "contact_reference": "crm-8842",
  "display_name": "Alice Johnson" }

Again, return Callston's answer unchanged. The widget shows a refusal at once (for example the call window is not open). If your endpoint always answers "OK", the widget cannot tell the employee what went wrong.

Step 4 — Put the widget on your pages

Add this to the layout that every page uses:

<script src="https://callston.com/assets/js/click2call-sdk.js"></script>
<script>
  var widget = CallstonClick2Call.init({
    integrationId: 'c2c_…',
    sessionEndpoint: '/callston/session',   // your endpoint from step 2
    requestCallEndpoint: '/callston/call'   // your endpoint from step 3
  });
</script>

Then wire your call buttons:

<button onclick="widget.requestCall({ contact_reference: 'crm-8842' })">Call Alice</button>

The widget has its own Enable calls button. If you want your own, call widget.enableCalls() directly inside the click handler: browsers open the call window only from a click.

Step 5 — Try it

  1. Open your app over HTTPS (or http://localhost) and log in as an employee who is a member of the integration.
  2. Click Enable calls. The call window opens: allow the microphone. The widget shows Ready.
  3. Click your Call button. The widget shows Dialing…, then Connected.

Something does not work? See Troubleshooting at the end of this page: the widget shows a reason code, and the table says what to fix.

Complete backend examples

Both examples have the same two endpoints. They expect your own login (currentUser) and your own contacts lookup.

Node.js (Express, Node 18+)

const express = require('express');
const app = express();
app.use(express.json());

const CALLSTON = 'https://callston.com';
const SERVER_KEY = process.env.CALLSTON_SERVER_KEY;          // c2ck_…
const INTEGRATION_ID = process.env.CALLSTON_INTEGRATION_ID;  // c2c_…

async function callston(path, body, extraHeaders = {}) {
  const res = await fetch(CALLSTON + path, {
    method: 'POST',
    headers: { Authorization: 'Bearer ' + SERVER_KEY, 'Content-Type': 'application/json', ...extraHeaders },
    body: JSON.stringify(body),
  });
  return { status: res.status, body: await res.json() };
}

// Step 2: a widget token for the employee who is logged in
app.post('/callston/session', async (req, res) => {
  const user = currentUser(req);                      // your login check
  if (!user) return res.status(401).json({ ok: false, error: 'not_logged_in' });
  const r = await callston('/api/v1/click2call/sessions', {
    integration_id: INTEGRATION_ID,
    agent: { type: 'email', value: user.email },
    origin: req.body.origin,                          // as the widget sent it
  });
  res.status(r.status).json(r.body);                  // unchanged
});

// Step 3: call a contact; the number stays on your server
app.post('/callston/call', async (req, res) => {
  const user = currentUser(req);
  if (!user) return res.status(401).json({ ok: false, error: 'not_logged_in' });
  const contact = await findContact(req.body.contact_reference);   // your database
  if (!contact) return res.status(404).json({ ok: false, error: 'contact_not_found' });
  const r = await callston('/api/v1/click2call/calls', {
    integration_id: INTEGRATION_ID,
    agent: { type: 'email', value: user.email },
    phone_number: contact.phone,                      // E.164, e.g. +14155550101
    contact_reference: String(contact.id),
    display_name: contact.name,
  }, {
    // The same key within 10 seconds = the same call (a double click starts one call)
    'Idempotency-Key': 'call-' + contact.id + '-' + Math.floor(Date.now() / 10000),
  });
  res.status(r.status).json(r.body);                  // unchanged
});

PHP

<?php
const CALLSTON_URL = 'https://callston.com';
define('CALLSTON_SERVER_KEY', getenv('CALLSTON_SERVER_KEY'));         // c2ck_…
define('CALLSTON_INTEGRATION_ID', getenv('CALLSTON_INTEGRATION_ID')); // c2c_…

/** POST to Callston; returns [HTTP status, raw JSON]. */
function callston(string $path, array $body, array $headers = []): array
{
    $ch = curl_init(CALLSTON_URL . $path);
    $h = ['Authorization: Bearer ' . CALLSTON_SERVER_KEY, 'Content-Type: application/json'];
    foreach ($headers as $k => $v) {
        $h[] = "$k: $v";
    }
    curl_setopt_array($ch, [
        CURLOPT_POST => true, CURLOPT_HTTPHEADER => $h, CURLOPT_RETURNTRANSFER => true,
        CURLOPT_POSTFIELDS => json_encode($body), CURLOPT_TIMEOUT => 15,
    ]);
    $raw = curl_exec($ch);
    $status = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE);
    return $raw === false ? [502, '{"ok":false,"error":"unreachable"}'] : [$status, $raw];
}

function reply(array $r): void
{
    http_response_code($r[0]);
    header('Content-Type: application/json');
    echo $r[1];                                    // Callston's answer, unchanged
}

$in = json_decode(file_get_contents('php://input'), true) ?: [];
$user = current_user();                            // your login check
if (!$user) {
    reply([401, '{"ok":false,"error":"not_logged_in"}']);
    exit;
}

// Step 2 — /callston/session
if ($_SERVER['REQUEST_URI'] === '/callston/session') {
    reply(callston('/api/v1/click2call/sessions', [
        'integration_id' => CALLSTON_INTEGRATION_ID,
        'agent'          => ['type' => 'email', 'value' => $user->email],
        'origin'         => $in['origin'] ?? '',   // as the widget sent it
    ]));
}

// Step 3 — /callston/call
if ($_SERVER['REQUEST_URI'] === '/callston/call') {
    $contact = find_contact($in['contact_reference'] ?? '');   // your database
    if (!$contact) {
        reply([404, '{"ok":false,"error":"contact_not_found"}']);
        exit;
    }
    reply(callston('/api/v1/click2call/calls', [
        'integration_id'    => CALLSTON_INTEGRATION_ID,
        'agent'             => ['type' => 'email', 'value' => $user->email],
        'phone_number'      => $contact->phone,            // E.164
        'contact_reference' => (string) $contact->id,
        'display_name'      => $contact->name,
    ], ['Idempotency-Key' => 'call-' . $contact->id . '-' . intdiv(time(), 10)]));
}

cURL (to test your server key)

curl -X POST https://callston.com/api/v1/click2call/sessions \
  -H "Authorization: Bearer $CALLSTON_SERVER_KEY" -H "Content-Type: application/json" \
  -d '{"integration_id":"c2c_…","agent":{"type":"email","value":"[email protected]"},"origin":"https://crm.example.com"}'

Limits

These are the limits of this installation right now.

WhatLimit
Integrations per account (or per business)10
Calls at the same time, per integration (all its agents together, call requests still waiting for a call window included)new integrations start at 30; you can set up to 500
Calls at the same time, per agent1 (a call request still waiting for the agent's call window counts)
Longest callnew integrations start at 60 minutes; you can set up to 120 minutes
A call request waits for the agent's call window60 seconds, then it expires
Widget token30 minutes, renewed by the widget automatically
Requests with the server key300 per minute per IP address, 600 per minute per integration
Requests from the widget600 per minute per agent (all their widgets together)

Over a limit, Callston answers 429 with concurrency_limit (calls) or rate_limited (requests, with a Retry-After header).

Integration settings

You find these on the integration's page in Callston.

SettingWhat it does
Allowed originsThe exact web addresses (scheme + host + port) that may use the widget. Any other site is refused.
Allow all origins (for testing)Any site may load the widget while you build. Each session still works only on the site it was made for. Switch it off before going live.
Agent identifierHow your backend names employees: their Callston email, or a UUID (Callston lists each member's UUID; you can also map your own UUID to a member).
Who is covered (businesses)Everyone, selected members, or departments; and whether new members join automatically. Each agent can have their own overrides; the page shows each agent's effective settings.
Outgoing / incoming callsWhether agents may make calls, receive calls, or both.
Caller IDThe number the customer sees. Automatic works like the agent's dialer (a business uses the agent's department numbers, else the business default; a personal account uses its first number). Rotate over all numbers takes turns. A specific number always uses that number, falling back to Automatic if it stops being usable. Bought and verified numbers both work.
Destination countriesWhich countries agents may call.
Max concurrent callsCalls at the same time for all the integration's agents together. A call center sets at least the number of agents who may be on a call at once. See Limits.
Max call durationThe longest a call may last. See Limits.
Number visibilityShow, Hide or Masked. Hidden numbers never reach the agent's browser: not in the widget, not in call histories, exports or the wallboard. The business owner and the business's Admin members always see them; the owner can let others see them with the team permission See phone numbers a Click2Call integration hides.
Call window opens asWhere the call window lives: popup (default), new tab, frame shell, or browser extension. See Where the call window lives.
Widget defaultsPosition, colors, language, compact mode, label and which controls show (mute, keypad). Your init() options override them.

Keys: rotating the server key stops the old key at once. Revoking the key stops your backend. Revoking the integration also ends every widget session and call window at once; calls in progress end.

Disable stops new calls at once, and lets the calls in progress finish:

Switching calls off for one agent, or taking them out of Who is covered, works the same way for that agent. Their call in progress finishes, and End calls now ends theirs only. A request of theirs not placed yet ends failed with agent_disabled or agent_not_assigned.

Backend API

All requests use Authorization: Bearer c2ck_… (your server key) and JSON. Every error looks like { "ok": false, "error": "code", "message": "text" }: check error in your code, show or log message.

Errors any request can get:

ErrorStatusMeaning
unauthorized401The server key is missing, wrong or rotated.
integration_mismatch403The server key belongs to another integration than integration_id.
integration_disabled, integration_revoked403The integration is switched off, or was revoked. While it is switched off, checking and ending calls still work (see Disable).
account_suspended, business_suspended403The Callston account or business is not active. Ending a call (POST /calls/{id}/hangup) still works.
platform_disabled403Click2Call is not available right now.
invalid_request422The body is not valid JSON, or a required field is missing.
rate_limited429Too many requests: wait for Retry-After seconds.

Create a widget session

POST /api/v1/click2call/sessions

FieldRequiredMeaning
integration_idyesc2c_…
agentyes{ "type": "email", "value": "[email protected]" }, or { "type": "uuid", "value": "…" }. Must match the integration's Agent identifier.
originyesThe origin the widget sent you (https://crm.example.com).

Answer 201:

{ "ok": true, "widget_token": "c2cw_…", "expires_at": 1727612345,
  "agent": { "name": "Dana", "identifier": "[email protected]" },
  "policy": { "outbound": true, "inbound": true, "number_visibility": "hide",
              "controls": ["mute","dtmf"], "widget": { … }, "max_call_seconds": 3600 },
  "engine": null }
ErrorMeaning
origin_not_allowedThe origin is not in Allowed origins (or your backend sent another origin than the page's).
identifier_modeagent.type is not the integration's Agent identifier mode, or agent is missing.
agent_unknownNo active member has this email or UUID.
agent_ambiguousThe identifier matches more than one member.
agent_not_assignedThe member is not covered by this integration.
agent_disabledCalls are switched off for this agent.

Request a call

POST /api/v1/click2call/calls with an Idempotency-Key header.

FieldRequiredMeaning
integration_idyesc2c_…
agentyesThe employee who makes the call (same format as for sessions).
phone_numberyesThe number to call, in E.164 format (+14155550101).
contact_referencenoYour own id for the contact. It comes back in the call's details.
display_name, display_companynoWhat the agent sees instead of (or next to) the number.
metadatanoA small JSON object of your own, up to 2000 bytes (for example { "ticket": 4411 }).

Idempotency-Key: the same key with the same body returns the same call, so a double click starts one call. The same key with a different body is refused (409 idempotency_conflict).

Answer 202 — the call is queued, not answered yet:

{ "ok": true, "request_id": "ci_…", "call_id": "ci_…", "status": "queued",
  "display": { "name": "Alice Johnson", "company": "Northwind", "number": null, "contact_reference": "crm-8842" },
  "expires_at": 1727612405, "server_time": 1727612345 }

Before queuing, Callston checks the agent (member, covered, enabled, outgoing allowed), the number (valid, allowed country, not on the do-not-call list), the account (active, enough balance, under the call limit) and that the agent's call window is ready with a microphone. The agent's call window then places the call. A request no call window picks up in time becomes expired (see Limits).

ErrorStatusMeaning
agent_offline409The agent has no open call window. They need to click Enable calls.
agent_not_ready409The call window has no microphone permission.
agent_busy409The agent is already on a call, or a call request for them is still waiting for their call window.
outbound_not_allowed403Outgoing calls are off for this agent or integration.
invalid_phone_number422Not a valid E.164 number.
destination_not_allowed, destination_blocked403The country is not allowed, or the number is blocked.
concurrency_limit429The integration already has its maximum number of calls.
insufficient_balance402Not enough balance on the account.
no_caller_id422The account has no number to call from.
idempotency_conflict409The same Idempotency-Key was used with a different body.
metadata_too_large422metadata is over 2000 bytes.

Check or end a call

GET  https://callston.com/api/v1/click2call/calls/{request_id}
POST https://callston.com/api/v1/click2call/calls/{request_id}/hangup

status is one of queued, claimed, dialing, ringing, connected, completed, rejected, busy, no_answer, canceled, failed, expired. duration is counted by the server from the moment the call was answered. An unknown request_id gets 404 not_found. If the hang-up could not be confirmed, the answer is 502 hangup_uncertain: try again.

Both keep working while the integration is disabled, and the hang-up also for a suspended account. A call request that was not placed yet when calls were switched off ends failed, with error set to integration_disabled, agent_disabled or agent_not_assigned.

Widget SDK

init() options

CallstonClick2Call.init({ … }) returns the widget. Only the first two options are required.

OptionDefaultMeaning
integrationId— (required)c2c_…
sessionEndpoint— (required)Your session endpoint (step 2).
requestCallEndpointnoneYour call endpoint (step 3). Needed for requestCall().
headers{}Extra headers for your two endpoints, e.g. { 'X-CSRF-Token': '…' }. The widget sends credentials: 'same-origin'.
windowModethe integration's setting'popup', 'tab' or 'extension'.
positionthe integration's setting'bottom-right', 'bottom-left', 'top-right', 'top-left'.
offsetX, offsetYthe integration's settingDistance from the corner, in pixels.
languagethe integration's setting, else the page's lang'en', 'he', 'ar', …
theme, color, label, compactthe integration's settingLook of the widget.
uitruefalse hides the widget's own UI: build your own from getState() and the events.
containerdocument.bodyWhere the widget is placed.
shellRedirecttrueFrame-shell mode only: false stops pages from moving themselves into the shell.

Methods

MethodWhat it does
enableCalls()Opens the call window. Call it directly in a click handler (not after an await). If a call window is already open, it is brought to the front instead. If that window (or the extension) cannot take calls, it is first asked to start again. If it is still not ready 25 seconds later, the next enableCalls() replaces it with a fresh one. A window on a call is never replaced. If a popup is blocked, the widget shows an Open in new tab link. Returns true when a window was opened or found.
requestCall({ contact_reference, … })Posts to your requestCallEndpoint and returns its answer.
answer(), decline()Answer or decline an incoming call.
hangup()Ends the current call, from any page.
setMuted(true / false)Mute or unmute (when mute is enabled for the integration).
sendDigits('123#')Keypad tones (when the keypad is enabled).
setAvailability(true / false)Whether incoming calls may ring this agent.
getState(){ state, engine, call, policy, agent, session }.
on(event, fn), off(event, fn)Listen to events (below).
detach()Removes the widget from the page. It is not a hang-up: the call window keeps the call.
endSession()Signs the widget out. Use it when the employee logs out of your app.

Events

EventWhen
statechangeAnything changed. Receives the same object as getState().
callrequestedrequestCall() got an answer from your endpoint.
commandfailedA control was refused, or a requested call did not start within 30 seconds. Receives { kind, error }; the widget also shows the reason.
detacheddetach() ran.

States

stateWhat it means for the employee
init, connectingStarting up.
offlineNo call window yet, or the open one cannot take calls: they should click Enable calls.
enablingThe call window is opening, or starting again. A window stuck here for 25 seconds shows as offline.
readyReady to call and to receive calls.
unavailableOnline, but not taking incoming calls.
no_micThe call window is waiting for microphone permission. A window that has waited 25 seconds at the browser's microphone prompt shows here too: Enable calls brings it to the front.
callOn a call: see call.status (dialing, ringing, connected, … or incoming).
reconnectingThe connection to the call window is coming back.
unauthorized, errorThe session was refused: getState().error holds the reason code (see Troubleshooting).

Multipage sites and single-page apps

Where the call window lives

The call window holds the microphone and the call, so it must stay open while your pages change. Choose one place per integration (Call window opens as), or per page with the windowMode option.

ModeWhereWhat you doBest for
Popup window (default)a small Callston windownothingmost sites
New browser taba normal tab the agent can pinnothingagents whose popups get blocked or closed
Frame shella small panel inside a shell page on your site; your pages run inside itadd one page (below)multipage sites that should not open a second window
Browser extensionthe Callston extension for Chrome and Edgeagents install it onceteams who want no window or panel at all

All four use the same backend endpoints and the same widget.

Frame shell: three things to do

The agent's tab shows a shell page from your site. The shell shows your real pages in a full-screen frame, and keeps the Callston call window in a small panel. Links, forms and reloads inside the frame never touch the call, and calls start without clicking Enable calls.

1. Add a shell page on the same origin as your app, for example https://crm.example.com/callston-shell.html:

<!DOCTYPE html>
<html>
<head><meta charset="utf-8"><title>CRM</title></head>
<body>
<script src="https://callston.com/assets/js/click2call-sdk.js"></script>
<script>
  CallstonClick2Call.shell({
    integrationId: 'c2c_…',
    sessionEndpoint: '/callston/session',   // the same endpoints as init()
    requestCallEndpoint: '/callston/call',
    start: '/crm/'                          // the first page to show
    // optional: headers: { … }, panelPosition: 'left' or 'right', autoEnable: true
  });
</script>
</body>
</html>

2. In Callston, set Call window opens as → Frame shell and enter the shell page's address. Its origin must be in Allowed origins.

3. Let your own pages be framed by your shell: send X-Frame-Options: SAMEORIGIN or Content-Security-Policy: frame-ancestors 'self' (not DENY or 'none'). If the shell page has a CSP, it also needs frame-src https://callston.com.

Keep your init() code on your pages as it is. Inside the shell, init() returns the shell's widget (widget.inShell === true) with the same methods and events.

Good to know:

Browser extension

With Call window opens as → Browser extension, the call runs inside the Callston extension for Google Chrome and Microsoft Edge. There is no window to keep open; agents answer from the extension's button or a desktop notification.

Incoming calls

Nothing to build. Incoming calls follow the account's normal routing in Callston (IVR, departments, queues, forwarding). An agent's call window rings when their integration allows incoming calls, their call window is open with a microphone, and they are Available in the widget or the window (a reloaded window and an extension started again keep that choice). Busy, declined and unanswered calls follow the department's rules (timeout, overflow, voicemail, callback).

The widget and the window show the department, a caller label (a lead's name when known) and the number as the integration's visibility allows. Browsers cannot open a call window by themselves for an incoming call: the agent clicks Enable calls once per browser session.

What happens when…

Security checklist

Deployment checklist

Troubleshooting

The widget shows the reason after Calls unavailable. Your session endpoint receives the same code from Callston.

You seeWhyFix
Browser console: blocked by CORS policy … No 'Access-Control-Allow-Origin' headerYour page's origin is not in Allowed origins of an active integration.Add the exact origin (or tick Allow all origins while testing) and check the integration is Active. Then hard-refresh: browsers remember a refusal for a few minutes.
origin_not_allowedThe origin is not allowed, or your backend sent a different origin than the page's own.Add the exact origin (location.origin in the console). Your backend must pass on the origin the widget sent, not a fixed value or a full URL. Run the widget in the top page, not in a frame from another site.
identifier_modeagent.type does not match the integration's Agent identifier, or agent is missing.Send "agent": { "type": "email", "value": "…" } (or "type": "uuid"), as in step 2.
agent_unknown, agent_not_assigned, agent_disabledNo active member with that email or UUID, the member is not covered by the integration, or calls are off for them.Fix the identifier, or the integration's Who is covered and per-agent settings.
Calls are not connected in this browserNo call window is open for this agent in this browser.Click Enable calls. In extension mode, a short tab opens and connects the extension.
This extension is not allowed on this serverThe agent installed another copy of the extension.Remove it and install it from https://callston.com/click2call/extension.
The extension says Calls unavailableIt could not connect calls, for example because the browser started before the network was up.Nothing: it tries again by itself. To try at once, click Reconnect now in its toolbar popup, or Enable calls in the widget. If it is still not ready 25 seconds later, Enable calls connects the extension again from scratch.
The call window says Browser calling is not available for this account right nowIt could not start calls, for example because the voice service did not answer for a moment.Nothing: it tries again by itself. To try at once, click Enable calls in the widget. If it is still not ready 25 seconds later, Enable calls loads a fresh call window in its place.
Waiting for the microphone…The call window or the extension has no microphone permission.Allow the microphone in the call window, or on the extension's Settings & microphone page.
Requesting call…, then The call did not startEither your call endpoint hid Callston's refusal behind an "OK", or the call window never picked up the request (closed, or open in another browser).Return Callston's answer unchanged (steps 2 and 3): the widget then shows the real reason. Check that the widget shows Ready before calling.
The popup never opensenableCalls() ran outside a click (after an await or an AJAX call), or popups are blocked.Call it directly in the click handler, or use New browser tab or Browser extension.

Endpoint reference

Method & pathCredentialPurpose
POST /api/v1/click2call/sessionsserver keyA widget token for one agent on one origin.
POST /api/v1/click2call/callsserver keyRequest a call (Idempotency-Key).
GET /api/v1/click2call/calls/{id}server keyThe call's status.
POST /api/v1/click2call/calls/{id}/hangupserver keyEnd the call.
GET /api/v1/click2call/widget/statewidget tokenUsed by the widget.
POST /api/v1/click2call/widget/launch-ticketwidget tokenUsed by the widget to open the call window.
POST /api/v1/click2call/widget/commandswidget tokenUsed by the widget: hangup, answer, decline, mute, unmute, dtmf, availability, focus.
POST /api/v1/click2call/widget/refreshwidget tokenUsed by the widget to renew its token.
POST /api/v1/click2call/widget/revokewidget tokenUsed by endSession().
/api/v1/click2call/engine/…call windowUsed only by Callston's call window and extension.
GET /click2call/extensionnoneThe page where agents install the browser extension: https://callston.com/click2call/extension.

You call only the first four. The widget calls the widget/… endpoints for you. The full schemas are in the API schema (/developers/click2call/openapi.json).