Skip to main content
This event is triggered when a LinkedIn message is successfully sent to a lead, either through campaign automation or via the API.

When This Event Fires

  • Campaign automation sends a follow-up message
  • Message is sent via the Send Message API
  • A message is successfully delivered to the lead’s LinkedIn inbox

Payload

{
  "eventId": "evt_1708456789123_abc123def",
  "eventType": "message.sent",
  "timestamp": "2024-02-24T10:30:00.000Z",
  "workspaceId": "ws_abc123xyz",
  "data": {
    "leadId": "lead_abc123",
    "campaignId": "camp_xyz789",
    "linkedinUrl": "https://www.linkedin.com/in/john-doe",
    "senderId": "sender_def456",
    "messagePreview": "Hi John! Thank you for connecting. I wanted to reach out about...",
    "sequenceStep": 2
  }
}

Payload Fields

FieldTypeDescription
eventIdstringUnique event identifier for idempotency
eventTypestringAlways message.sent
timestampstringISO 8601 timestamp when the message was sent
workspaceIdstringYour workspace ID
data.leadIdstringThe lead who received the message
data.campaignIdstringThe campaign this lead belongs to
data.linkedinUrlstringLinkedIn profile URL of the lead
data.senderIdstringLinkedIn sender account that sent the message
data.messagePreviewstringFirst 100 characters of the message content
data.sequenceStepnumberWhich step in the campaign sequence (if applicable)

Use Cases

CRM Integration

Log message activity in your CRM to maintain conversation history

Analytics

Track message delivery and sequence progression

Notifications

Alert team members when outreach is sent

Audit Trail

Build an audit log of all outreach activity

Example Handler

app.post('/webhooks/sendpilot', (req, res) => {
  const event = req.body;
  
  if (event.eventType === 'message.sent') {
    const { leadId, campaignId, messagePreview, sequenceStep } = event.data;
    
    // Log to your CRM
    await crm.logActivity({
      leadId,
      type: 'linkedin_message_sent',
      content: messagePreview,
      metadata: { campaignId, sequenceStep }
    });
    
    console.log(`Message sent to lead ${leadId} (step ${sequenceStep})`);
  }
  
  res.status(200).send('OK');
});
The messagePreview field contains only the first 100 characters of the message for privacy. Full message content is available in the SendPilot dashboard.