Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.sendpilot.ai/llms.txt

Use this file to discover all available pages before exploring further.

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",
    "message": "Hi John! Thank you for connecting. I wanted to reach out about our new product that could help your team increase productivity by 40%. Would you be open to a quick 15-minute call this week?",
    "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.messagestringFull message content that was sent
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, message, sequenceStep } = event.data;
    
    // Log to your CRM
    await crm.logActivity({
      leadId,
      type: 'linkedin_message_sent',
      content: message,
      metadata: { campaignId, sequenceStep }
    });
    
    console.log(`Message sent to lead ${leadId} (step ${sequenceStep})`);
  }
  
  res.status(200).send('OK');
});
The message field contains the full message content that was sent to the lead.