Facebook Pixel
APILinkedIn Actions

Withdraw a sent connection invitation

Withdraws a pending connection invitation that was previously sent to a LinkedIn user. Only the profileId is required - other fields will be auto-fetched from the profile if not provided. The API will verify that a pending invitation exists before attempting withdrawal.

POST/invitations/withdraw
Authentication requiredActions

Code Examples

curl -X POST 'https://api.connectsafely.ai/linkedin/invitations/withdraw' \
-H 'Authorization: Bearer <your_api_key>' \
-H 'Content-Type: application/json' \
-d '{"accountId":"acc_12345","profileId":"john-doe-123","memberId":"12345","firstName":"example_value","lastName":"example_value","invitationId":"12345"}'

Parameters

No parameters.

Request Body

FieldTypeRequiredDescription
accountIdstringNoLinkedIn account ID to use. If not provided, uses the default account.
profileIdstringYesLinkedIn profile public identifier (vanity name) of the person whose invitation to withdraw. This is the only required field. Either profileId or profileUrn must be provided.
memberIdstringNoLinkedIn member ID (ACoAAA format). Optional - will be auto-fetched from profile if not provided.
firstNamestringNoFirst name of the person. Optional - will be auto-fetched from profile if not provided.
lastNamestringNoLast name of the person. Optional - will be auto-fetched from profile if not provided.
profileUrnstringConditionalLinkedIn profile URN. Optional - will be auto-fetched from profile if not provided. Either profileUrn or profileId must be provided.
invitationIdstringNoLinkedIn invitation ID. Optional - will be auto-fetched from profile if not provided.

Example

{
  "profileId": "johndoe"
}

Responses

StatusDescription
200Invitation withdrawn successfully
400Bad request - no pending invitation found or missing required fields
401Unauthorized - invalid or missing authentication
404Profile not found
500Server error while withdrawing invitation

200 Response Parameters

NameTypeDescription
successbooleanWhether the withdrawal was successful
messagestringSuccess or error message
accountIdstringLinkedIn account ID used for the request

200 Example

{
  "success": true,
  "message": "Successfully withdrew invitation to John Doe",
  "accountId": "696ce9e780e0483585e4e553"
}

400 Response Parameters

NameTypeDescription
errorstring
successboolean
profileobjectProfile information when no pending invitation exists

400 Example

{
  "error": "No pending invitation found for this profile",
  "success": false,
  "profile": {
    "firstName": "John",
    "lastName": "Doe",
    "profileId": "johndoe",
    "isConnected": false,
    "invitationReceived": false
  }
}

401 Response Parameters

NameTypeDescription
errorstring

401 Example

{
  "error": "example_value"
}

404 Response Parameters

NameTypeDescription
errorstring

404 Example

{
  "error": "Profile not found",
  "success": false
}

500 Response Parameters

NameTypeDescription
errorstring

500 Example

{
  "error": "example_value"
}