LinkedIn Messaging API: Complete Integration Guide 2026
Connect your CRM to LinkedIn messaging with ConnectSafely's API. Retrieve conversations, send messages with typing indicators, and automate outreach.

The LinkedIn Messaging API allows you to send messages, retrieve conversations, and integrate LinkedIn communications into your CRM programmatically. LinkedIn's official Marketing API has limited messaging capabilities for enterprise customers only. For full messaging functionality—including sending messages to users, retrieving conversation history, and adding typing indicators—third-party solutions like ConnectSafely's LinkedIn API provide comprehensive REST endpoints.
Want to Generate Consistent Inbound Leads from LinkedIn?
Get our complete LinkedIn Lead Generation Playbook used by B2B professionals to attract decision-makers without cold outreach.
No spam. Just proven strategies for B2B lead generation.
To send a LinkedIn message via API, make a POST request to ConnectSafely's /linkedin/messaging/send-with-typing endpoint with the recipient's profile ID and your message content. The API sends a typing indicator first for natural appearance, then delivers your message.
According to LinkedIn's official statistics, LinkedIn accounts for 80% of B2B social leads. Integrating LinkedIn messaging into your sales workflow through API access can significantly improve response times, lead tracking, and inbound lead conversion.
Key Takeaways
- LinkedIn Messaging API access: LinkedIn's official API has limited messaging capabilities; ConnectSafely's API provides full access with 7 endpoints for conversation management
- How to send LinkedIn messages via API: POST to
/linkedin/messaging/send-with-typingwithrecipientProfileIdandmessageparameters—includes automatic typing indicator - CRM integration: Sync LinkedIn conversations to HubSpot, Salesforce, or Pipedrive using the REST API for unified communication tracking
- Typing indicators for natural behavior: API sends "typing..." indicators before messages to appear human-like and improve deliverability per LinkedIn's algorithm preferences
- Conversation retrieval: Get recent messages, full conversation history, and participant details with pagination support
- Platform-safe approach: Built-in rate limiting and natural patterns maintain 100% compliance with LinkedIn's terms
What is the LinkedIn Messaging API?
The LinkedIn Messaging API provides programmatic access to LinkedIn's messaging functionality. Instead of manually checking LinkedIn for new messages or sending individual outreach, developers can build automated workflows that:
- Retrieve recent conversations and unread message counts
- Fetch complete conversation histories with sender details
- Send messages with typing indicators for natural appearance
- Track message delivery acknowledgments
- Integrate LinkedIn communications into CRM pipelines
Official vs Third-Party APIs
LinkedIn provides an official Marketing API with limited messaging capabilities, primarily for enterprise customers. Third-party solutions like ConnectSafely's API offer broader functionality for sales teams and developers.
| Feature | Official LinkedIn API | ConnectSafely API |
|---|---|---|
| Message retrieval | Limited | Full inbox access |
| Send messages | Enterprise only | Available |
| Typing indicators | No | Yes |
| Conversation history | Limited | Complete |
| CRM integration | Complex | Simple REST |
| Pricing | Enterprise licensing | From $39/month |
ConnectSafely LinkedIn Messaging API Endpoints
ConnectSafely provides comprehensive LinkedIn messaging endpoints for building sales automation:
1. Get Recent Messages
Endpoint: GET /linkedin/messaging/recent-messages
Retrieve recent LinkedIn conversations with participant details, unread counts, and message previews.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
accountId | string | No | LinkedIn account ID; defaults to most recently used |
nextCursor | string | No | Pagination token from previous response |
count | integer | No | Conversations to return (default: 20, max: 100) |
keywords | string | No | Filter by keywords in participants or messages |
read | boolean | No | Filter by read status |
Example Request:
curl -X GET 'https://api.connectsafely.ai/linkedin/messaging/recent-messages' \
-H 'Authorization: Bearer <your_api_key>'
Example Response:
{
"success": true,
"accountId": "507f1f77bcf86cd799439011",
"total": 3,
"nextCursor": "xqS2pdVm4vDq0NZmLnVybjpsaTptYWJyaWM...",
"conversations": [
{
"conversationId": "urn:li:messagingThread:...",
"participants": [
{
"profileId": "123456",
"name": "John Doe",
"headline": "Software Engineer",
"profilePicture": "https://..."
}
],
"unreadCount": 2,
"lastActivityAt": 1704067200000,
"latestMessage": {
"text": "Hello, how are you?",
"sentAt": 1704067200000,
"senderName": "John Doe"
}
}
]
}
2. Get Conversation Details
Endpoint: GET /linkedin/messaging/conversation-details
Fetch complete conversation history including all messages, sender profiles, attachments, and reactions.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
accountId | string | No | LinkedIn account ID |
conversationUrn | string | Yes | Conversation URN or ID |
Example Request:
curl -X GET 'https://api.connectsafely.ai/linkedin/messaging/conversation-details?conversationUrn=urn:li:msg_conversation:(...)' \
-H 'Authorization: Bearer <your_api_key>'
Example Response:
{
"success": true,
"conversationUrn": "urn:li:msg_conversation:(...)",
"total": 11,
"messages": [
{
"messageId": "urn:li:msg_message:(...)",
"text": "Message content",
"sentAt": 1763378062881,
"sender": {
"profileId": "ACoAACr-hewBS7g6...",
"name": "John Doe",
"profileUrl": "https://www.linkedin.com/in/ACoAACr-...",
"profilePicture": "https://media.licdn.com/..."
},
"attachments": null,
"reactions": null
}
],
"pagination": {
"hasMoreBefore": true,
"hasMoreAfter": false
}
}

3. Send Message with Typing Indicator
Endpoint: POST /linkedin/messaging/send-with-typing
Send a LinkedIn message with a typing indicator sent first, mimicking natural human behavior for improved engagement.
Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
accountId | string | No | LinkedIn account ID |
recipientProfileId | string | Yes* | Recipient's LinkedIn profile ID |
recipientProfileUrn | string | Yes* | Recipient's LinkedIn profile URN |
message | string | Yes | Message content |
subject | string | No | Message subject (optional) |
messageType | string | No | 'normal' or 'inmail' (default: 'normal') |
conversationUrn | string | No | Required for typing indicator in existing conversations |
*Either recipientProfileId or recipientProfileUrn must be provided.
Example Request:
curl -X POST 'https://api.connectsafely.ai/linkedin/messaging/send-with-typing' \
-H 'Authorization: Bearer <your_api_key>' \
-H 'Content-Type: application/json' \
-d '{
"recipientProfileId": "john-doe-123",
"message": "Hello! I would like to connect with you.",
"conversationUrn": "urn:li:msg_conversation:(...)"
}'
Example Response:
{
"success": true,
"message": "Message sent successfully",
"recipientProfileUrn": "urn:li:fsd_profile:...",
"typingIndicatorSent": true
}
4. Send Typing Indicator
Endpoint: POST /linkedin/messaging/typing-indicator
Send a typing indicator to simulate natural conversation behavior. Creates authentic engagement patterns for automated LinkedIn messaging.
5. Send Message with Delivery Acknowledgment
Endpoint: POST /linkedin/messaging/send-with-ack
Send a LinkedIn message and receive delivery acknowledgment confirmation. Useful for tracking message delivery status in outreach campaigns.
6. Send Group Message with Typing
Endpoint: POST /linkedin/messaging/send-group-with-typing
Send a message to a LinkedIn group conversation with a typing indicator. Creates natural engagement in group discussions.
7. Send Group Message with Acknowledgment
Endpoint: POST /linkedin/messaging/send-group-with-ack
Send a message to a LinkedIn group conversation with delivery acknowledgment.
Integrating LinkedIn Messaging API with Your CRM
The LinkedIn Messaging API enables powerful CRM integrations for sales teams.
Common Integration Patterns
Sync conversations to CRM: Pull recent messages and log them as activities against contact records in HubSpot, Salesforce, or Pipedrive.
Automate follow-ups: When a prospect responds, trigger workflows that update deal stages and schedule next actions.
Track engagement: Monitor response rates and message open patterns to optimize outreach timing.
Example: HubSpot Integration
// Fetch LinkedIn conversations
const conversations = await fetch('https://api.connectsafely.ai/linkedin/messaging/recent-messages', {
headers: { 'Authorization': `Bearer ${API_KEY}` }
}).then(r => r.json());
// Log each conversation as HubSpot activity
for (const conv of conversations.conversations) {
await hubspot.engagements.create({
engagement: {
type: 'NOTE',
timestamp: conv.lastActivityAt
},
associations: {
contactIds: [findContactByLinkedIn(conv.participants[0].profileId)]
},
metadata: {
body: `LinkedIn message: ${conv.latestMessage.text}`
}
});
}
Multi-Channel Coordination
According to industry research, multi-channel campaigns achieve 31% lower cost per lead than single-channel efforts. Integrating LinkedIn messaging with email sequences creates coordinated outreach:
- Initial LinkedIn connection request
- Welcome message via LinkedIn API
- Follow-up email after 3 days
- LinkedIn re-engagement based on email opens

Why Use Typing Indicators?
LinkedIn's messaging interface shows typing indicators ("John is typing...") when users compose messages. The ConnectSafely API can send these indicators before automated messages for several benefits:
Natural Appearance
Messages preceded by typing indicators appear more human-like than instant automated responses. This improves recipient perception and engagement.
Better Deliverability
According to LinkedIn's algorithm preferences, natural engagement patterns receive better treatment than bot-like behavior.
Higher Response Rates
Messages that appear personal and thoughtfully composed typically achieve higher response rates than obviously automated outreach.
API Authentication and Security
ConnectSafely's API uses Bearer token authentication for all endpoints.
Getting Your API Key
- Sign up at ConnectSafely.ai
- Navigate to Settings → API Keys
- Generate a new API key
- Store securely—keys cannot be retrieved after creation
Request Authentication
Include your API key in the Authorization header:
curl -X GET 'https://api.connectsafely.ai/linkedin/messaging/recent-messages' \
-H 'Authorization: Bearer your_api_key_here'
Security Best Practices
- Never expose API keys in client-side code
- Rotate keys periodically
- Use environment variables for key storage
- Monitor API usage for unusual patterns
Compliance and Platform Safety
Using APIs for LinkedIn messaging requires understanding platform guidelines.
What's Allowed
According to LinkedIn's Professional Community Policies:
- Personalized, relevant outreach to connections
- Integration with legitimate business tools
- Automation that respects rate limits
- Natural engagement patterns
What's Prohibited
- Mass messaging without personalization
- Spam or unsolicited commercial messages
- Exceeding platform rate limits
- Automated activity that mimics human behavior deceptively
ConnectSafely's Compliance Approach
ConnectSafely maintains 100% platform compliance through:
- Built-in rate limiting to prevent excessive requests
- Typing indicators that create natural message patterns
- Human-like delays between automated actions
- Zero permanent bans across thousands of users
Getting Started with ConnectSafely's API
Step 1: Create an Account
Sign up at ConnectSafely.ai to access the API. Plans start at $39/month with full API access.
Step 2: Connect Your LinkedIn Account
Link your LinkedIn account through OAuth to enable API access to your conversations.
Step 3: Generate API Keys
Create API keys in the dashboard for authenticating your requests.
Step 4: Test Endpoints
Use the API documentation to test endpoints and understand response formats.
Step 5: Build Your Integration
Integrate the API with your existing CRM, sales tools, or custom workflows.
Frequently Asked Questions
How do I send a message to a LinkedIn user via API?
To send a LinkedIn message via API, use ConnectSafely's send-with-typing endpoint. Make a POST request to /linkedin/messaging/send-with-typing with the recipient's profileId, your message content, and optionally a conversationUrn for existing threads. The API sends a typing indicator first for natural appearance, then delivers your message. See our API documentation for complete request/response examples.
Does LinkedIn have a messaging API I can use?
LinkedIn's official Marketing API provides limited messaging capabilities reserved for enterprise customers. For comprehensive messaging functionality—including conversation retrieval, sending messages with typing indicators, and CRM integration—third-party solutions like ConnectSafely's LinkedIn API offer REST endpoints accessible from $39/month. The API supports all messaging operations with proper platform compliance.
Can I integrate LinkedIn messages with HubSpot or Salesforce?
Yes, integrate LinkedIn messages with HubSpot, Salesforce, Pipedrive, or any CRM using ConnectSafely's messaging API. The recent messages endpoint returns conversations with participant details, unread counts, and message previews in JSON format. Sync these to your CRM as activities against contact records. According to industry research, multi-channel campaigns achieve 31% lower cost per lead than single-channel efforts.
Is it safe to automate LinkedIn messages with an API?
Automating LinkedIn messages via API is safe when using a compliant provider. ConnectSafely maintains 100% platform compliance through built-in rate limiting, typing indicators that mimic human behavior, and natural delays between messages. The platform has zero permanent bans across thousands of users. Avoid providers that scrape or use unofficial methods—these risk account restrictions. For more on safe LinkedIn automation, see our automation safety guide.
How do I retrieve my LinkedIn conversation history via API?
Retrieve LinkedIn conversation history using ConnectSafely's conversation details endpoint. Make a GET request to /linkedin/messaging/conversation-details with the conversationUrn parameter. The response includes all messages, sender profiles with photos, attachments, reactions, and pagination tokens for long conversations. Use the recent messages endpoint to first list all conversations with their URNs.
What is the difference between InMail and regular LinkedIn messages in the API?
In ConnectSafely's API, set messageType: 'inmail' to send InMail or messageType: 'normal' (default) for regular messages. InMails reach users outside your network but require LinkedIn Sales Navigator or Premium. Regular messages only go to 1st-degree connections but are free and unlimited. Both support typing indicators and delivery acknowledgments. For inbound lead generation, building connections first often yields better response rates than cold InMails.
How do typing indicators improve LinkedIn API message delivery?
Typing indicators ("John is typing...") make automated messages appear human-like. ConnectSafely's API sends these indicators before your message, which improves perception and engagement. According to LinkedIn's algorithm preferences, natural engagement patterns receive better treatment than bot-like behavior. Messages preceded by typing indicators typically achieve higher response rates because recipients perceive them as thoughtfully composed rather than automated.
Ready to integrate LinkedIn messaging into your sales workflow? View the full API documentation or start your free trial to access the LinkedIn Messaging API and build inbound lead generation workflows.
Real Results From Real B2B Professionals
Watch real success stories from B2B professionals generating consistent inbound leads







