LinkedIn API endpoint

LinkedIn connection request API: invites from code

Swarmhit's LinkedIn connection request API sends an invitation from a connected sender with one POST to /accounts/{id}/connections, with an optional note of up to 300 characters from premium senders. A connection.accepted webhook fires when the lead accepts. In campaigns, the invite step branches on Accepted and can withdraw requests that sit unanswered for too long.

Endpoints

  • POST/accounts/{id}/connections

    Send a connection request

  • GET/accounts/{id}/connections/{identifier}

    Check connection status

  • DELETE/accounts/{id}/connections/{identifier}

    Withdraw a pending request

POST

/accounts/{id}/connections

api/v1
curl -X POST https://app.swarmhit.com/api/v1/accounts/acc_123/connections \
  -H "Authorization: Bearer $SWARMHIT_API_KEY" \
  -H "Idempotency-Key: 6f1c2f3e-invite-ana" \
  -H "Content-Type: application/json" \
  -d '{
    "profileUrl": "https://www.linkedin.com/in/ana-lopez",
    "note": "Hi Ana, I work on outbound for B2B SaaS teams. Happy to connect."
  }'

How the LinkedIn connection request API works

  • Swarmhit adds the note for premium senders, up to 300 characters (longer notes are trimmed). Free sender accounts send the same invitation without the note.
  • The profile is tracked as a lead, and connection.accepted fires when it accepts, carrying the stable providerId you can reuse to message the new connection without another lookup.
  • GET /accounts/{id}/connections/{identifier} tells you whether the profile is not_connected, pending or connected before you act, without registering a view. DELETE on the same path withdraws a pending request and is safe to call when nothing is pending.

As a campaign step

The same action runs inside sequences as the invite step: one POST /campaigns sets up the whole sequence, and the engine schedules each step per sender and mailbox, inside the sending window, with rotation across senders.

  • The invite step takes a note and a fallbackNote, and its Accepted branch is where follow-up messages go. Up to five note variants rotate evenly across leads.
  • Set withdrawEnabled with withdrawDays (1 to 365, 25 by default) and requests that stay unanswered are withdrawn automatically, which keeps each sender's pending backlog healthy.

Limits and safety

  • LinkedIn enforces a weekly invitation limit it does not publish. Swarmhit caps each sender on its side, by default about 130 invitations a week for free accounts and 150 for paid ones, plus a daily cap and a ceiling on pending invitations.
  • Past a limit the API answers 429 with details { limit, used, scope }, where scope is day, week or pending, plus resetAt for the day and week caps. A request to a profile that already has a pending invitation returns 409.
  • Each sender runs on its own dedicated proxy with managed warmup and health checks, behind 250+ safeguards monitored 24/7.

LinkedIn senders cost $16.90 a month each for the first 50, tiered down to $6.90, with no minimum. See pricing.

Webhooks

Events to subscribe to: connection.accepted, lead.status_changed. Deliveries are signed and retried. How LinkedIn webhooks work

Going deeper: LinkedIn connection limits.

LinkedIn connection request API, answered

What weekly cap does Swarmhit apply to connection requests?

LinkedIn limits invitations per account per week without publishing the number. Swarmhit applies its own caps per sender, by default about 130 a week for free accounts and 150 for paid ones, plus a daily cap and a pending-invitation ceiling. The API returns a 429 with the scope when a sender reaches one of them.

Can I add a note to a connection request through the API?

Yes, with the note field, up to 300 characters, from premium senders. Free sender accounts send the invitation without the note rather than failing. In campaigns, a fallbackNote covers leads whose variables are missing.

How do I know when a connection request is accepted?

Subscribe a webhook to connection.accepted. Swarmhit posts the event when the lead accepts, signed with an HMAC-SHA256 signature, and includes the lead's stable LinkedIn id so your next message skips the profile lookup.

Can I withdraw pending LinkedIn invitations?

Yes. DELETE /accounts/{id}/connections/{identifier} withdraws a pending request, and campaign invite steps can withdraw automatically after a number of days you choose, 25 by default. Withdrawing stale invites keeps the sender's acceptance rate and pending backlog in good shape.

More LinkedIn API endpoints

  • Sequencer built in
  • 250+ safeguards monitored 24/7
  • REST API and signed webhooks

Send a connection request from your product.
Safeguards included.

Get an API key, connect a sender through a hosted link, and make your first call in minutes.