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.
/invitations/withdrawCode 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
| Field | Type | Required | Description |
|---|---|---|---|
accountId | string | No | LinkedIn account ID to use. If not provided, uses the default account. |
profileId | string | Yes | LinkedIn 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. |
memberId | string | No | LinkedIn member ID (ACoAAA format). Optional - will be auto-fetched from profile if not provided. |
firstName | string | No | First name of the person. Optional - will be auto-fetched from profile if not provided. |
lastName | string | No | Last name of the person. Optional - will be auto-fetched from profile if not provided. |
profileUrn | string | Conditional | LinkedIn profile URN. Optional - will be auto-fetched from profile if not provided. Either profileUrn or profileId must be provided. |
invitationId | string | No | LinkedIn invitation ID. Optional - will be auto-fetched from profile if not provided. |
Example
{
"profileId": "johndoe"
}Responses
| Status | Description |
|---|---|
| 200 | Invitation withdrawn successfully |
| 400 | Bad request - no pending invitation found or missing required fields |
| 401 | Unauthorized - invalid or missing authentication |
| 404 | Profile not found |
| 500 | Server error while withdrawing invitation |
200 Response Parameters
| Name | Type | Description |
|---|---|---|
success | boolean | Whether the withdrawal was successful |
message | string | Success or error message |
accountId | string | LinkedIn account ID used for the request |
200 Example
{
"success": true,
"message": "Successfully withdrew invitation to John Doe",
"accountId": "696ce9e780e0483585e4e553"
}400 Response Parameters
| Name | Type | Description |
|---|---|---|
error | string | |
success | boolean | |
profile | object | Profile 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
| Name | Type | Description |
|---|---|---|
error | string |
401 Example
{
"error": "example_value"
}404 Response Parameters
| Name | Type | Description |
|---|---|---|
error | string |
404 Example
{
"error": "Profile not found",
"success": false
}500 Response Parameters
| Name | Type | Description |
|---|---|---|
error | string |
500 Example
{
"error": "example_value"
}Send a connection request
Send a connection request to a LinkedIn member to become 1st-degree connections. Optionally include a personalized message (300 character limit). Connection requests with custom messages have higher acceptance rates. Either profileId or profileUrn must be provided. Rate limit: 90 connection requests per week per LinkedIn account (resets every Monday at midnight UTC). Exceeding the limit puts the account on hold for 24 hours.
Check relationship status with profile
Check the relationship between your default LinkedIn account and a target profile. Returns connection status (1st, 2nd, 3rd degree), whether you follow them, and if you are connected. Useful for determining which actions are available (message, connect, etc.).
