Skip to content
Docs

Relations And Invitations

Connections, sent invitations, sending and withdrawing invitations, and LinkedIn's refusals.

Relations#

The account's connections, newest first.

Shell
curl -sS "https://direct.lempile.com/api/v1/users/relations?account_id=$ACCOUNT_ID&limit=100" \
  -H "X-API-KEY: $DIRECT_API_KEY"
JSON
{
  "object": "UserRelationsList",
  "items": [
    {
      "object": "UserRelation",
      "first_name": "Bob",
      "last_name": "Buyer",
      "headline": "Head of Sales",
      "public_identifier": "bob-buyer",
      "public_profile_url": "https://www.linkedin.com/in/bob-buyer/",
      "created_at": 1761000000000,
      "member_id": "ACoAAAzyxwvutsrqponml",
      "member_urn": "urn:li:fsd_profile:ACoAAAzyxwvutsrqponml",
      "connection_urn": "urn:li:fsd_connection:ACoAAAzyxwvutsrqponml",
      "profile_picture_url": "https://media.licdn.com/dms/image/x/400.jpg"
    }
  ],
  "cursor": "eyJrIjoicmVsYXRpb25zIiwicyI6MTAwfQ"
}
  • limit: 1 to 1,000 (default 100). LinkedIn gives 100 a call, so a page of 1,000 costs 10 calls.
  • member_id is the relation's provider id: what writes take as provider_id or attendees_ids.
  • created_at is when the connection was made, in milliseconds.
  • filter (search relations by name) answers 501.
  • New relations also arrive as the users webhook new_relation (see Webhooks).

Followers#

The account's followers, newest first, as My Network → Followers lists them.

Shell
curl -sS "https://direct.lempile.com/api/v1/users/followers?account_id=$ACCOUNT_ID&limit=100" \
  -H "X-API-KEY: $DIRECT_API_KEY"
JSON
{
  "object": "UserFollowersList",
  "items": [
    {
      "object": "UserFollower",
      "id": "ACoAAAfollower00000000",
      "urn": "urn:li:fsd_profile:ACoAAAfollower00000000",
      "name": "Follower 0",
      "headline": "Founder at Example 0",
      "profile_url": "https://www.linkedin.com/in/ACoAAAfollower00000000",
      "profile_picture_url": "https://media.licdn.com/dms/image/f0/100.jpg",
      "profile_picture_url_large": "https://media.licdn.com/dms/image/f0/800.jpg"
    }
  ],
  "cursor": "<cursor>"
}
  • One LinkedIn call a page; limit 1 to 100 (default 100). LinkedIn may answer a few less than asked; the next page starts after the ones asked, as Unipile's.
  • user_id: the account's own provider id is its own list; another member's answers an empty list (LinkedIn shows a member's follower count, never the list, to another account; Unipile answers the same); a company's answers 501.
  • GET /users/following answers Unipile's own 501 for LinkedIn (errors/feature_not_implemented, "Missing feature").

Sent Invitations#

Invitations the account sent that are still waiting, newest first.

Shell
curl -sS "https://direct.lempile.com/api/v1/users/invite/sent?account_id=$ACCOUNT_ID&limit=100" \
  -H "X-API-KEY: $DIRECT_API_KEY"
JSON
{
  "object": "InvitationList",
  "items": [
    {
      "object": "InvitationSent",
      "id": "7300000000000000001",
      "invited_user": "Bob Buyer",
      "invited_user_id": "ACoAAAzyxwvutsrqponml",
      "invited_user_public_id": "bob-buyer",
      "invited_user_description": "Founder",
      "date": "2025-10-24T10:00:00.000Z",
      "parsed_datetime": "2025-10-24T10:00:00.000Z",
      "invitation_text": "Hi Bob",
      "specifics": { "provider": "LINKEDIN", "shared_secret": "<shared_secret>" },
      "inviter": {
        "inviter_name": "Ada Sender",
        "inviter_id": "ACoAAAbcdefghijklmnop",
        "inviter_public_identifier": "ada-sender",
        "inviter_description": "Founder"
      }
    }
  ],
  "cursor": null
}

limit: 1 to 100 (default 10).

Send An Invitation#

Shell
curl -sS -X POST "https://direct.lempile.com/api/v1/users/invite" \
  -H "X-API-KEY: $DIRECT_API_KEY" \
  -H "Idempotency-Key: invite-bob-1" \
  -H "Content-Type: application/json" \
  -d '{
    "account_id": "'"$ACCOUNT_ID"'",
    "provider_id": "ACoAAAzyxwvutsrqponml",
    "message": "Hi Bob, good to meet you at the meetup."
  }'
JSON
{ "object": "UserInvitationSent", "invitation_id": "7300000000000000002" }
Field
account_id The account that invites (or ?account_id=).
provider_id The person: provider id, public identifier or profile URL.
message Optional note, 300 characters at most.
user_email Optional: the person's email address, when LinkedIn asks for it.

Direct reads the person's profile first (one call), because LinkedIn itself accepts an invitation to someone already connected. Then it sends the invitation (one write). Status 200, as Unipile.

Refusal Status type
Already a connection 422 errors/already_connected
An invitation from the account is already waiting 422 errors/already_invited_recently
The account itself, or someone whose invitation to the account is waiting (accept theirs instead) 422 errors/cannot_invite_attendee
No profile with this id 422 errors/invalid_recipient
LinkedIn's weekly invitation limit, or a withdrawn invitation sent again too soon 422 errors/cannot_resend_yet
Too many invitations waiting for an answer 422 errors/limit_exceeded
The account's connection limit 422 errors/connection_limit_reached
LinkedIn wants the account to confirm its email address 403 errors/action_required

invitation_id is empty when LinkedIn's answer didn't name the new invitation; it then appears in GET /users/invite/sent.

Withdraw An Invitation#

Shell
curl -sS -X DELETE "https://direct.lempile.com/api/v1/users/invite/sent/7300000000000000001?account_id=$ACCOUNT_ID" \
  -H "X-API-KEY: $DIRECT_API_KEY"
JSON
{ "object": "InvitationCanceled" }
  • Direct finds the invitation among the account's latest 100 sent (one read), then withdraws it. One not among them answers 404.
  • LinkedIn then blocks a new invitation to that person for about 3 weeks (errors/cannot_resend_yet).

Both writes take ?dry_run=true and an Idempotency-Key (see Errors And Limits).

Received Invitations#

Shell
curl -sS "https://direct.lempile.com/api/v1/users/invite/received?account_id=$ACCOUNT_ID&limit=10" \
  -H "X-API-KEY: $DIRECT_API_KEY"
JSON
{
  "object": "InvitationList",
  "items": [
    {
      "object": "InvitationReceived",
      "id": "7400000000000000000",
      "invited_user": "Ada Sender",
      "invited_user_id": "ACoAAAbcdefghijklmnop",
      "invited_user_public_id": "ada-sender",
      "invited_user_description": "Founder",
      "date": "2025-10-24T10:00:00.000Z",
      "parsed_datetime": "2025-10-24T10:00:00.000Z",
      "invitation_text": "Hi Ada, let's connect",
      "inviter": { "inviter_name": "Bob Buyer", "inviter_id": "ACoAAAzyxwvutsrqponml", "inviter_public_identifier": "bob-buyer", "inviter_description": "CTO" },
      "specifics": { "provider": "LINKEDIN", "shared_secret": "s3cret0" }
    }
  ],
  "cursor": null
}

Invitations waiting for the account's answer, newest first: inviter is who sent it, invited_user the account itself.

Accept Or Decline One#

Shell
curl -sS -X POST "https://direct.lempile.com/api/v1/users/invite/received/7400000000000000000" \
  -H "X-API-KEY: $DIRECT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "provider": "LINKEDIN", "account_id": "'"$ACCOUNT_ID"'", "action": "accept", "shared_secret": "s3cret0" }'
JSON
{ "object": "UserInvitationHandled", "status": "ACCEPTED" }
  • action: accept, or decline (LinkedIn's Ignore: the inviter isn't told). shared_secret is the invitation's specifics.shared_secret.
  • Direct finds the invitation among the account's latest 100 received (one read) first: one not among them answers 404, a shared_secret that isn't its own 400.
  • LinkedIn's connection limit answers 422 errors/connection_limit_reached. It takes ?dry_run=true and an Idempotency-Key, as every write.

Was this page helpful?