100 free credits. No credit card required. Get a key

LinkedIn send message API

Sends a message from your connected account: into an existing conversation, or to people you are connected with (a new conversation).

POST /v1/linkedin/accounts/{account}/messagesBeta5 credits per callRefunded on failure
import os, requests

res = requests.post(
    "https://api.groundsocial.dev/v1/linkedin/accounts/csn_01JDX9EXAMPLE0000000000/messages",
    headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()
Response
200 · 5 credits

No bundled sample for this call. The response is a LinkedInMessageSent; its fields are listed below.

Parameters

NameTypeDescription
accountpath · requiredstringThe id of the LinkedIn account you connected (from GET /v1/linkedin/accounts). Example: csn_01JDX9EXAMPLE0000000000.
Response fields

200 with a LinkedInMessageSent, in LinkedIn’s own schema.org JSON-LD, with the rest of the public page beside it.

FieldTypeDescription
accountstringThe connected account id (csn_…).
senttrue
chat_idstring | null
message_urnstring | null
delivered_atstring | nullISO 8601 time, or null.
Status codes
StatusMeaning
200The message was sent.
400Invalid input. Nothing was charged.
401Missing or invalid API key.
402Not enough credits, a spend cap was reached, or payment is required.
403The target is private, or the account is suspended.
404LinkedIn has no such public page, or it was removed.
429Too many requests. Wait for Retry-After seconds.
503LinkedIn is temporarily unavailable. Retryable; nothing was charged.

Every error has code, message, hint and retryable. All error codes

Questions

Whose LinkedIn account does it use?

Only one you connected yourself with POST /v1/linkedin/accounts (your session’s cookies, never your password), and only with your API key. Someone else’s account id answers 404, an account LinkedIn asked for a security check answers 403 until you reconnect it.

Are there limits?

Yes, per connected account, to keep it in good standing with LinkedIn: invitations 25 a day and 100 a week, messages 60 a day, InMail 25 a day, comments 30 a day, reactions 60 a day, posts 5 a day, and every request at least 4 seconds apart, 400 a day. Over a limit answers 429 rate_limited with Retry-After and is never charged.

People I am not connected with?

LinkedIn lets members message only their connections; use the InMail endpoint (Sales Navigator) for others.

LinkedIn is a trademark of LinkedIn Corporation. We are not affiliated with or endorsed by LinkedIn.