APILinkedIn Messaging
Send message (auto-detects Sales Navigator)
Send a LinkedIn message. Auto-detects Sales Navigator accounts and routes through Sales Nav API. Supports file attachments.
POST
/conversations/sendAuthentication requiredConversations
Code Examples
curl -X POST 'https://api.connectsafely.ai/linkedin/conversations/send' \ -H 'Authorization: Bearer <your_api_key>' \ -H 'Content-Type: application/json' \ -d '{"accountId":"acc_12345","recipientProfileId":"john-doe-123","conversationUrn":"urn:li:example:123456","message":"Hello! I would like to connect with you.","subject":"Quick question about your work","attachments":[]}'Parameters
No parameters.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
accountId | string | No | LinkedIn account ID |
recipientProfileId | string | Conditional | Recipient public profile ID Either recipientProfileId or recipientProfileUrn must be provided. |
recipientProfileUrn | string | Conditional | Recipient profile URN Either recipientProfileUrn or recipientProfileId must be provided. |
conversationUrn | string | No | Existing conversation URN (skips recipient lookup) |
message | string | Yes | Message text |
subject | string | No | Message subject (optional) |
attachments | array | No | File attachments from upload-attachment endpoint |
Example
{
"message": "Hello! I would like to connect with you."
}Responses
| Status | Description |
|---|---|
| 200 | Message sent |
| 400 | Bad request or send failed |
| 401 | Unauthorized |
| 404 | Account not found |
| 500 | Server error |
200 Response Parameters
| Name | Type | Description |
|---|---|---|
success | boolean | |
message | string | |
recipientProfileUrn | string | |
sentMessage | object | |
threadId | string | Sales Navigator thread ID (only for Sales Nav accounts) |
200 Example
{
"success": true,
"message": "Hello! I would like to connect with you.",
"recipientProfileUrn": "urn:li:fsd_profile:ACoAABcdefgh",
"sentMessage": {},
"threadId": "12345"
}400 Response Parameters
| Name | Type | Description |
|---|---|---|
error | string |
400 Example
{
"error": "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"
}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.
Upload message attachment
Upload a file attachment for use in a LinkedIn message.
