API reference

Trigger a click-to-call

Bridge an agent and a customer — call the agent first, then connect them to the customer.

POSThttps://nextgenpanelstaging.cloudshope.com/api/v1/clickToCallApis/clickToCall

Places a two-leg call: the platform calls from_number (the agent) first, and once answered, bridges them to to_number (the customer). This is the API behind an in-app "Call" button, not a direct agent-to-customer dial.

customer_retry_count / agent_retry_count cap manual re-tries per leg (1–3). source, agent_not_pick_group, agent_not_pick_policy, max_retry, retry_after and auto_block_time are accepted but currently have no effect on the call. to_number must be exactly 10 digits — a 91 prefix is rejected.

enable_whatsapp sends a WhatsApp notification alongside the call when set to "1"; reference is your own correlation id, echoed back on the report.

Errors on this endpoint return { "success": false, "message": "…" } or { "status": …, "message": "…" }, not the standard problem shape.

Authentication

Send Authorization: Bearer <token>. Any valid API token for the account works.

Body parameters

NameTypeRequiredDescription
to_numberstring (10 digits)YesCustomer number to bridge to.
from_numberstringYesAgent number / extension to call first.
cli_numberstring (10 digits)NoCaller ID to present to the customer. Exactly 10 digits; defaults to the platform default caller ID.
sourcestringNoFree-text origin tag for the call, e.g. a CRM lead source.
agent_not_pick_groupstringNoAccepted; currently has no effect.
agent_not_pick_policystringNoAccepted; currently has no effect.
max_retrystringNoAccepted as a string; currently has no effect.
retry_afterstringNoAccepted as a string; currently has no effect.
customer_retry_countinteger (1–3)NoCap on manual retries of the customer leg.
agent_retry_countinteger (1–3)NoCap on manual retries of the agent leg.
extension_for_transferstring (1 digit)NoExtension a call can be transferred to mid-call.
extension_for_disstring (1 digit)NoExtension to dispatch to on a keypress.
schedulled_atstringNoWhen to place the call, as IST date/time YYYY-MM-DD HH:mm:ss. Omit, or give a time that has passed, to call now.
enable_whatsappstringNoPass "1" to send a WhatsApp notification alongside the call.
from_smsstringNoSMS template id sent to the agent.
to_smsstringNoSMS template id sent to the customer.
missed_numberstringNoStored on the report row.
from_group_idstringNoAgent group id, if from_number is resolved from a group.
to_group_idstringNoCustomer group id, if applicable.
auto_block_timestringNoAccepted; currently has no effect.
remarkstringNoFree-text note stored on the report row.
referencestringNoYour own correlation id, echoed back on the report.
callback_methodstringNoHTTP method for the call-event callback. Defaults to get.

Request

curl -X POST https://nextgenpanelstaging.cloudshope.com/api/v1/clickToCallApis/clickToCall \
  -H "Authorization: Bearer cs_live_9f2c…" \
  -H "Content-Type: application/json" \
  -d '{
    "from_number": "9800000001",
    "to_number": "9876543210",
    "reference": "order-4021"
  }'

Response

{
  "status": 200,
  "message": "Campaign Submitted Successfully",
  "data": { "campaignId": 5521 }
}
200 — example response

Errors

StatusTypeWhen
400bad-requestInsufficient Call Credits., or a field failed validation ({ "status": 400, "message": "Validation failed", "errors": [{ "field", "message" }] }).
403forbiddenNight call not enabled. — night calling is switched off for the account and the current time is between 21:30 and 07:00 IST. This applies to scheduled and immediate calls alike.
500internal-errorSomething went wrong placing the call.
401unauthorizedThe Authorization header is missing, malformed or the token is invalid or expired.
403forbiddenThe token is valid but the account is not allowed to perform this action.