ApiLinkedin messaging
Send Message
Send a direct message to a LinkedIn user
POST
/linkedin/messaging/sendSend Message
Send a direct message to a LinkedIn user. A simpler alternative to the typing indicator variant.
Authentication requiredLinkedIn Messaging
Code Examples
curl -X POST 'https://api.connectsafely.ai/linkedin/messaging/send' \ -H 'Authorization: Bearer <your_api_key>' \ -H 'Content-Type: application/json' \ -d '{ "recipientProfileId": "john-doe-123", "message": "Hello! I would like to connect with you." }'Parameters
No parameters.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
accountId | string | No | LinkedIn account ID (uses default if not provided) |
recipientProfileId | string | Yes* | Recipient's LinkedIn profile ID (required if recipientProfileUrn not provided) |
recipientProfileUrn | string | Yes* | Recipient's LinkedIn profile URN (required if recipientProfileId not provided) |
message | string | Yes | Message content to send |
subject | string | No | Message subject (for InMail messages) |
messageType | string | No | Message type: 'normal' or 'inmail' (default: 'normal') |
* Either recipientProfileId or recipientProfileUrn must be provided.
Example
{
"recipientProfileId": "john-doe-123",
"message": "Hello! I would like to connect with you."
}Example with InMail
{
"recipientProfileId": "john-doe-123",
"message": "I came across your profile and would love to discuss a potential opportunity.",
"subject": "Exciting Opportunity",
"messageType": "inmail"
}Responses
| Status | Description |
|---|---|
| 200 | Successful response |
200 Example
{
"success": true,
"message": "Message sent successfully",
"recipientProfileUrn": "urn:li:fsd_profile:ACoAAA..."
}Usage Notes
- Connection Required: For normal messages, you must be connected to the recipient
- InMail: Use
messageType: 'inmail'for non-connections (requires InMail credits) - Rate Limits: LinkedIn has limits on daily messages - use responsibly
- Typing Indicator: For more natural messaging, use
/messaging/send-with-typing
