Facebook Pixel
APILinkedIn Actions

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. Either profileId or profileUrn must be provided. Rate limit: 90 connection requests per week per LinkedIn account (resets every Monday at midnight UTC). Exceeding the limit puts the account on hold for 24 hours.

POST/connect
Authentication requiredActions

Code Examples

curl -X POST 'https://api.connectsafely.ai/linkedin/connect' \
-H 'Authorization: Bearer <your_api_key>' \
-H 'Content-Type: application/json' \
-d '{"accountId":"acc_12345","profileId":"john-doe-123","customMessage":"Hello! I would like to connect with you."}'

Parameters

No parameters.

Request Body

FieldTypeRequiredDescription
accountIdstringNoLinkedIn account ID to use. If not provided, uses the default account.
profileIdstringConditionalTarget LinkedIn profile public ID (e.g., "john-doe-123"). Either this or profileUrn is required. Either profileId or profileUrn must be provided.
profileUrnstringConditionalTarget LinkedIn profile URN (e.g., "urn:li:fsd_profile:ABC123"). Either this or profileId is required. Either profileUrn or profileId must be provided.
customMessagestringNoPersonalized connection message (max 300 characters). Leave empty for default request.

Example

{
  "accountId": "acc_12345",
  "profileId": "john-doe-123",
  "customMessage": "Hi John, I would love to connect with you!"
}

Responses

StatusDescription
200Connection request sent successfully
400Bad request - Missing required fields or already connected
401Unauthorized - Invalid or missing API key
404Profile not found
429Rate limit exceeded - Connection requests blocked for 24 hours (other activities remain unaffected)

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
messagestringStatus message
profileUrnstringLinkedIn URN of the target profile

200 Example

{
  "success": true,
  "message": "Connection request sent successfully",
  "profileUrn": "urn:li:fsd_profile:ACoAAA24A-MBVEvT49xpVF2gnWrhvmUIPDJshSM"
}

400 Response Parameters

NameTypeDescription
errorstring

400 Example

{
  "error": "Either profileId or profileUrn must be provided",
  "success": false
}

401 Response Parameters

NameTypeDescription
errorstring

401 Example

{
  "error": "Unauthorized"
}

404 Response Parameters

NameTypeDescription
errorstring

404 Example

{
  "error": "LinkedIn profile not found: invalid-profile-id",
  "success": false
}

429 Response Parameters

NameTypeDescription
errorstringError message describing the rate limit
successboolean
holdUntilstring (date-time)Connection requests blocked until this time
weeklyResetstring (date-time)When the weekly limit resets

429 Example

{
  "error": "Connection request limit exceeded: 90/90 used. New connection requests blocked for 24 hours. Other activities (messaging, following, etc.) are not affected.",
  "success": false,
  "holdUntil": "2024-01-16T10:30:00.000Z",
  "weeklyReset": "2024-01-22T00:00:00.000Z"
}