Salesforce webhooks: salesforcesettings.updated is emitted by the Accounts API when Salesforce settings are updated (PUT /salesforce-settings). salesforce.sms.sent is emitted by the Notifications API when an SMS is successfully sent through Salesforce Marketing Cloud (POST /salesforce/sms).
This matches Twilio: twilio.sms.sent is emitted only after a successful send. salesforce.sms.sent is not emitted when Salesforce rejects the send (SALESFORCE_ERROR, MESSAGE_DISABLED_IN_SALESFORCE, auth or configuration errors). Those requests return HTTP 409 (or 401 for auth) and do not publish a webhook.
salesforce.sms.sent replaces the previous event name salesforcesms.created. Subscribe to salesforce.sms.sent.
Events
| Action | Event name |
|---|---|
| update Salesforce settings (PUT /salesforce-settings) | salesforcesettings.updated |
| SMS sent successfully (POST /salesforce/sms) | salesforce.sms.sent |
Payload example (salesforcesettings.updated)
The API emits the event with { providerId, apiKey, data: account.salesforce } (the data field is the account's Salesforce preferences object). The webhook envelope may expose these as data.providerId, data.apiKey, and data (or data.data) containing the Salesforce settings.
{
"attemptId": "20ebdb3d-85e1-47a4-a81d-7b6c7dd1a481",
"created": 1634755434,
"data": {
"enabled": true,
"smsEnabled": false,
"mcInstanceId": "mc-a1b2c3d4e5f6g7h8i9j0k1l2m3",
"messageId": "MTExOjExOjE",
"clientId": "a1b2c3d4e5f6g7h8i9j0k1l2",
"clientSecret": "aBcDeFgHiJkLmNoPqRsTuVwX",
"messageKeyword": "COMPANYNAME",
"override": false,
"messageBody": "",
"downloadUrl": "",
"allowLongTexts": false,
"maxRetries": 5,
"requirePhoneNumberConfirmation": false,
"prefixPhoneNumber": "",
"optInByDefault": false
},
"event": "salesforcesettings.updated",
"id": "2e32d603-a379-46f9-9393-ba4d1859e2fe",
"livemode": true
}
Payload fields (salesforcesettings.updated)
| Field | Type | Description |
|---|---|---|
| id | string | Webhook event id |
| attemptId | string | Delivery attempt id |
| created | number | Unix timestamp when the event was created |
| event | string | salesforcesettings.updated |
| livemode | boolean | Whether the account is in live mode |
| data | object | Salesforce preferences object (or envelope with providerId, apiKey, data) |
| data.enabled | boolean | Enable Salesforce SMS integration |
| data.smsEnabled | boolean | Whether Salesforce is used to send SMS notifications |
| data.mcInstanceId | string | Salesforce tenant subdomain (instance id) |
| data.messageId | string | Message ID enabled in Salesforce |
| data.clientId | string | Client id for the Salesforce endpoint |
| data.clientSecret | string | Client secret for the Salesforce endpoint |
| data.messageKeyword | string | Message keyword for tagging the message |
| data.override | boolean | When enabled, payload message is delivered instead of preconfigured message |
| data.messageBody | string | Message sent with the ticket download URL |
| data.downloadUrl | string | URL for downloading the ticket (placeholders: {{itemId}}, {{phone}}) |
| data.allowLongTexts | boolean | When enabled, allows splitting messages over 160 chars into multiple SMS |
| data.maxRetries | number | Maximum retries on send failure |
| data.requirePhoneNumberConfirmation | boolean | Users must verify recipient phone before sending SMS |
| data.prefixPhoneNumber | string | Default area code to pre-fill phone number |
| data.optInByDefault | boolean | Opt-in checkbox selected by default on checkout |
Payload example (salesforce.sms.sent)
Emitted by the Notifications API after Salesforce Marketing Cloud accepts the send and the message is saved with status: "success". The API emits { providerId, apiKey, data: salesforceMessage }.
This event is not emitted when the send fails.
{
"attemptId": "1e368c2e-9c90-44a9-8b25-9ea3c66ffe4b",
"created": 1719320447,
"data": {
"_id": "11a377ec430c7d4e220001fd",
"accountId": "679bd375733d80057bb738a3",
"envelopeId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"body": "Hello World",
"tokenId": "MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"errorMessage": "",
"mcInstanceId": "mc-a1b2c3d4e5f6g7h8i9j0k1l2m3",
"messageId": "MTExOjExOjE",
"status": "success",
"to": "+15005550006",
"createdBy": "5f243d100617680712e78dd7",
"updatedBy": "5f243d100617680712e78dd7",
"createdAt": {
"value": "2020-11-10T15:02:10Z",
"offset": 0
},
"updatedAt": {
"value": "2020-11-10T15:02:10Z",
"offset": 0
}
},
"event": "salesforce.sms.sent",
"id": "1f58f8f7-3a36-486d-b3ca-265d5a5bb0c5",
"livemode": false
}
Payload fields (salesforce.sms.sent)
| Field | Type | Description |
|---|---|---|
| event | string | salesforce.sms.sent |
| data._id | string | Saved Salesforce message id |
| data.accountId | string | Account that sent the SMS |
| data.envelopeId | string | Id that groups retries for this send in logs |
| data.body | string | SMS body that was sent |
| data.tokenId | string | Marketing Cloud token for the queued send |
| data.mcInstanceId | string | Marketing Cloud instance id used to send |
| data.messageId | string | Marketing Cloud message id used to send |
| data.status | string | success (this event is not emitted for error) |
| data.to | string | Destination phone number |
| data.createdBy | string | User id that triggered the send |
| data.createdAt | object | When the message record was created |