Skip to content

Click2CallAddProvider

POST click2call/provider

Registers a provider in the global catalogue. A provider record is the link between an adapter in the module and the profiles that hold credentials: name must match the adapter name from Click2CallGetProviderAdapters.

The catalogue is global — it is not scoped to a brand. Brand-specific settings live in provider profiles.

Access Control

Allowed role: provider.

Request

POST https://{broker_domain}/click2call/provider
{
  "name": "twilio",
  "status": "ENABLED",
  "description": "Twilio Programmable Voice",
  "options": {
    "accountSid": "string",
    "authToken": "string",
    "fromNumber": "string"
  },
  "supportedUpdateModes": [
    "REQUEST",
    "WEBHOOK"
  ]
}
{
  "command": "Click2CallAddProvider",
  "extID": "1",
  "data": {
    "name": "twilio",
    "status": "ENABLED",
    "description": "Twilio Programmable Voice",
    "options": {
      "accountSid": "string",
      "authToken": "string",
      "fromNumber": "string"
    },
    "supportedUpdateModes": [
      "REQUEST",
      "WEBHOOK"
    ]
  }
}
const res = await platform.Click2CallAddProvider({
  name: "twilio",
  status: "ENABLED",
  description: "Twilio Programmable Voice",
  options: {
    accountSid: "string",
    authToken: "string",
    fromNumber: "string"
  },
  supportedUpdateModes: [
    "REQUEST",
    "WEBHOOK"
  ]
});

Request Data

Field Type Required Description
name string Yes Adapter name, lowercase without spaces (twilio, commpeak). It must match an implemented adapter
status enum Yes ENABLED or DISABLED
description string No Provider description for the UI
icon string | file No Icon hash or an uploaded file
url string No Provider site or panel link
options object Yes Credential field description for the UI; usually the adapter credentialsSchema
supportedUpdateModes array Yes Which status delivery modes this provider allows: NONE, REQUEST, WEBHOOK

Behavior

  • A provider cannot declare a mode its adapter does not implement: REQUEST needs status polling, WEBHOOK needs webhook parsing. Otherwise profiles would be created whose calls stay in INITIATED forever.
  • Creating a provider whose name was soft-deleted restores the old record and answers restored: true — the name is unique in storage, so otherwise it would stay taken forever.
  • A name with no adapter behind it is accepted but flagged in message: calls through it fail with PROVIDER_ADAPTER_NOT_FOUND.

Response Data

The provider record is returned flat. restored and message are informational: message also carries the warning when the named adapter is not implemented in the running module.

{
  "id": 1,
  "name": "twilio",
  "status": "ENABLED",
  "description": "Twilio Programmable Voice",
  "options": { "accountSid": "string", "authToken": "string", "fromNumber": "string" },
  "supportedUpdateModes": ["REQUEST", "WEBHOOK"],
  "adapterImplemented": true,
  "capabilities": { "polling": true, "webhook": true, "endCall": true, "recordings": true },
  "restored": false,
  "message": "Provider twilio has been created."
}

Errors

Code Error Description
400 VALIDATION_ERROR name is not lowercase, or a required field is missing
400 UPDATE_MODE_NOT_SUPPORTED The adapter cannot do a declared mode
409 PROVIDER_EXISTS An active provider with this name already exists