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.
/linkedin/messaging/recent-messagesGet 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.
Code Examples
curl -X GET 'https://api.connectsafely.ai/linkedin/messaging/recent-messages' \ -H 'Authorization: Bearer <your_api_key>' \Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
accountId | query | No | string | LinkedIn account ID. If not provided, uses the default account (most recently used). |
nextCursor | query | No | string | Cursor token for pagination. Use the nextCursor value from the previous response to fetch the next page of conversations. |
count | query | No | integer | Number of conversations to return (default: 20, max: 100). |
keywords | query | No | string | Filter conversations by keywords. Searches within conversation participants, messages, and subject lines. Case-insensitive partial matching. |
read | query | No | boolean | Filter 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
| Status | Description |
|---|---|
| 200 | Successful response |
| 500 | Error 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"
}LinkedIn Messaging API - Send Messages & Manage Conversations
LinkedIn Messaging API for automated outreach. Send LinkedIn messages via API, retrieve conversations, and build multi-step outreach sequences for sales automation and lead generation.
Get LinkedIn Conversation Details - LinkedIn API Messages
Fetch complete LinkedIn conversation history and message details via API. This LinkedIn API messages endpoint retrieves full conversation threads including all direct messages, sender profiles, attachments, and reactions. Essential for sales automation tools, AI agents handling LinkedIn outreach, and CRM systems that need to sync LinkedIn messaging data. Use this endpoint to build automated follow-up sequences, track lead engagement, and manage multi-step B2B outreach campaigns.
