The message.sent webhook event is triggered whenever your Apten assistant sends a message to a lead via SMS or email. This can be used to track outgoing communication and monitor follow-up sequences.

Payload

SMS Example

{
  "event": "message.sent",
  "data": {
    "leadId": "c4f23a1b-d8e5-4f67-90c1-2a5b8d3e9x7y",
    "phone": "+12025550189",
    "channel": "sms",
    "profile": "Default Profile",
    "isFollowUp": true,
    "followUpStep": 1,
    "content": {
      "text": "Hi there! Just following up on our previous conversation. Would you like to learn more about our services?"
    }
  },
  "timestamp": "2024-01-15T14:30:00Z"
}

Email Example

{
  "event": "message.sent",
  "data": {
    "leadId": "c4f23a1b-d8e5-4f67-90c1-2a5b8d3e9x7y",
    "phone": "+12025550189",
    "channel": "email",
    "profile": "Default Profile",
    "isFollowUp": true,
    "followUpStep": 1,
    "content": {
      "subject": "Follow-up: Your Interest in Our Services",
      "text": "Hi there! Just following up on our previous conversation. Would you like to learn more about our services?"
    }
  },
  "timestamp": "2024-01-15T14:30:00Z"
}

Properties

PropertyTypeDescription
eventstringThe webhook event type (message.sent).
data.leadIdstringThe unique identifier for the lead.
data.phonestringThe phone number of the lead.
data.channelstringThe communication channel. Can be sms or email.
data.profilestringThe customer profile assigned to the lead.
data.isFollowUpbooleanIndicates if this message is part of a follow-up sequence.
data.followUpStepnumber | nullThe current step in the follow-up sequence. Will be null if isFollowUp is false. May also be null for older follow-ups that were scheduled before this feature was implemented.
data.content.subjectstringThe subject line of the email. Only included for email messages, not SMS.
data.content.textstringThe content of the message sent to the lead.
timestampstringThe ISO 8601 timestamp when the message was sent.