Facebook Pixel
APILinkedIn Messaging

Get Recent LinkedIn Messages - LinkedIn Messaging API

Retrieve recent LinkedIn messages and conversations via API for automated outreach tracking. This LinkedIn messaging API endpoint returns your inbox conversations with participant details, unread counts, and latest message previews. Perfect for CRM integration, sales automation workflows, and building multi-step outreach sequences. Supports pagination to efficiently fetch all LinkedIn direct messages for lead nurturing and follow-up automation.

GET/linkedin/messaging/recent-messages

Get Recent LinkedIn Messages - LinkedIn Messaging API

Retrieve recent LinkedIn messages and conversations via API for automated outreach tracking. This LinkedIn messaging API endpoint returns your inbox conversations with participant details, unread counts, and latest message previews. Perfect for CRM integration, sales automation workflows, and building multi-step outreach sequences. Supports pagination to efficiently fetch all LinkedIn direct messages for lead nurturing and follow-up automation.

Authentication requiredLinkedIn Messaging

Code Examples

curl -X GET 'https://api.connectsafely.ai/linkedin/messaging/recent-messages' \
-H 'Authorization: Bearer <your_api_key>' \

Parameters

NameInRequiredTypeDescription
accountIdqueryNostringLinkedIn account ID. If not provided, uses the default account (most recently used).
nextCursorqueryNostringCursor token for pagination. Use the nextCursor value from the previous response to fetch the next page of conversations.
countqueryNointegerNumber of conversations to return (default: 20, max: 100).
keywordsqueryNostringFilter conversations by keywords. Searches within conversation participants, messages, and subject lines. Case-insensitive partial matching.
readqueryNobooleanFilter conversations by read status. Use true for read conversations, false for unread conversations. When omitted, returns all conversations regardless of read status.

Request Body

No request body.

Responses

StatusDescription
200Successful response
500Error response

200 Example

{
  "success": true,
  "accountId": "507f1f77bcf86cd799439011",
  "profileUrn": "urn:li:fsd_profile:ACoAABcn...",
  "total": 3,
  "nextCursor": "xqS2pdVm4vDq0NZmLnVybjpsaTpmYWJyaWM6cHJvZC1sb3IxAA==",
  "conversations": [
    {
      "conversationId": "urn:li:messagingThread:...",
      "conversationUrn": "urn:li:msg_conversation:...",
      "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",
        "hasAttachment": false
      }
    }
  ]
}

500 Example

{
  "success": false,
  "error": "Failed to get recent messages"
}