Skip to main content
LinkedIn has no official API for DMs. Nous uses Unipile as a middleware — you connect your LinkedIn account to Unipile, and Unipile forwards events to Nous via webhook.

Server Setup

1

Create a Unipile account

Sign up at unipile.com. You need a paid plan to use the LinkedIn messaging API.
Screenshot 2026 05 15 At 11 08 31 AM
2

Get your API Key and DSN

In the Unipile dashboard go to Settings → API. Copy your API Key and DSN (the webhook base URL).
Screenshot 2026 05 15 At 11 09 53 AM
3

Add to nous.env

UNIPILE_API_KEY=your-api-key
UNIPILE_DSN=your-dsn
LINKEDIN_WEBHOOK_SECRET=a-random-secret-string
Restart your containers after saving.
4

Connect your LinkedIn account in Unipile

In the Unipile dashboard go to Accounts → Add account → LinkedIn and follow the login flow.
5

Register the Connections webhook

In Unipile go to Webhooks → Add webhook. Set:
  • Event: On new relation
  • URL:
https://api.yourdomain.com/inbound/linkedin?workspace_id=YOUR_WORKSPACE_ID&secret=YOUR_LINKEDIN_WEBHOOK_SECRET
Screenshot 2026 05 15 At 11 13 24 AM
6

Register the Messages webhook

Add a second webhook:
  • Event: On new message
  • URL: same URL as above
Screenshot 2026 05 15 At 11 13 51 AM
Find your Workspace ID in Settings → Integrations → Webhooks — the URL shown there already has it embedded.

What gets logged

EventActivity logged
New connection acceptedlinkedin_connection
Inbound DMlinkedin_message_received
Outbound DMlinkedin_message_sent