APILinkedIn Messaging
Get recent messages
Retrieve recent LinkedIn messages/conversations for the authenticated account. Supports filtering by keywords and read status. Returns simplified conversation list with latest message preview. Rate limit: 150 messages per day per account.
GET
/messaging/recent-messagesAuthentication requiredMessaging
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 to use. If not provided, uses the default account. |
nextCursor | query | No | string | Cursor for pagination from previous response |
count | query | No | number | Number of conversations to return |
keywords | query | No | string | Search keywords to filter conversations |
read | query | No | string | Filter by read status: "true" or "false" |
Request Body
No request body.
Responses
| Status | Description |
|---|---|
| 200 | Recent messages retrieved successfully |
| 401 | Unauthorized - Invalid or missing API key |
| 500 | Server error |
200 Response Parameters
| Name | Type | Description |
|---|---|---|
success | boolean | |
accountId | string | |
profileUrn | string | |
conversations | array | |
total | number | |
nextCursor | string |
200 Example
{
"success": true,
"accountId": "696ce9e780e0483585e4e553",
"profileUrn": "urn:li:fsd_profile:ACoAAATPlQ0Bc8wdg-Iy8wZgEDuSdIVWJiE1Aio",
"conversations": [
{
"conversationId": "2-ODFkYjU4M2ItZDlmYS00YTVjLThlNTQtZjI5YTE4ZWUyZDk5XzEwMA==",
"conversationUrn": "urn:li:msg_conversation:(urn:li:fsd_profile:ACoAAATPlQ0Bc8wdg-Iy8wZgEDuSdIVWJiE1Aio,2-ODFkYjU4M2ItZDlmYS00YTVjLThlNTQtZjI5YTE4ZWUyZDk5XzEwMA==)",
"backendConversationUrn": "urn:li:messagingThread:2-ODFkYjU4M2ItZDlmYS00YTVjLThlNTQtZjI5YTE4ZWUyZDk5XzEwMA==",
"conversationUrl": "https://www.linkedin.com/messaging/thread/2-ODFkYjU4M2ItZDlmYS00YTVjLThlNTQtZjI5YTE4ZWUyZDk5XzEwMA==/",
"participants": [
{
"profileId": "ACoAADSoo60BM6hxemTbnN2aA_Z1-WlNFRhRYhU",
"name": "John Doe",
"headline": "Software Engineer at Tech Company",
"profileUrl": "https://www.linkedin.com/in/ACoAADSoo60BM6hxemTbnN2aA_Z1-WlNFRhRYhU",
"profilePicture": "https://media.licdn.com/dms/image/...",
"distance": "DISTANCE_1",
"memberBadgeType": null,
"participantUrn": "urn:li:msg_messagingParticipant:urn:li:fsd_profile:ACoAADSoo60BM6hxemTbnN2aA_Z1-WlNFRhRYhU",
"backendUrn": "urn:li:member:883467181",
"hostIdentityUrn": "urn:li:fsd_profile:ACoAADSoo60BM6hxemTbnN2aA_Z1-WlNFRhRYhU"
}
],
"unreadCount": 0,
"lastActivityAt": 1771950346603,
"createdAt": 1771317337868,
"lastReadAt": 1771950726332,
"isRead": true,
"state": null,
"latestMessage": {
"messageUrn": "urn:li:msg_message:(urn:li:fsd_profile:ACoAAATPlQ0Bc8wdg-Iy8wZgEDuSdIVWJiE1Aio,2-MTc3MTk1MDM0NjYwM2I5NzY0NS0xMDA=)",
"backendMessageUrn": "urn:li:messagingMessage:2-MTc3MTk1MDM0NjYwM2I5NzY0NS0xMDA=",
"text": "Hello, how are you?",
"sentAt": 1771950346603,
"senderName": "John Doe",
"senderProfileUrl": "https://www.linkedin.com/in/ACoAADSoo60BM6hxemTbnN2aA_Z1-WlNFRhRYhU",
"senderUrn": "urn:li:msg_messagingParticipant:urn:li:fsd_profile:ACoAADSoo60BM6hxemTbnN2aA_Z1-WlNFRhRYhU",
"hasAttachment": false
}
}
]
}401 Example
{
"error": "Unauthorized - Invalid credentials"
}500 Example
{
"error": "Failed to get LinkedIn authentication credentials",
"success": false
}LinkedIn Messaging API
Send LinkedIn messages via API, retrieve conversations, and build automated outreach sequences.
Get conversation details
Retrieve detailed message history for a specific LinkedIn conversation. Supports pagination via deliveredAt timestamp to load older/newer messages. Returns full message content, sender info, and timestamps.
