Facebook Pixel
Back to Articles

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.

ConnectSafely Team

LinkedIn Messaging API

The LinkedIn Messaging API enables developers to programmatically retrieve conversations, send messages with human-like typing indicators, and integrate LinkedIn communication directly into CRM systems. ConnectSafely.ai provides a comprehensive LinkedIn Messaging API that supports retrieving recent messages, fetching conversation details, and sending messages with natural engagement patterns—all through secure REST endpoints.

LinkedIn dominates B2B lead generation with 80% of B2B social leads originating on the platform. Integrating LinkedIn messaging into your sales workflow through API access can significantly improve response times and lead tracking.

Key Takeaways

  • LinkedIn Messaging API allows CRM integration for automated outreach tracking and conversation sync
  • ConnectSafely provides 7 messaging endpoints for complete conversation management
  • Typing indicators mimic natural behavior to improve deliverability and engagement
  • Message retrieval supports pagination for handling large conversation histories
  • API-based integration is safer than browser extensions or unofficial scraping tools
  • REST API format works with any programming language or CRM platform

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.

FeatureOfficial LinkedIn APIConnectSafely API
Message retrievalLimitedFull inbox access
Send messagesEnterprise onlyAvailable
Typing indicatorsNoYes
Conversation historyLimitedComplete
CRM integrationComplexSimple REST
PricingEnterprise licensingFrom $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:

ParameterTypeRequiredDescription
accountIdstringNoLinkedIn account ID; defaults to most recently used
nextCursorstringNoPagination token from previous response
countintegerNoConversations to return (default: 20, max: 100)
keywordsstringNoFilter by keywords in participants or messages
readbooleanNoFilter 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:

ParameterTypeRequiredDescription
accountIdstringNoLinkedIn account ID
conversationUrnstringYesConversation 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
  }
}

LinkedIn API Integration

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:

FieldTypeRequiredDescription
accountIdstringNoLinkedIn account ID
recipientProfileIdstringYes*Recipient's LinkedIn profile ID
recipientProfileUrnstringYes*Recipient's LinkedIn profile URN
messagestringYesMessage content
subjectstringNoMessage subject (optional)
messageTypestringNo'normal' or 'inmail' (default: 'normal')
conversationUrnstringNoRequired 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:

  1. Initial LinkedIn connection request
  2. Welcome message via LinkedIn API
  3. Follow-up email after 3 days
  4. LinkedIn re-engagement based on email opens

LinkedIn CRM Integration

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

  1. Sign up at ConnectSafely.ai
  2. Navigate to Settings → API Keys
  3. Generate a new API key
  4. 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

Does LinkedIn have a public messaging API?

LinkedIn's official Marketing API provides limited messaging capabilities primarily for enterprise customers. For broader messaging functionality including conversation retrieval and automated sending, third-party solutions like ConnectSafely's API offer more comprehensive access with endpoints for recent messages, conversation details, and sending with typing indicators.

How do I send LinkedIn messages via API?

Send LinkedIn messages via API using ConnectSafely's send-with-typing endpoint. Make a POST request with recipient profile ID, message content, and optionally a conversation URN. The API sends a typing indicator first for natural appearance, then delivers your message.

Can I integrate LinkedIn messages with my CRM?

Yes, integrate LinkedIn messages with your CRM using ConnectSafely's messaging API. The recent messages endpoint retrieves conversations with participant details and message previews that can be synced to HubSpot, Salesforce, Pipedrive, or other CRM systems through standard REST API calls.

Is using a LinkedIn messaging API safe for my account?

Using a LinkedIn messaging API is safe when the provider follows platform guidelines. ConnectSafely maintains 100% compliance with built-in rate limiting, typing indicators, and human-like delays. The platform has zero permanent bans across thousands of users because it respects LinkedIn's terms of service.

How do I get LinkedIn conversation history via API?

Get LinkedIn conversation history via ConnectSafely's conversation details endpoint. Send a GET request with the conversation URN to retrieve all messages, sender profiles, attachments, and reactions. The response includes pagination for handling long conversation histories.

What's the difference between LinkedIn InMail and regular messages in the API?

In ConnectSafely's API, specify messageType: 'inmail' for InMail or messageType: 'normal' for regular messages. InMails reach users outside your network (requires Sales Navigator or Premium) while regular messages go to connections only. Both support typing indicators and delivery acknowledgments through the API.


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.

Ready to Transform Your LinkedIn Strategy?

Stop chasing leads. Start attracting them with ConnectSafely.ai's inbound lead generation platform.

Get Started Free

See How ConnectSafely Works

Watch real success stories from B2B professionals generating consistent inbound leads

240%
increase in profile views
10-20
inbound leads per month
8+
hours saved per week
$30-45K
new business attributed

Ready to get more engagement on LinkedIn?

Boost your posts with real people, auto-comment on other people's posts, and connect with industry leaders. All automatically.

ConnectSafely.ai LinkedIn inbound lead generation dashboard showing strategic engagement automation, AI-powered commenting, and creator targeting features