# How to automate LinkedIn leads via API
> Connect AI clients like Claude and ChatGPT to LinkedIn using MCP servers and REST APIs to find, score, and manage B2B leads programmatically.
- HTML: https://getkinlead.com/linkedin-outreach-api-automation
- Markdown: https://getkinlead.com/linkedin-outreach-api-automation.md

**Short answer:** To automate LinkedIn lead generation via API, use a middleware layer that handles authentication and rate limits through a REST API or MCP server. This lets AI clients like Claude or ChatGPT search for profiles, score leads, and monitor replies.

## Why you can't call LinkedIn's API directly

If you try to use the official LinkedIn API for outbound sales, you hit a wall. That API is built for marketing partners, recruiting tools and app integrations. It requires an app review, and it does not expose profile search or let you send personal connection requests.

An agent API sits between your script or AI client and LinkedIn. It performs searches and messages through a provider that handles the session, so you get the data you need for sales without a partnership agreement.

The tradeoff is responsibility. You are still using a LinkedIn account, and LinkedIn can push back on any account. Read the provider's limits and keep your own caps.

**Official API**

- Requires corporate app approval
- Strictly limits profile data access
- No ability to automate personal invites

**Agent API**

- Works via API keys or OAuth
- Accesses search and profile data
- Automates connection requests and messages

> An agent API is not a loophole in LinkedIn's terms. It is a way to run the same manual actions from a script, and the account risk stays with you.

## Setting up an MCP server for AI clients

MCP (Model Context Protocol) lets an AI client call external tools. Instead of copying profile URLs into a chat, the client calls a server that searches LinkedIn and returns structured leads.

Most MCP clients take a JSON config file. Chat apps usually connect with OAuth, while scripts use API keys. Check which one your server supports before you start.

1. **Install an MCP client.** Download and install a client that supports MCP, such as Claude Desktop or the Cursor code editor.
2. **Configure the server.** Open your client's configuration file, usually a JSON file in the app data folder, and add the MCP server endpoint provided by your lead gen tool.
3. **Set environment variables.** Add your API key to the environment variables in the config file so the AI can authenticate your requests.
4. **Restart and test.** Restart the application. You will see new tools in the AI's interface for searching leads or checking replies.

## Structuring your lead search prompt

An AI agent returns what you describe. If you ask for 'experienced managers', you get a mix of people who do not buy. Use exact titles, company size, location and a signal that shows intent.

The signal matters more than the title. A head of product who posted about pricing is a better lead than one who has not. Tell the agent to keep the post URL and the comment so you can check the context.

Scoring is where the API earns its keep. A lead score from 0 to 100 against your profile lets you drop weak matches before they reach a campaign. Set a fit line and keep it fixed for a month so you can compare results.

```
Find 20 leads who are 'Head of Product' or 'VP of Product' at B2B SaaS companies with 11-50 employees located in New York or San Francisco. Only keep leads who have posted about 'product led growth' in the last 30 days. For each lead, return the profile URL, the post URL and a one-line reason they match.
```

## Automating the reply check loop

Replies are the part most people stop checking. An API call can pull new messages and classify them by intent: interested, not now, not a fit, referral.

Classification is not the same as a reply. Decide in advance whether the AI replies on its own, replies until there is real interest, or hands the thread to you at the first reply. Each mode fits a different sales motion.

If you want to read every reply before it sends, use hand-off mode. There is no approval step in the AI reply modes.

- **you:** Check my LinkedIn inbox for new replies from the Q3 Outreach campaign.
- **draft:** Found 3 new replies. Sarah from Acme Corp is 'Interested' and asked about pricing. Mark from Northwind is 'Not a fit'. Jane from GlobalTech is 'Interested' and wants a demo.
- **them:** This looks relevant. Can you send a few times for a call next week?
- **you:** Draft a response to Sarah and Jane using my scheduling link and mention their recent post about AI efficiency.

> Never let an AI answer a pricing question without a real number or a booking link. Hand off the thread when the buyer asks for terms.

## Keeping the account inside its limits

LinkedIn does not publish exact invite or message limits. Anyone who gives you a number is guessing or repeating a guess. What you can control is your own cap, your send window and the pace between actions.

Watch pending invitations. A large pending pool is one signal that an account is being pushed. Withdraw stale invites and slow down before you see a warning.

When LinkedIn pushes back, pause invites on that account. Keep messages manual for a few days and check the account in a browser.

| | Signal | What it tells you | What to do |
| --- | --- | --- | --- |
| Pending invites rising | People are not accepting, and the pool is filling up | Withdraw the oldest invites and lower the daily cap |
| Acceptance rate falling | The note or the profile is not matching the audience | Rewrite the first line and check the lead score |
| Warning in settings | LinkedIn is limiting the account | Pause invites and messages, then review the account manually |
| Replies dropping | The message is weak or the audience is wrong | Read the last 20 sent messages and cut the generic lines |

> Set a daily invite cap you can defend and a send window in the lead's time zone. If you cannot explain the cap to a colleague, it is too high.

## Doing this with Kinlead

Kinlead has a REST Agent API and an MCP server, so Claude, ChatGPT, Cursor, Claude Code, Codex and other MCP clients can find leads, check replies and draft answers. Chat apps connect with OAuth, scripts use API keys.

Lead search uses LinkedIn's standard search, so a Sales Navigator seat is not required. Kinlead finds people matching the customer you describe or your website and scores each lead from 0 to 100. Leads below the fit line are not kept.

Outreach runs from your own LinkedIn account through Unipile. Kinlead never stores the password. Each account sends at most one action every 5 minutes, inside daily invite and message limits you set and inside a send window in the lead's time zone.

Queued messages can be edited on the Actions page before they send, and any campaign can be paused. Replies land in one inbox classified by intent, with interested replies first. The [MCP integrations](/integrations/mcp) page covers the client setup.

> Pro costs $49 a month after a 7-day free trial. A card is needed to start the trial, nothing is charged that day, and you can cancel any time in Settings.

## Related

- [MCP integrations](https://getkinlead.com/integrations/mcp.md)
- [AI agent API](https://getkinlead.com/features/agent-api-and-mcp.md)
- [Lead scoring setup](https://getkinlead.com/ai-lead-scoring-fit-line-setup.md)

## Common questions

**Do I need a Sales Navigator account to use a lead gen API?**

No. Lead search can run on LinkedIn's standard search, so a Sales Navigator seat is not required.

**How does an MCP server differ from a standard REST API?**

A REST API is for scripts and apps to exchange data. An MCP server lets AI clients like Claude use those API tools directly in the chat interface.

**Can I send unlimited connection requests through an API?**

No. LinkedIn does not publish exact invite or message limits. Any tool that ignores limits raises risk, so set daily caps and a send window you can defend.

**Will using an API get my LinkedIn account banned?**

No tool can guarantee an account will not be restricted. To reduce risk, use tools that send at a human pace and respect daily limits.

[Create a Kinlead account](https://getkinlead.com/signup) or [book a call](https://getkinlead.com/demo) to talk through pricing and setup.
