Manage invitations

Learn how to manage invitations on LinkedIn using Unipile API.


List pending invitations

To list pending invitations, use the List all pending Relation requests endpoint, specifying the type of invitations as either sent or received.

📘

Note about pagination

Pagination for this endpoint works with the offset parameter.

const { data } = await usersApi.getRelationRequestsList({
  path: {
    account_id: "acc_123456789",
  },
  query: {
    type: "sent",
  },
});
requests = users_api.get_relation_requests_list(
    "sent",
    "acc_123456789",
)
curl --request GET \
     --url https://api.unipile.com/v2/account_id/users/me/relation-requests?type=sent \
     --header 'accept: application/json'

Send an invitation

To send an invitation to a user, use the Send a Relation request endpoint, specifying the user’s system ID (ACo…) in the request body. An optional custom message may also be included.

👍

Recommendations

Incorporate realistic delays between actions to mimic human behavior. Avoid sending consecutive invitations, as this could be misinterpreted as automation by LinkedIn.

❗️

Provider limitations

LinkedIn imposes limits on the number of invitations that can be sent :

  • For a Basic free account, you should be able to send approximately 150 invitations per week, depending on your level of activity. Also, only 5 invitations with custom messages are allowed per month.
  • For a Premium paid account, you should be able to send from 200 to 250 invitations per week, without any limitations on custom messages.
const { data } = await usersApi.createRelationRequest({
  path: {
    account_id: "acc_123456789",
  },
  body: {
    user_id: 'ACoA1B2C3D4E5F6g7Hi8J9K1L2m3NOpqRSTUvWxYZ',
    message: 'The message that comes with the invitation.'
  },
});
request = users_api.create_relation_request(
    "acc_123456789",
    {
        "user_id": "ACoA1B2C3D4E5F6g7Hi8J9K1L2m3NOpqRSTUvWxYZ",
        "message": "The message that comes with the invitation.",
    },
)
curl --request POST \
     --url https://api.unipile.com/v2/account_id/users/me/relation-requests \
     --header 'accept: application/json'
     --data '
{
  "user_id": "ACoA1B2C3D4E5F6g7Hi8J9K1L2m3NOpqRSTUvWxYZ"
  "message": "The message that comes with the invitation."
}
'

Accept an invitation

To accept an invitation from another user, use the Accept a Relation request endpoint, specifying the invitation ID as request_id.

await usersApi.acceptRelationRequest({
  path: {
    account_id: "acc_123456789",
    request_id: "request_id",
  },
});
users_api.accept_relation_request("request_id", "acc_123456789")
curl --request POST \
     --url https://api.unipile.com/v2/account_id/users/me/relation-requests/request_id/accept \
     --header 'accept: application/json'

Withdraw/Refuse an invitation

To withdraw an invitation you sent or refuse an invitation you received, use the Cancel or Refuse a Relation request endpoint, specifying the invitation ID as the request_id.

await usersApi.cancelRelationRequest({
  path: {
    account_id: "acc_123456789",
    request_id: "request_id",
  },
});
users_api.cancel_relation_request("request_id", "acc_123456789")
curl --request POST \
     --url https://api.unipile.com/v2/account_id/users/me/relation-requests/request_id/accept \
     --header 'accept: application/json'