LinkedIn API for AI agents: what the options are
If you want an AI agent to read or send LinkedIn messages, there are two very different routes: LinkedIn's own Messages API, or connecting your own account through a tool like Spaces. This guide sets out what LinkedIn says about each, what each route means for a small business in practice, and how to use an agent on LinkedIn without treating your inbox like a mailing list.
Why this matters for a small business
For many owners, LinkedIn is where the warmest conversations happen. A past client asks if you have room for a new project, a supplier checks in about an order, or someone who saw your post asks what you charge. Those messages are easy to miss on a busy day, and a slow reply can cost you the work.
An AI agent such as Claude, ChatGPT or Grok can help by reading your inbox, telling you who is waiting, and drafting replies in your voice. To do that, the agent needs a way in. On LinkedIn there are only two ways in, and they come with very different rules.
Route 1: LinkedIn's Messages API
LinkedIn's Messages API documentation on Microsoft Learn says: "Usage of this API is restricted to approved partners, subject to limitations via API agreement." The same page lists requirements. Among them:
- A message must be associated with a specific member action. Member actions do not include an automated or scheduled event.
- Members must opt in to sending a message, and must be given a choice about whether to send it.
- If the app proposes a pre-prepared message, the member must be able to edit the subject, body and attachments, and must take an affirmative action to send it.
- A message must be posted at, or around, the time the member took action.
In plain words, this route is for software companies that LinkedIn has accepted as partners. Even then, the person has to choose to send each message, be able to edit it, and press send around the time they decide to. An agent that answers on its own, or sends a message at a set time, does not fit those requirements.
For most small businesses, that makes the Messages API an unrealistic starting point. You would need to become an approved partner first, and the rules are written for apps where a person presses send, not for an agent that works through your inbox for you.
Route 2: connecting your own account
Tools like Spaces connect your own LinkedIn account by signing in, so your agent can read and reply through an MCP server or REST API. LinkedIn's User Agreement section 8.2 prohibits using "bots or other unauthorized automated methods" to send messages, add contacts, or create, comment on, like or share posts. LinkedIn's help page on prohibited software says members using such tools "risk having their accounts restricted or shut down."
This route is quick to set up, and it works with the account and the connections you already have. The trade-off is risk. Your agent acts as you, inside your own account, and LinkedIn's rules still apply to everything it does. Spaces does not change those rules, and it cannot promise how LinkedIn will treat your account.
That is why the way you use this route matters so much. Reading your inbox and drafting replies for you to check is a very different thing from an agent firing off connection requests and messages to strangers all day.
The two routes side by side
| LinkedIn's Messages API | Your own account through Spaces | |
|---|---|---|
| Who can use it | Approved partners, under an API agreement | Anyone with a LinkedIn account and a Spaces plan |
| Who presses send | The member, after choosing to send and being able to edit | Your agent, or you if you only let it draft |
| Automated or scheduled sends | Not a member action under LinkedIn's requirements | Possible, but LinkedIn's User Agreement prohibits unauthorized automated methods |
| Setting up | Partner application and agreement | Sign in through a secure link, then add the MCP server to your agent |
| What it covers | Messages | Inbox, replies, new chats, profiles, invitations, search, posts, comments and reactions |
| Risk to your account | Governed by the partner agreement | Restriction or shutdown is possible, and it is yours to manage |
What Spaces does
Spaces gives your agent the inbox, replies, new chats and profile lookups on a LinkedIn account you own. It also covers invitations, search, posts, comments and reactions. Spaces enforces its own per-account limits for every key, and every send is safe to retry. Spaces' Terms forbid bulk unsolicited messages and cold outreach at scale.
These are the LinkedIn tools listed in the Spaces docs:
- Read: list chats, read messages and download attachments.
- Reply in an existing chat, or start a chat with someone you know. A normal message goes to a 1st-degree connection, and anyone else needs a connection request or an InMail.
- Look up a profile. On LinkedIn, each lookup counts as a profile view.
- Send, list and withdraw connection requests.
- Search people or companies.
- Read posts and comments, and publish a post, comment or react.
- Receive a webhook for every new message, so the agent hears about it straight away.
What good use looks like
Here is an example of the kind of conversation Spaces is built for. A client who already knows you writes in, and the agent drafts a reply for the owner to check. Names and details are examples.
| Who | Message |
|---|---|
| Priya (past client) | Hi Tom, we're planning our year-end accounts. Do you have capacity in January? |
| Agent (to Tom) | Priya from Harbour Design is asking about January capacity for year-end accounts. Your notes say January is half booked. Shall I offer a call next week? |
| Tom | Yes, offer Tuesday or Thursday afternoon. |
| Agent (to Priya) | Hi Priya, lovely to hear from you. January is filling up, but we can fit you in. Would Tuesday or Thursday afternoon next week suit you for a quick call? |
| Priya | Thursday at 2 works. |
| Agent (to Tom) | Priya booked Thursday at 2pm. I've added a note to the chat. |
Notice what the agent did not do. It did not message anyone new, it did not send a sales pitch, and it checked with Tom before it committed his time. That is the shape to aim for.
What to avoid on LinkedIn
- Sending connection requests to long lists of strangers, with or without a note.
- Messaging people from a bought or scraped list. Spaces' Terms forbid it.
- Sending the same message to many people. Spaces refuses the same cold text sent to many people.
- Following up with someone who has not replied, over and over. Leave it after one polite nudge.
- Carrying on after someone says stop. Spaces refuses later sends in that chat.
- Trying to work around a limit, for example by reconnecting the account to reset counters.
The limits Spaces keeps on LinkedIn
LinkedIn does not publish a safe daily number. These are Spaces' own limits for each LinkedIn account, enforced on every key and every agent, however the agent is prompted. They are not a promise about how LinkedIn will treat your account.
| What | Spaces' limit |
|---|---|
| Gap between messages | At least 20 seconds |
| Messages | 100 a day |
| New chats | 8 an hour and 30 a day, after warm-up |
| New chats while warming up | Week 1: 2 an hour and 8 a day. Week 2: 4 an hour and 15 a day. Weeks 3 and 4: 6 an hour and 20 a day |
| Connection requests | 5 an hour, 20 a day and 100 a week (5 a day in week 1) |
| Profile views | 80 a day |
| Searches | 30 a day |
| Comments, reactions and posts | 30 comments, 50 reactions and 3 posts a day |
Replies in an existing chat are not held back by the warm-up. When the agent reaches a limit, Spaces answers with a short wait time and nothing is sent. The agent tries again later with the same message, and it is never sent twice.
Which route suits you
| If you | Then |
|---|---|
| Are building a product that LinkedIn members use, where each person presses send | Look at LinkedIn's partner programme and the Messages API requirements. |
| Want an agent to keep on top of your own inbox and draft replies | Connecting your own account can work. Start with a read-only or draft-only setup and read the caveat box first. |
| Want to message hundreds of new people a week | Neither route is right. Spaces' Terms forbid cold outreach at scale, and LinkedIn's rules prohibit it too. |
| Are unsure about the risk to your account | Keep the agent to reading and summarising, and press send yourself. |
How to set up Spaces for LinkedIn
- Sign up with your email and the 6-digit code Spaces sends. An agent can do this for you through the onboarding MCP server at https://api.spacesos.com/mcp/start.
- Add a card at checkout. Don't connect an account until checkout is finished.
- Connect LinkedIn: open the connect link (create_messaging_connect_link with "channel": "linkedin") and sign in.
- Create an API key. It starts with spc_live_ and is shown only once, so store it safely.
- Add the LinkedIn MCP server https://api.spacesos.com/mcp/linkedin to your agent, or call the REST API at https://api.spacesos.com/v1. The server at https://api.spacesos.com/mcp covers every channel.
Your agent can do most of this for you. Ask it to follow the instructions at https://www.spacesos.com/llms.txt, and it will ask you for the code Spaces emails you and send you links to add a card and sign in to LinkedIn.
Notes to give your agent
An agent behaves best when it knows your rules. Paste something like this into its instructions, and change the details to suit your business:
You look after my LinkedIn inbox for my bookkeeping practice.
- Only reply to people who have messaged me first.
- Never send connection requests or start new chats unless I ask.
- Show me every reply before you send it.
- If someone asks about fees, offer a short call instead of quoting.
- If someone says stop or not interested, thank them and do not message again.
- Keep replies short, friendly and in British English.Summing up
LinkedIn's Messages API is for approved partners, and every message has to come from a member's own action. Connecting your own account is the practical route for a small business, but LinkedIn's User Agreement prohibits unauthorized automated methods, so the risk to your account is real.
If you choose to connect, use the agent for the conversations people start with you, keep a person in the loop for anything that matters, and let Spaces' limits do their job. Read the caveat box at the top of this page before you decide.
Who you message
Pricing
FAQ
Can anyone use LinkedIn's Messages API?
No. LinkedIn's documentation says usage of the Messages API is restricted to approved partners, subject to limitations via API agreement. For most small businesses that rules it out as a starting point.
Does LinkedIn's Messages API allow automated sending?
LinkedIn's documentation says a message must be associated with a specific member action, and that member actions do not include an automated or scheduled event. The member must also be able to edit a pre-prepared message and take an affirmative action to send it.
What does LinkedIn say about third-party automation tools?
LinkedIn's User Agreement section 8.2 prohibits bots or other unauthorized automated methods to send messages and other actions, and LinkedIn says members using such tools risk having their accounts restricted or shut down. That applies whichever tool you use.
Is Spaces affiliated with LinkedIn?
No. Spaces connects your own account by signing in and is not affiliated with LinkedIn. Using Spaces does not change LinkedIn's rules, and any restriction on your account is yours to manage.
Can my agent message people who are not my connections?
A normal LinkedIn message goes to a 1st-degree connection. Anyone else needs a connection request or an InMail. Use both only for people who know you, because Spaces' Terms forbid cold outreach at scale.
Can I let the agent read my inbox without sending anything?
Yes. Give the agent a read-only key and it can list chats, read messages and summarise them, but it cannot send. This is the lowest-risk way to start.
What happens when my agent hits one of Spaces' limits?
Spaces answers with a short wait time and nothing is sent. The agent waits and tries again with the same message, which is never sent twice. Daily limits reset the next day.