Get conversation messages
Retrieve messages for a specific conversation. Auto-detects Sales Navigator thread URNs (urn:li:salesNav_thread:*) and routes to the Sales Nav API. Standard conversations use DB-first with LinkedIn API fallback for older messages via cursor pagination. Replaces GET /messaging/conversation-details.
/conversations/{conversationUrn}/messagesCode Examples
curl -X GET 'https://api.connectsafely.ai/linkedin/conversations/<conversationUrn>/messages' \ -H 'Authorization: Bearer <your_api_key>'Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
conversationUrn | path | Yes | string | Conversation URN (URL-encoded) |
accountId | query | No | string | LinkedIn account ID |
count | query | No | number | Number of messages |
cursor | query | No | string | Timestamp cursor for older messages |
since | query | No | number | Timestamp to fetch messages newer than (polling) |
sync | query | No | boolean | Wait for LinkedIn response (sync mode) |
Request Body
No request body.
Responses
| Status | Description |
|---|---|
| 200 | Messages list |
| 401 | Unauthorized |
| 404 | Conversation not found |
| 500 | Server error |
200 Response Parameters
| Name | Type | Description |
|---|---|---|
success | boolean | |
messages | array | |
participants | array | |
hasMore | boolean | |
cursor | string | |
note | string |
200 Example
{
"success": true,
"messages": [
{
"messageUrn": "Hello! I would like to connect with you.",
"text": "example_value",
"sentAt": 0,
"senderProfileId": "john-doe-123",
"senderName": "example_value",
"senderPhoto": "example_value",
"isSentByOwner": false,
"hasAttachment": false,
"attachments": []
}
],
"participants": [
{
"profileId": "john-doe-123",
"name": "example_value",
"headline": "example_value",
"profilePicture": "example_value"
}
],
"hasMore": true,
"cursor": "example_value",
"note": "example_value"
}401 Response Parameters
| Name | Type | Description |
|---|---|---|
error | string |
401 Example
{
"error": "example_value"
}404 Response Parameters
| Name | Type | Description |
|---|---|---|
error | string |
404 Example
{
"error": "example_value"
}500 Response Parameters
| Name | Type | Description |
|---|---|---|
error | string |
500 Example
{
"error": "example_value"
}Check if a conversation exists with a profile
Check whether the authenticated LinkedIn account already has an existing conversation with a target profile. Returns the conversation URN if one exists. Single LinkedIn API call (no message history fetched). Useful as a precheck before sending a connection request or message to avoid duplicate outreach.
Send message (with channel selection)
Send a LinkedIn message. By default, messagingChannel is "auto" which auto-detects whether to use Sales Navigator or standard LinkedIn inbox based on the account premium status. Users can explicitly control the messaging channel by setting messagingChannel to: "sales_navigator" — forces the message through the Sales Navigator API (returns a 400 error if the account does not have an active Sales Navigator subscription), or "linkedin_inbox" — forces standard LinkedIn messaging even if the account has Sales Navigator. Example: to send via standard inbox on a Sales Nav account, pass { "messagingChannel": "linkedin_inbox" }. To explicitly use Sales Navigator, pass { "messagingChannel": "sales_navigator" }. If omitted or set to "auto", the system decides automatically. Supports file attachments.
