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

How to build authority that attracts leads
Content strategies that generate inbound
Engagement tactics that trigger algorithms
Systems for consistent lead flow

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-typing with recipientProfileId and message parameters—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.

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

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.

About the Author

ConnectSafely Team

LinkedIn Marketing Experts

The ConnectSafely Team consists of LinkedIn marketing specialists, growth strategists, and automation experts dedicated to helping professionals build authentic authority on LinkedIn. With years of experience in B2B lead generation and social selling, we share insights to help you attract qualified prospects without cold outreach.

LinkedIn MarketingB2B Lead GenerationSocial SellingPersonal Branding

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.

How to build authority that attracts leads
Content strategies that generate inbound
Engagement tactics that trigger algorithms
Systems for consistent lead flow

No spam. Just proven strategies for B2B lead generation.

Ready to Transform Your LinkedIn Strategy?

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

Get Started Free

Real Results From Real B2B Professionals

Watch real success stories from B2B professionals generating consistent inbound leads

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