Accept or ignore a received invitation
Accepts or ignores a received invitation on LinkedIn. Works for all invitation types: connection requests, organization follows, newsletter subscriptions, and events. Use the data from GET /invitations/received to populate the required fields.
/invitations/received/respondCode Examples
curl -X POST 'https://api.connectsafely.ai/linkedin/invitations/received/respond' \ -H 'Authorization: Bearer <your_api_key>' \ -H 'Content-Type: application/json' \ -d '{"action":"example_value","invitationId":"12345","validationToken":"12345","linkedInInvitationType":"default","firstName":"example_value","lastName":"example_value"}'Parameters
No parameters.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
accountId | string | No | LinkedIn account ID to use. If not provided, uses the default account. |
action | string | Yes | Action to perform on the invitation |
invitationId | string | Yes | LinkedIn invitation ID from the received invitation |
validationToken | string | Yes | Validation token from the received invitation |
linkedInInvitationType | string | Yes | LinkedIn invitation type (e.g., GenericInvitationType_CONNECTION, GenericInvitationType_ORGANIZATION) |
firstName | string | Yes | First name of the inviter |
lastName | string | Yes | Last name of the inviter |
profileId | string | No | LinkedIn member ID (ACoAAA format). Optional, required for connection invitations. |
Example
{
"action": "example_value",
"invitationId": "12345",
"validationToken": "12345",
"linkedInInvitationType": "default",
"firstName": "example_value",
"lastName": "example_value"
}Responses
| Status | Description |
|---|---|
| 200 | Invitation responded to successfully |
| 401 | Unauthorized - invalid or missing authentication |
| 500 | Server error while responding to invitation |
200 Response Parameters
| Name | Type | Description |
|---|---|---|
success | boolean | Whether the action was successful |
message | string | Success message with action details |
accountId | string | LinkedIn account ID used |
200 Example
{
"success": true,
"message": "Invitation from Deepika Khare accepted",
"accountId": "69da1eacf365891afa0426a4"
}401 Response Parameters
| Name | Type | Description |
|---|---|---|
error | string |
401 Example
{
"error": "example_value"
}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.
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.
