Facebook Pixel
APILinkedIn Messaging

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.

GET/linkedin/messaging/conversation-details

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.

Authentication requiredLinkedIn Messaging

Code Examples

curl -X GET 'https://api.connectsafely.ai/linkedin/messaging/conversation-details?conversationUrn=urn%3Ali%3Amsg_conversation%3A%28urn%3Ali%3Afsd_profile%3AACoAABcn...%2C2-abc123%29' \
-H 'Authorization: Bearer <your_api_key>'

Parameters

NameInRequiredTypeDescription
accountIdqueryNostringLinkedIn account ID. If not provided, uses the default account (most recently used).
conversationUrnqueryYesstringThe conversation URN. Can be in various formats - urn:li:msg_conversation:(...), urn:li:msg_message:(...), urn:li:messagingThread:(...), or just the conversation ID.

Request Body

No request body.

Responses

StatusDescription
200Successful response
401Unauthorized
500Error response

200 Example

{
  "success": true,
  "accountId": "507f1f77bcf86cd799439011",
  "profileUrn": "urn:li:fsd_profile:ACoAABpGQcMBI08myTal7qDJ5zb9lJiM24nFjJI",
  "conversationUrn": "urn:li:msg_conversation:(urn:li:fsd_profile:ACoAABpGQcMBI08myTal7qDJ5zb9lJiM24nFjJI,2-YTlkMzliMTAtMjA4Zi00ODc4LTgxZDgtZTI4ZDY0Zjg1YTE4XzEwMA==)",
  "total": 11,
  "syncToken": "xqS2pdVm4vDq0NZmLnVybjpsaTpmYWJyaWM6cHJvZC1sb3IxAA==",
  "messages": [
    {
      "messageId": "urn:li:msg_message:(urn:li:fsd_profile:ACoAABpGQcMBI08myTal7qDJ5zb9lJiM24nFjJI,2-MTc2MzM3ODA2Mjg4MWI0MTM0My0xMDAmYTlkMzliMTAtMjA4Zi00ODc4LTgxZDgtZTI4ZDY0Zjg1YTE4XzEwMA==)",
      "backendMessageUrn": "urn:li:messagingMessage:2-MTc2MzM3ODA2Mjg4MWI0MTM0My0xMDAmYTlkMzliMTAtMjA4Zi00ODc4LTgxZDgtZTI4ZDY0Zjg1YTE4XzEwMA==",
      "text": "No problem. I have connected my account .. haven't seen any action yet. But I will let you know how the solution performs ",
      "subject": null,
      "sentAt": 1763378062881,
      "sender": {
        "profileId": "ACoAACr-hewBS7g6tYN16g77Gx5Cuvm0hJPUfNM",
        "name": "Leonard Esere",
        "profileUrl": "https://www.linkedin.com/in/ACoAACr-hewBS7g6tYN16g77Gx5Cuvm0hJPUfNM",
        "profilePicture": "https://media.licdn.com/dms/image/v2/D5603AQEZqV0sUFSb5g/profile-displayphoto-scale_100_100/...",
        "participantUrn": "urn:li:msg_messagingParticipant:urn:li:fsd_profile:ACoAACr-hewBS7g6tYN16g77Gx5Cuvm0hJPUfNM"
      },
      "attachments": null,
      "reactions": null,
      "hasAttachment": false
    },
    {
      "messageId": "urn:li:msg_message:(urn:li:fsd_profile:ACoAABpGQcMBI08myTal7qDJ5zb9lJiM24nFjJI,2-MTc2Mzc5NDI5NTI1N2IxNzUzMS0xMDAmYTlkMzliMTAtMjA4Zi00ODc4LTgxZDgtZTI4ZDY0Zjg1YTE4XzEwMA==)",
      "backendMessageUrn": "urn:li:messagingMessage:2-MTc2Mzc5NDI5NTI1N2IxNzUzMS0xMDAmYTlkMzliMTAtMjA4Zi00ODc4LTgxZDgtZTI4ZDY0Zjg1YTE4XzEwMA==",
      "text": "I just tried that post boost, and I'm seeing it post comments too fast...",
      "subject": null,
      "sentAt": 1763794295257,
      "sender": {
        "profileId": "ACoAACr-hewBS7g6tYN16g77Gx5Cuvm0hJPUfNM",
        "name": "Leonard Esere",
        "profileUrl": "https://www.linkedin.com/in/ACoAACr-hewBS7g6tYN16g77Gx5Cuvm0hJPUfNM",
        "profilePicture": "https://media.licdn.com/dms/image/v2/D5603AQEZqV0sUFSb5g/profile-displayphoto-scale_100_100/...",
        "participantUrn": "urn:li:msg_messagingParticipant:urn:li:fsd_profile:ACoAACr-hewBS7g6tYN16g77Gx5Cuvm0hJPUfNM"
      },
      "attachments": [
        {
          "type": "image",
          "url": "https://www.linkedin.com/dms/prv/image/v2/D5606AQHX0OcdYQAgkQ/messaging-image-720/..."
        }
      ],
      "reactions": null,
      "hasAttachment": true
    },
    {
      "messageId": "urn:li:msg_message:(urn:li:fsd_profile:ACoAABpGQcMBI08myTal7qDJ5zb9lJiM24nFjJI,2-MTc2Mzc5MzIzNjgzM2I4Mzg5Mi0xMDAmYTlkMzliMTAtMjA4Zi00ODc4LTgxZDgtZTI4ZDY0Zjg1YTE4XzEwMA==)",
      "backendMessageUrn": "urn:li:messagingMessage:2-MTc2Mzc5MzIzNjgzM2I4Mzg5Mi0xMDAmYTlkMzliMTAtMjA4Zi00ODc4LTgxZDgtZTI4ZDY0Zjg1YTE4XzEwMA==",
      "text": "Thanks for highlighting ",
      "subject": null,
      "sentAt": 1763793236833,
      "sender": {
        "profileId": "ACoAABpGQcMBI08myTal7qDJ5zb9lJiM24nFjJI",
        "name": "Karan Kumar",
        "profileUrl": "https://www.linkedin.com/in/ACoAABpGQcMBI08myTal7qDJ5zb9lJiM24nFjJI",
        "profilePicture": "https://media.licdn.com/dms/image/v2/D5635AQFZJPJdhr2MqA/profile-framedphoto-shrink_100_100/...",
        "participantUrn": "urn:li:msg_messagingParticipant:urn:li:fsd_profile:ACoAABpGQcMBI08myTal7qDJ5zb9lJiM24nFjJI"
      },
      "attachments": null,
      "reactions": [
        {
          "emoji": "👍",
          "count": 1,
          "viewerReacted": false
        }
      ],
      "hasAttachment": false
    }
  ],
  "participants": [
    {
      "profileId": "ACoAACr-hewBS7g6tYN16g77Gx5Cuvm0hJPUfNM",
      "name": "Leonard Esere",
      "headline": "Founder & CEO @ PolicyCortex | Building the Autonomous Cloud Engineer",
      "profileUrl": "https://www.linkedin.com/in/ACoAACr-hewBS7g6tYN16g77Gx5Cuvm0hJPUfNM",
      "profilePicture": "https://media.licdn.com/dms/image/v2/D5603AQEZqV0sUFSb5g/profile-displayphoto-scale_100_100/...",
      "participantUrn": "urn:li:msg_messagingParticipant:urn:li:fsd_profile:ACoAACr-hewBS7g6tYN16g77Gx5Cuvm0hJPUfNM",
      "memberBadgeType": "PREMIUM_PROFILE"
    }
  ],
  "pagination": {
    "firstMessageAt": 1763350991696,
    "lastMessageAt": 1763794357096,
    "hasMoreBefore": true,
    "hasMoreAfter": false
  }
}

401 Example

{
  "error": "Unauthorized"
}

Note: When using pagination parameters (deliveredAt, countBefore, countAfter), the response may include nextCursor and prevCursor for navigating to more messages. Use hasNextPage and hasPrevPage to determine if there are more messages available in each direction.

500 Example

{
  "success": false,
  "error": "Failed to get conversation details"
}