Skip to content

Click2Call REST API

The REST transport addresses a module method by HTTP method and path. It is the entry point for the CRM interface, the backoffice, mobile applications, and provider callbacks.

The same methods are available over TCP by command name — see TCP API. Request fields and results are identical; only the addressing differs.

Base URL

https://{broker_domain}/click2call/...

All paths of the module live under click2call/. The prefix is what keeps the module apart from the other modules sharing the same host — including the public webhook path.

Authorization

Every endpoint except the public webhook requires a manager JWT:

Authorization: <JWT_TOKEN>

The platform resolves the token and passes the identity to the module. The brand and the author of a record always come from the token, never from the request body: a manager cannot reach another brand's calls by sending a different brand value.

POST click2call/handleWebhooks/:uuid is public — it is called by the telephony provider. Its protection is the unguessable uuid plus the signature check of the webhook secret.

Endpoints

Method Endpoint Access
Click2CallStartCall POST click2call/call/start admin, leader, manager
Click2CallEndCall POST click2call/call/end admin, leader, manager
Click2CallGetCalls GET click2call/calls/list admin, leader, manager
Click2CallGetCallRecording GET click2call/call/:id/recording admin, leader, manager
Click2CallGetProviderAdapters GET click2call/providers/adapters admin, provider
Click2CallAddProvider POST click2call/provider provider
Click2CallUpdateProvider PUT click2call/provider provider
Click2CallDeleteProvider DELETE click2call/provider provider
Click2CallGetProviders GET click2call/providers/list admin, provider
Click2CallAddProfile POST click2call/providerProfile admin
Click2CallUpdateProfile PUT click2call/providerProfile admin
Click2CallDeleteProfile DELETE click2call/providerProfile admin
Click2CallGetProfiles GET click2call/providerProfiles/list admin
Click2CallGetMyProfiles GET click2call/providerProfile/available/me admin, leader, manager
Click2CallAddAgent POST click2call/agent admin
Click2CallUpdateAgent PUT click2call/agent admin
Click2CallDeleteAgent DELETE click2call/agent admin
Click2CallGetAgents GET click2call/agents/list admin
Click2CallAddDialRule POST click2call/dialRule admin
Click2CallUpdateDialRule PUT click2call/dialRule admin
Click2CallDeleteDialRule DELETE click2call/dialRule admin
Click2CallGetDialRules GET click2call/dialRules/list admin
Click2CallAddBlacklistPhone POST click2call/blacklist admin, leader, manager
Click2CallImportBlacklistPhones POST click2call/blacklist/import admin
Click2CallDeleteBlacklistPhone DELETE click2call/blacklist admin
Click2CallCheckBlacklistPhone GET click2call/blacklist/check admin, leader, manager
Click2CallGetBlacklist GET click2call/blacklist/list admin, leader
Click2CallAddCallWindow POST click2call/callWindow admin
Click2CallUpdateCallWindow PUT click2call/callWindow admin
Click2CallDeleteCallWindow DELETE click2call/callWindow admin
Click2CallCheckCallWindow GET click2call/callWindow/check admin, leader, manager
Click2CallGetCallWindows GET click2call/callWindows/list admin, leader
Click2CallAddWebhook POST click2call/webhook admin
Click2CallUpdateWebhook PUT click2call/webhook admin
Click2CallDeleteWebhook DELETE click2call/webhook admin
Click2CallGetWebhooks GET click2call/webhooks/list admin
Click2CallGetWebhookEvents GET click2call/webhookEvents/list admin
Click2CallHandleWebhook POST click2call/handleWebhooks/:uuid public
Click2CallPing GET click2call/ping any authenticated session
Click2CallHealth GET click2call/health admin

Click2CallGetLastCallsByParents has no REST route: it is an internal method for the CRM card list and is available over the bus only.

List queries

Every */list method accepts the same query contract:

Field Type Description
limit int Page size, 1..1000, default 100
offset int Rows to skip
orderBy array ["id", "DESC"]
groupBy array [field], or [field, expression] with one of HOUR({field}), DAY({field}), MONTH({field}), YEAR({field}), DATE_FORMAT({field}, '<format>')
count, sum, min, max, avg array Aggregates over the listed fields
select array Fields to return, default ["*"]
where, orWhere, whereNot, orWhereNot array Conditions [field, operator, value]
whereIn, whereNotIn, orWhereIn, orWhereNotIn array [field, [value, …]]
whereBetween, whereNotBetween, orWhereBetween, orWhereNotBetween array [field, [from, to]]
whereNull, whereNotNull, orWhereNull, orWhereNotNull array [field]
whereLike, whereNotLike, orWhereLike, orWhereNotLike array [field, pattern], with % wildcards
whereJsonSupersetOf, orWhereJsonSupersetOf array [field, value] for JSON columns

Each filter key takes a list of conditions, and conditions under one key are joined with AND:

{
  "where": [["profileName", "like", "%smtp%"], ["attempts", ">", 1]],
  "whereIn": [["status", ["FAILED", "BOUNCED"]]],
  "whereBetween": [["createdAt", ["2026-10-13 00:00:00", "2026-10-13 23:59:59"]]],
  "orderBy": ["sentAt", "DESC"]
}

To join conditions with OR, start a condition with "OR". Nested arrays form a group in parentheses: [["status", "=", "FAILED"], ["OR", "status", "=", "BOUNCED"]].

Rules that apply to every list:

  • Fields are the ones a method returns in rows, including joined names such as profileName and providerName. A field that is not in that list is ignored, both in a filter and in orderBy; orderBy by an unknown field sorts by id. Values the module adds to a row after the query, such as a provider's adapterImplemented, can be neither filtered nor sorted.
  • Operators are SQL comparison operators: =, <>, <, <=, >, >=, like, not like. like takes % wildcards as written; nothing is added to the pattern.
  • Dates are UTC strings in YYYY-MM-DD HH:mm:ss.
  • Raw SQL is not accepted: whereRaw and orWhereRaw are not part of the contract and are ignored. A groupBy expression other than the forms above is rejected with 400.
  • The brand scope of the caller always applies; filters only narrow it.

The response is the requested page in rows, plus one key per requested aggregate:

{
  "rows": [],
  "count": [ { "id": 42 } ]
}

A row count is an aggregate, not a default: ask for it with count: ["id"] when the UI needs to draw paging. Skipping it saves the second query on views that do not.

Status codes

Code Meaning
200 Method succeeded
400 Validation failed, or the request contradicts itself
401 Missing or invalid JWT
403 The manager may not touch this record
404 Record, profile, provider, or adapter not found
409 The call is not allowed: blacklist, destination, calling window, duplicate
429 Provider rate limit
500 Module or storage error
502 Module is unreachable on the bus
503 Provider is unavailable

On success the body is the method payload itself — there is no wrapper object to unwrap:

{ "callId": 501, "externalId": "prov-77213", "status": "INITIATED" }

On failure the HTTP status carries the outcome and the body is the message:

HTTP/1.1 409 Conflict

"Phone 380950000000 is blacklisted: customer request"

Branch on the status code and show the message to the operator. The error type listed on each method page names the same condition and appears in the module log and in the service envelope; the gateway forwards the code and the message, so at the HTTP boundary the status code is the machine-readable part.

That is why the method pages list several type values under one status: 409 on Click2CallStartCall can mean a closed calling window, a blocked destination, or a duplicate click, and the message says which.