Skip to content

SmsAddProvider

POST sms/provider

Registers a provider in the global catalogue. A provider record links an adapter in the module to the profiles that hold credentials: name must match an adapter name from SmsGetProviderAdapters.

The catalogue is global — brand-specific settings live in provider profiles.

Access Control

Allowed role: provider.

Request

POST https://{broker_domain}/sms/provider
{
  "name": "twilio",
  "status": "ENABLED",
  "description": "Twilio Programmable Messaging",
  "options": {
    "accountSid": "string",
    "authToken": "string",
    "fromNumber": "string"
  },
  "supportedUpdateModes": [
    "REQUEST",
    "WEBHOOK"
  ]
}
{
  "command": "SmsAddProvider",
  "extID": "1",
  "data": {
    "name": "twilio",
    "status": "ENABLED",
    "description": "Twilio Programmable Messaging",
    "options": {
      "accountSid": "string",
      "authToken": "string",
      "fromNumber": "string"
    },
    "supportedUpdateModes": [
      "REQUEST",
      "WEBHOOK"
    ]
  }
}
const res = await platform.SmsAddProvider({
  name: "twilio",
  status: "ENABLED",
  description: "Twilio Programmable Messaging",
  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, infobip)
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 delivery report modes this provider allows: NONE, REQUEST, WEBHOOK

Behavior

  • A provider cannot declare a mode its adapter does not implement. Otherwise profiles would be created whose messages stay in SENT forever, with no delivery report ever arriving.
  • 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.

Response Data

The provider record is returned flat. 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 Messaging",
  "options": { "accountSid": "string", "authToken": "string", "fromNumber": "string" },
  "supportedUpdateModes": ["REQUEST", "WEBHOOK"],
  "adapterImplemented": true,
  "capabilities": { "polling": true, "webhook": true, "balance": true, "unicode": 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