Send a LinkedIn message
Send a direct message to a LinkedIn member. Supports regular messages (requires 1st-degree connection) and InMail (for non-connections, requires Premium). Can also send messages in group context. Provide either recipientProfileId or recipientProfileUrn.
/messageSend a LinkedIn message
Send a direct message to a LinkedIn member. Supports regular messages (requires 1st-degree connection) and InMail (for non-connections, requires Premium). Can also send messages in group context. Provide either recipientProfileId or recipientProfileUrn.
Code Examples
curl -X POST 'https://api.connectsafely.ai/linkedin/message' \ -H 'Authorization: Bearer <your_api_key>' \ -H 'Content-Type: application/json' \ -d '{"message":"Hello! I would like to connect with you."}'Parameters
No parameters.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
accountId | string | No | LinkedIn account ID to use. If not provided, uses the default account. |
recipientProfileId | string | No | Recipient LinkedIn profile public ID (e.g., "john-doe-123") |
recipientProfileUrn | string | No | Recipient LinkedIn profile URN (e.g., "urn:li:fsd_profile:ABC123") |
message | string | Yes | Message content to send. Supports basic formatting. |
subject | string | No | Subject line (required for InMail, optional for regular messages) |
messageType | string | No | Message type: normal (1st-degree connections) or inmail (non-connections, requires Premium credits) |
groupId | string | No | Group ID to send message in group context (enables messaging non-connections who are group members) |
Example
{
"message": "Hello! I would like to connect with you."
}Responses
| Status | Description |
|---|---|
| 200 | Message sent successfully |
Follow or unfollow a LinkedIn profile
Follow or unfollow a LinkedIn member to see their posts in your feed. Following does not require a connection. Provide either profileId (public identifier) or profileUrn (internal URN). Following builds your network visibility without sending connection requests.
Send a connection request
Send a connection request to a LinkedIn member to become 1st-degree connections. Optionally include a personalized message (300 character limit). Connection requests with custom messages have higher acceptance rates. Provide either profileId or profileUrn.
