Search for a LinkedIn messaging API and you will find two very different things wearing the same name: an official Messages API that almost nobody can use, and a growing category of account-based APIs that power most of the LinkedIn messaging automation actually running in 2026. This guide covers both, with real endpoints and requests rather than feature lists.
By the end you will know what the official API permits, how the account-based route works end to end (send, read, reply, webhooks), what it costs, and where the real risks sit. For the broader picture of every LinkedIn API category, see our LinkedIn API guide.
Is there an official LinkedIn messaging API?
Yes, and it is worth being precise here, because a lot of articles claim no official API exists. LinkedIn documents a Messages API and an Invitation API under its Communications product. Three restrictions make it unusable for outreach. The Messages API page opens with a note: "Usage of this API is restricted to approved partners, subject to limitations via API agreement." Messaging is limited to the member's first-degree connections. And the requirements rule out automation in plain words: "A message must be associated with a specific member action. Member actions do not include an automated or scheduled event," so the member has to see the draft and press send. The reference page itself carries a 2019 date and was last touched in December 2023. There is also a separate Pages messaging API for company page inboxes, which is support tooling, not outreach.
So the official route answers a narrow question: approved partners building user-initiated messaging inside their apps. If your product needs to start conversations, follow up, or read an inbox programmatically, the official LinkedIn messaging API was never designed to let you do that.
How account-based LinkedIn messaging APIs work
Account-based providers take the opposite approach: instead of asking LinkedIn for permission, they operate real LinkedIn accounts that customers own and connect. The provider maintains the account session server-side, exposes HTTP endpoints for actions (send a message, send an InMail, read a conversation), and pushes what happens back to your app as webhook events. The model works because the actions are indistinguishable from a person using the account, which is also why account safety becomes the central engineering problem: pacing, limits, session health, and proxies decide whether the account survives.
Send a LinkedIn message with one API call
Here is what the account-based route looks like in practice, using the Swarmhit Smart API (the requests below follow the public OpenAPI specification, version 1.7.0, read on 5 October 2026). Sending a direct message to a connection is one call against the sender account:
curl -X POST "https://app.swarmhit.com/api/v1/accounts/ACCOUNT_ID/messages" \
-H "Authorization: Bearer swh_live_..." \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 8a1d3f5b-2c4e-4a6d-9b8c-7e5f1a3d2c4b" \
-d '{
"profileUrl": "https://www.linkedin.com/in/john-doe",
"text": "Thanks for connecting, John!"
}'Two details matter more than they look. The Idempotency-Key header means a network retry can never double-send a message to a prospect: the specification says reusing the key "replays the first response instead of sending again", and recommends it on every write. And the target is a profile URL, so your CRM data is enough to address someone; the API resolves the conversation. If you already hold the recipient's stable LinkedIn id from a connection.accepted or message.received webhook, passing it as providerId skips the profile lookup, which the spec flags as the slow round-trip on this path. The call also counts against the sender's daily message cap, which is where server-side pacing begins.
Read replies and close the loop
Sending is half the job. To react to answers, you subscribe a webhook endpoint to messaging events:
curl -X POST https://app.swarmhit.com/api/v1/webhooks \
-H "Authorization: Bearer swh_live_..." \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/hooks/swarmhit",
"events": ["message.received", "connection.accepted"],
"classifyReplies": true
}'When a prospect replies, your endpoint receives the event with the message text, the chat id, and the campaign context, signed with HMAC SHA-256 over the raw body in an X-Swarmhit-Signature header so you can verify it came from the API. Non-2xx responses are retried with exponential backoff, from 4 seconds to about 17 minutes, for up to 6 attempts. The same stream carries email.sent, email.received and email.bounced for the cold email channel.
{
"event": "message.received",
"workspaceId": "wJ4kQz8XrN2mYpL5d",
"createdAt": "2026-08-03T14:22:07.311Z",
"data": {
"accountId": "sN4Xq7Lm2Rw9Zk5Yp",
"chatId": "9Zp4YtLm2Rw8XqKd5",
"message": { "text": "Thanks for reaching out..." }
}
}Replying happens through the inbox endpoints: GET /inbox/chats lists conversations by most recent activity, with a replied=true filter that returns only threads where the lead has answered, GET /inbox/chats/{id}/messages reads a thread, and POST /inbox/chats/{id}/messages posts a reply as the chat's sender account, so a human can take over any conversation at any point. The full API reference covers the chat model, attachments, and reply classification.
Messages, InMails, voice notes and attachments
A messaging API worth building on covers more than plain text. Direct messages work with first-degree connections. InMails reach people outside your network and come with their own rules: the sender needs a premium LinkedIn plan (free accounts cannot send any), each send draws the sender's InMail credits except for Open Profile recipients on Sales Navigator and Recruiter seats, which are free up to a monthly allowance, the body caps at 1,900 characters, and a separate daily cap applies. On the Swarmhit API that is a distinct endpoint, POST /accounts/{id}/inmails, with the same profileUrl and Idempotency-Key pattern as messages. Voice notes and file attachments ride on message steps and on inbox replies, and they consistently stand out in crowded inboxes because almost nobody automates them. One LinkedIn constraint to design around: voice notes are not delivered on InMails, so an InMail accepts attachments only.
Rate limits and account safety
Two layers of limits exist, and conflating them is how accounts get restricted. LinkedIn acknowledges some hard rules (a weekly invitation cap whose number it does not publish, and published InMail credit budgets) but discloses no daily messaging quota; the operational numbers are operator-reported, and our LinkedIn connection limits page tracks what LinkedIn's own help pages actually say. Experienced operators keep new accounts far below what warmed accounts can send. The second layer is behavioral: sending pace, active hours, and consistency matter as much as volume.
This is the real difference between providers. Raw messaging APIs relay LinkedIn's responses and leave pacing to your code. A sequencer-grade API enforces per-sender limits server-side and schedules campaign sends inside human-like windows, so the safety layer is not something you have to write, tune, and maintain. On the Swarmhit API, for example, the 429 response documents the enforced ceilings: a daily cap per action per sender, a weekly connection-request limit of about 130 invitations for free LinkedIn accounts and 150 for paid ones (admin-configurable), and a pending-invitation backlog, each returned with limit, used, scope and resetAt so your code can back off instead of guessing.
250+
safeguards monitored 24/7 on Swarmhit's sending infrastructure
Which LinkedIn messaging API route should you build on?
The choice comes down to how much of the messaging layer you want to own. Raw APIs like Unipile give you endpoints and channel breadth, but no campaign object: sequencing, follow-up logic, and pacing are yours to build and host. A sequencer API ships that layer. We compare both models in depth in our Unipile comparison.
| Route | What you get | Pricing | Best for |
|---|---|---|---|
| Official Messages API | Partner-gated, first-degree only, no automated sends | No public pricing; access is the barrier | Approved partners only |
| Unofficial libraries (Voyager) | Reverse-engineered endpoints, no support, breaks often | Free | Experiments, never production |
| Raw messaging API (Unipile) | Send and read endpoints, webhooks, you build the sequencer and pacing | 49 EUR/month minimum incl. 10 accounts, then 5 EUR per account | Teams with engineers to own the LinkedIn layer |
| Sequencer API (Swarmhit) | Same endpoints plus campaigns, enforced limits, warm-up and safeguards built in | From $16.90 per sender a month, tiered down to $6.90 | SaaS products and agencies shipping outreach features |
For a wider comparison across seven providers, see our outreach API guide, and for what each access route really costs, our LinkedIn API pricing breakdown. And if you are choosing an end-user tool rather than an API to build on, start from our LinkedIn automation tools guide.
Sending LinkedIn messages from AI agents
The newest consumers of messaging APIs are not SaaS backends but AI agents. Through tool calling against the same authenticated REST endpoints and webhooks described above, or through an MCP server (Model Context Protocol) where a vendor offers one, an assistant like Claude can search prospects, send connection requests and messages, and triage replies in natural language. If you are evaluating a LinkedIn messaging API in 2026, agent access belongs on the checklist next to webhooks, and our LinkedIn MCP vs API guide covers when each interface fits.
Ship LinkedIn messaging in your product
Send, read and reply through one API, with campaign logic, enforced limits and 250+ safeguards handled by the infrastructure. Pricing is public and tiered, from $16.90 per sender a month.
Pricing: public, from $16.90 per LinkedIn sender a month, tiered down to $6.90; cold email from $59 a month.
FAQ
Does LinkedIn have an official messaging API?
Yes. LinkedIn documents a Messages API and an Invitation API, but access is restricted to approved partners, messaging is limited to first-degree connections, and automated sending is prohibited. That is why products that automate LinkedIn messaging use account-based APIs instead.
How do account-based messaging APIs work?
You connect LinkedIn accounts you own, the provider maintains the session server-side, and your code calls HTTP endpoints to send messages or read conversations. Replies come back as webhook events, so your app can respond in real time.
Can I automate LinkedIn messages without getting accounts banned?
Risk never reaches zero, but it is manageable when limits and pacing are enforced by the infrastructure rather than left to your code: per-sender caps, human-like sending windows, warm-up for new accounts, and monitoring. Ask any provider who enforces the limits; if the answer is you, budget for that work.
What does a LinkedIn messaging API cost?
Raw APIs price per connected account: Unipile starts at 49 EUR per month including 10 accounts, then 5 EUR per account. For sequencer-grade APIs like Swarmhit, pricing is public: LinkedIn is tiered per connected sender, from $16.90 a month for the first 50 down to $6.90 between 1,501 and 2,500 senders, and cold email starts at $59 a month for 50,000 sends.
What is the difference between a message and an InMail through the API?
A direct message requires a first-degree connection and is free. An InMail reaches people outside your network, consumes InMail credits from the sender account (Open Profile recipients excepted), and caps the body at 1,900 characters. Good messaging APIs expose both as separate endpoints on the same account.
Can you message people who are not connections through a LinkedIn messaging API?
Only as an InMail, and only from a sender with a premium LinkedIn plan, since free accounts cannot send any. Account-based APIs expose InMail as its own endpoint, it draws the sender's InMail credits except for Open Profile recipients on Sales Navigator and Recruiter seats, and it has its own daily cap. A direct message still requires an accepted connection, so most sequences send the invitation first and message once a connection.accepted event fires.
Can AI agents send LinkedIn messages?
Yes. An agent can call the same authenticated REST endpoints through tool calling, or use an MCP server where a vendor exposes one. Either way it can search prospects, send messages within the enforced limits, and read replies, while every action stays attributable to an account the customer owns.




