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.
/conversations/sendCode 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":[],"messagingChannel":"auto"}'Parameters
No parameters.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
accountId | string | No | LinkedIn account ID |
recipientProfileId | string | Conditional | Recipient LinkedIn profile vanity URL slug (e.g., "john-doe-123"). Prefer recipientProfileUrn when available. Either recipientProfileId or recipientProfileUrn must be provided. |
recipientProfileUrn | string | Conditional | Recipient LinkedIn profile URN (e.g., "urn:li:fsd_profile:ACoAABJefVoBrz2LR3f..."). Preferred over recipientProfileId. 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 |
messagingChannel | string | No | Controls which messaging channel to use. Defaults to "auto" if not provided. Options: "auto" — automatically detects the best channel based on account premium status (Sales Navigator accounts use Sales Nav API, others use standard inbox). "sales_navigator" — explicitly send via Sales Navigator API. Use this when the user wants to send through Sales Navigator. Returns a 400 error with a clear message if the account does not have Sales Navigator. "linkedin_inbox" — explicitly send via standard LinkedIn inbox. Use this when the user wants to bypass Sales Navigator and send through the regular LinkedIn messaging, even if the account has a Sales Navigator subscription. |
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.
