Facebook Pixel
APILinkedIn User

Get sent connection invitations

Retrieves sent connection invitations from LinkedIn. Returns a list of pending invitations with profile information, timestamps, and invitation IDs. Paginate with `nextStartIndex`, never by a page size of your own. LinkedIn picks the page size and has changed it under us; a client that advances by an assumed constant skips whatever the difference is, silently, on a 200. Stop on `endOfList: true`, not on an empty array — an empty page with HTTP 502 / `code: INVITATIONS_UNAVAILABLE` means LinkedIn temporarily returned nothing while the account still has pending invitations, and the request should be retried.

GET/invitations/sent
Authentication requiredUser

Code Examples

curl -X GET 'https://api.connectsafely.ai/linkedin/invitations/sent' \
-H 'Authorization: Bearer <your_api_key>'

Retrieves sent connection invitations from LinkedIn. Returns a list of pending invitations with profile information, timestamps, and invitation IDs.

Paginate with nextStartIndex, never by a page size of your own. LinkedIn picks the page size and has changed it under us; a client that advances by an assumed constant skips whatever the difference is, silently, on a 200.

Stop on endOfList: true, not on an empty array — an empty page with HTTP 502 / code: INVITATIONS_UNAVAILABLE means LinkedIn temporarily returned nothing while the account still has pending invitations, and the request should be retried.

Parameters

NameInRequiredTypeDescription
accountIdqueryNostringLinkedIn account ID to use. If not provided, uses the default account.
startIndexqueryNonumberPagination start index (0-indexed), counted in invitations. Advance using nextStartIndex from the previous response, not by a fixed step — LinkedIn chooses the page size and it is not guaranteed to be 10.

Request Body

No request body.

Responses

StatusDescription
200Sent invitations retrieved successfully
401Unauthorized - invalid or missing authentication
404No active LinkedIn account found
500Server error while fetching invitations
502Sent invitations temporarily unavailable — LinkedIn returned invitation cards at this offset that could not be read. Retryable; do NOT treat as the end of the list, and do NOT overwrite a cached list with the empty result.

200 Response Parameters

NameTypeDescription
successboolean
invitationsarray
countnumberNumber of invitations returned
endOfListbooleantrue only when this page is empty AND the payload genuinely contained no invitation cards. Paginate until this is true — never stop on an empty array alone.
startIndexnumberCurrent pagination start index
nextStartIndexnumberstartIndex for the next page: where this page ended (startIndex + count). Use this and nothing else to advance — LinkedIn chooses the page size, so advancing by an assumed constant skips records.
accountIdstringLinkedIn account ID used for the request

200 Example

{
  "success": true,
  "invitations": [
    {
      "id": "7897046780350316544",
      "invitationId": "7897046780350316544",
      "invitationUrn": "urn:li:invitation:7897046780350316544",
      "memberId": "ACoAADPy0YkBl72yFV0nJCqXd2F9OBxiI7Tvhg4",
      "memberUrn": "urn:li:fsd_profile:ACoAADPy0YkBl72yFV0nJCqXd2F9OBxiI7Tvhg4",
      "invitationType": "SENT",
      "sentAt": "2 days ago",
      "profile": {
        "firstName": "John",
        "lastName": "Doe",
        "headline": "CEO | Entrepreneur | Tech Founder",
        "profileUrl": "https://www.linkedin.com/in/johndoe",
        "publicIdentifier": "johndoe"
      }
    }
  ],
  "count": 10,
  "endOfList": false,
  "startIndex": 0,
  "accountId": "696ce9e780e0483585e4e553"
}

401 Response Parameters

NameTypeDescription
errorstring

401 Example

{
  "error": "example_value"
}

404 Response Parameters

NameTypeDescription
errorstring

404 Example

{
  "error": "example_value"
}

500 Response Parameters

NameTypeDescription
errorstring

500 Example

{
  "error": "example_value"
}

502 Example

{
  "success": false,
  "code": "INVITATIONS_UNAVAILABLE",
  "error": "Sent invitations unavailable: LinkedIn returned 10 invitation cards at startIndex 10 but none could be parsed — their card structure has changed. Retry later — do NOT treat this as the end of the list.",
  "startIndex": 10,
  "candidateCount": 10,
  "accountId": "696ce9e780e0483585e4e553"
}

Get connections list

Retrieves the list of LinkedIn connections for the authenticated user. Returns connection details including name, headline, vanity name, and connected date. Paginate with `nextStartIndex`, never by your requested `limit`. LinkedIn serves a fixed page size of its own choosing; `limit` can narrow that page but never widen it, so advancing by the limit you asked for skips whatever you did not get. Stop on `endOfList: true`, not on an empty array — an empty page with HTTP 502 / `code: CONNECTIONS_UNAVAILABLE` means LinkedIn temporarily returned nothing and the request should be retried.

Get received invitations

Retrieves received invitations from LinkedIn including connection requests, organization follow invites, and newsletter subscriptions. Returns invitation details with category classification (CONNECTION, ORGANIZATION, NEWSLETTER, EVENT, MEMBER_FOLLOW). Paginate with `nextStartIndex`, never by a page size of your own. LinkedIn picks the page size and has changed it under us; a client that advances by an assumed constant skips whatever the difference is, silently, on a 200. Stop on `endOfList: true`, not on an empty array — an empty page with HTTP 502 / `code: INVITATIONS_UNAVAILABLE` means LinkedIn temporarily returned nothing while the account still has pending invitations, and the request should be retried. `invitationCategory` lists every value the parser can emit. Which ones you actually see depends on what the account has pending — an inbox with no event invites never returns `EVENT`, and that is not a fault. To act on an invitation, pass its `invitationId`, `validationToken` and `linkedInInvitationType` to `POST /invitations/received/respond`.

On this page