Facebook Pixel
APILinkedIn Messaging

Send message with group context

Send a LinkedIn message to someone using group membership context. Allows messaging non-connections who are members of the same LinkedIn group without using InMail credits. Rate limit: 150 messages per day per account.

POST/messaging/send-group
Authentication requiredMessaging

Code Examples

curl -X POST 'https://api.connectsafely.ai/linkedin/messaging/send-group' \
-H 'Authorization: Bearer <your_api_key>' \
-H 'Content-Type: application/json' \
-d '{"recipientProfileUrn":"urn:li:fsd_profile:ACoAAFpqSoMB8vTqRbg4mN_wbabO8w0gjgFu-6o","groupId":"12345678","message":"Hello fellow group member!"}'

Parameters

No parameters.

Request Body

FieldTypeRequiredDescription
accountIdstringNoLinkedIn account ID to use. If not provided, uses the default account.
recipientProfileUrnstringYesRecipient LinkedIn profile URN (e.g., "urn:li:fsd_profile:ACoAABJefVoBrz2LR3f..."). Preferred over recipientProfileId.
groupIdstringYesLinkedIn group ID that both sender and recipient are members of
messagestringYesMessage content to send

Example

{
  "recipientProfileUrn": "urn:li:fsd_profile:ACoAAFpqSoMB8vTqRbg4mN_wbabO8w0gjgFu-6o",
  "groupId": "12345678",
  "message": "Hello fellow group member!"
}

Responses

StatusDescription
200Group context message sent successfully
400Bad request - Missing required parameter
401Unauthorized - Invalid or missing API key
403Forbidden - Not authorized to message this user via group
429Rate limit exceeded
500Server error

Rate Limit Headers

All responses include rate limit information in the headers:

HeaderDescription
X-RateLimit-ActionThe action type being rate limited
X-RateLimit-LimitMaximum actions allowed per period
X-RateLimit-UsedActions used in current period
X-RateLimit-RemainingActions remaining
X-RateLimit-ResetISO 8601 timestamp when limit resets

200 Response Parameters

NameTypeDescription
successboolean
messagestring
recipientProfileUrnstring
groupIdstring

200 Example

{
  "success": true,
  "message": "Group context message sent successfully",
  "recipientProfileUrn": "urn:li:fsd_profile:ACoAAFpqSoMB8vTqRbg4mN_wbabO8w0gjgFu-6o",
  "groupId": "12345678"
}

400 Response Parameters

NameTypeDescription
successboolean
errorobject

400 Example

{
  "success": false,
  "error": "recipientProfileUrn, groupId, and message are required"
}

401 Example

{
  "error": "Unauthorized - Invalid credentials"
}

403 Example

{
  "success": false,
  "message": "Error sending group context message: Request failed with status code 403",
  "recipientProfileUrn": "urn:li:fsd_profile:ACoAAFpqSoMB8vTqRbg4mN_wbabO8w0gjgFu-6o",
  "groupId": "12345678",
  "errorDetails": {
    "status": 403,
    "statusText": "Forbidden",
    "data": {
      "code": "UNAUTHORIZED_VIEWER",
      "message": "The viewer is not authorized to access this resource"
    }
  }
}

429 Response Parameters

NameTypeDescription
errorstring
successboolean

429 Example

{
  "error": "Rate limit exceeded for MESSAGE: 150/150 used",
  "success": false
}

500 Example

{
  "error": "Failed to get LinkedIn authentication credentials",
  "success": false
}