> ## 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.

# connection_request.sent

> Triggered when a connection request is sent to a lead

This event is triggered when a LinkedIn connection request is successfully sent to a lead through campaign automation.

## When This Event Fires

* Campaign automation sends a connection request
* The connection request is successfully delivered to LinkedIn
* The lead's status changes to `CONNECTION_SENT`

## Payload

```json theme={null}
{
  "eventId": "evt_1708456789123_abc123def",
  "eventType": "connection_request.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",
    "note": "Hi John, I noticed we share an interest in SaaS growth..."
  }
}
```

## Payload Fields

| Field              | Type   | Description                                         |
| ------------------ | ------ | --------------------------------------------------- |
| `eventId`          | string | Unique event identifier for idempotency             |
| `eventType`        | string | Always `connection_request.sent`                    |
| `timestamp`        | string | ISO 8601 timestamp when the request was sent        |
| `workspaceId`      | string | Your workspace ID                                   |
| `data.leadId`      | string | The lead who received the connection request        |
| `data.campaignId`  | string | The campaign this lead belongs to                   |
| `data.linkedinUrl` | string | LinkedIn profile URL of the lead                    |
| `data.senderId`    | string | LinkedIn sender account that sent the request       |
| `data.note`        | string | Connection note if included (LinkedIn Premium only) |

## Use Cases

<CardGroup cols={2}>
  <Card title="Outreach Tracking" icon="chart-line">
    Track daily connection request volume
  </Card>

  <Card title="CRM Sync" icon="database">
    Log outreach activity in your CRM
  </Card>

  <Card title="Follow-up Tasks" icon="list-check">
    Create follow-up tasks if no response after X days
  </Card>

  <Card title="Reporting" icon="file-chart-line">
    Build custom reports on outreach activity
  </Card>
</CardGroup>

## Example Handler

```javascript theme={null}
app.post('/webhooks/sendpilot', async (req, res) => {
  const event = req.body;
  
  if (event.eventType === 'connection_request.sent') {
    const { leadId, campaignId, linkedinUrl, note } = event.data;
    
    // Log to CRM
    await crm.logActivity({
      leadId,
      type: 'connection_request_sent',
      message: note || 'Connection request sent (no note)',
      campaignId
    });
    
    // Schedule a follow-up task if no response in 7 days
    await taskQueue.schedule({
      type: 'check_connection_status',
      leadId,
      executeAt: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000)
    });
    
    console.log(`Connection request sent to ${linkedinUrl}`);
  }
  
  res.status(200).send('OK');
});
```

<Note>
  The `note` field is only populated for LinkedIn Premium accounts that include a message with their connection requests. Free accounts will have this field empty or undefined.
</Note>
