Facebook Pixel
APILinkedIn Actions

LinkedIn Actions API

Programmatic follow, messaging, and connection workflows for LinkedIn.

LinkedIn Actions API

Automate LinkedIn outreach directly from the ConnectSafely API. Build personalized connection workflows, send messages at scale, and manage professional relationships programmatically.

Capabilities

  • Follow/Unfollow: Build network visibility without connection requests
  • Direct Messages: Send messages to 1st-degree connections or InMail to others
  • Connection Requests: Send personalized connection requests (300 char limit)
  • Relationship Status: Check connection degree and available actions for any profile
  • Reply to Comments: Engage with post comments programmatically

Endpoints

Click on any endpoint below to view detailed documentation, parameters, example requests, and try it live.

Follow User →

POST /linkedin/follow

Follow a LinkedIn user to see their posts in your feed. Following doesn't require a connection request and increases your visibility to the target user.


Send Message →

POST /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.


Send Connection Request →

POST /linkedin/connect

Send a personalized connection request to a LinkedIn member. Note: Connection request messages have a 300 character limit.


Check Relationship →

GET /linkedin/relationship/{profileId}

Check the relationship status between your account and a target profile. Returns connection degree (1st, 2nd, 3rd+), follow status, and available actions.


Reply to Comment →

POST /linkedin/reply

Post a reply to an existing comment on a LinkedIn post. Replies appear threaded under the original comment.


Use Cases

Sales Prospecting

Build automated sequences that check relationship status, send connection requests to 2nd-degree connections, and follow up with personalized messages after connection acceptance.

Recruitment Outreach

Scale candidate outreach by programmatically sending InMail to promising candidates identified through LinkedIn Search, with personalized messages based on their profile data.

Influencer Engagement

Strategically follow industry leaders and engage with their content to increase visibility. Use the reply endpoint to participate in conversations on high-visibility posts.

Account-Based Marketing

Target decision-makers at specific companies by checking relationships, sending connection requests with relevant context, and nurturing connections through thoughtful engagement.

Best Practices

  1. Check relationship first: Before sending messages, verify the connection degree to choose the right approach
  2. Personalize connection requests: Generic requests have low acceptance rates - reference something specific
  3. Respect rate limits: LinkedIn monitors activity patterns - avoid high-volume actions in short periods
  4. Use InMail strategically: Premium InMail credits are limited - target high-value prospects
  5. Follow before connecting: Following first increases familiarity and connection acceptance rates

Quick Start

// Check relationship and send appropriate message
const relationship = await fetch(
  `https://api.connectsafely.ai/linkedin/relationship/john-doe-123`,
  { headers: { 'Authorization': `Bearer ${API_KEY}` } }
);

const { connectionDegree } = await relationship.json();

if (connectionDegree === 'DISTANCE_1') {
  // Direct message to 1st degree connection
  await fetch('https://api.connectsafely.ai/linkedin/message', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      recipientProfileId: 'john-doe-123',
      message: 'Hi John, great connecting with you!'
    })
  });
} else {
  // Send connection request to non-connections
  await fetch('https://api.connectsafely.ai/linkedin/connect', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      profileId: 'john-doe-123',
      message: 'Hi John, I noticed your work at Acme Inc...'
    })
  });
}

No-Code Alternatives

Prefer visual automation? Use these integrations: