Working with invitations
This page describes how to create workflows for sending and withdrawing connection requests, and retrieving, accepting, and ignoring invitations on LinkedIn.
Sending connection request
To send a connection request from your account to another person, you need to include st.sendConnectionRequest action in your workflow. Here's an example:
Workflow:
{
"actionType": "st.sendConnectionRequest",
"personUrl": "https://www.linkedin.com/in/person1",
"note": "Hi, I’d like to connect with you to discuss potential collaboration.",
"email": "example1@gmail.com"
}Completion:
{
"actionType": "st.sendConnectionRequest",
"success": true
}Withdrawing connection request
To withdraw the connection request sent from your account, you need to include st.withdrawConnectionRequest action in your workflow. Here's an example:
Workflow:
{
"actionType": "st.withdrawConnectionRequest",
"personUrl": "https://www.linkedin.com/in/person1",
"unfollow": true
}Completion:
{
"actionType": "st.withdrawConnectionRequest",
"success": true
}Retrieving pending connection requests
To retrieve a list of pending connection requests sent from your account, you need to include st.retrievePendingRequests action in your workflow. Here's an example:
Workflow:
{
"actionType": "st.retrievePendingRequests"
}Completion:
{
"actionType": "st.retrievePendingRequests",
"success": true,
"data": [
{
"name": "John Doe",
"publicUrl": "https://www.linkedin.com/in/johndoe",
"headline": "Founder & CEO at Example Company"
},
{
"name": "Jane Smith",
"publicUrl": "https://www.linkedin.com/in/janesmith",
"headline": "CTO at Tech Solutions"
},
{
"name": "Carlos Santos",
"publicUrl": "https://www.linkedin.com/in/carlossantos",
"headline": "Product Manager at Startup Hub"
}
]
}Retrieving invitations
Use st.retrieveInvitations to read all incoming connection, company-follow, and newsletter-subscription invitations from the invitation manager. The action is root-only and does not support then.
💡 To react to new connection requests as they arrive instead of polling this action on a schedule, enable network monitoring with
st.syncNetworkand consumeconnectionRequestReceivedevents.
Workflow:
{
"actionType": "st.retrieveInvitations"
}Completion:
{
"actionType": "st.retrieveInvitations",
"success": true,
"data": [
{
"invitationType": "connect",
"name": "John Doe",
"publicUrl": "https://www.linkedin.com/in/johndoe",
"headline": "Founder & CEO at Example Company",
"note": "I would like to connect."
},
{
"invitationType": "companyFollow",
"name": "Jane Smith",
"publicUrl": "https://www.linkedin.com/in/janesmith",
"companyUrl": "https://www.linkedin.com/company/example-company",
"companyName": "Example Company"
},
{
"invitationType": "newsletterSubscribe",
"name": "Carlos Santos",
"publicUrl": "https://www.linkedin.com/in/carlossantos",
"newsletterUrl": "https://www.linkedin.com/newsletters/example-1234567890",
"newsletterName": "Example Newsletter"
}
]
}Use the type-specific URL from each item when accepting or ignoring it:
invitationType | Required target |
|---|---|
connect | personUrl, using the item's publicUrl value |
companyFollow | companyUrl |
newsletterSubscribe | newsletterUrl |
Accepting an invitation
Use st.acceptInvitation with the invitation type and exactly one matching target URL.
{
"actionType": "st.acceptInvitation",
"invitationType": "connect",
"personUrl": "https://www.linkedin.com/in/johndoe"
}For a company-follow invitation:
{
"actionType": "st.acceptInvitation",
"invitationType": "companyFollow",
"companyUrl": "https://www.linkedin.com/company/example-company"
}For a newsletter-subscription invitation:
{
"actionType": "st.acceptInvitation",
"invitationType": "newsletterSubscribe",
"newsletterUrl": "https://www.linkedin.com/newsletters/example-1234567890"
}A successful completion contains "success": true and no data.
Ignoring an invitation
st.ignoreInvitation uses the same target contract:
{
"actionType": "st.ignoreInvitation",
"invitationType": "connect",
"personUrl": "https://www.linkedin.com/in/johndoe"
}Change invitationType and the URL field together for company-follow or newsletter-subscription invitations. A successful completion contains "success": true and no data.
This page provides examples of workflows and their completions. For detailed constraints, parameters, and results, refer to the corresponding action documentation pages.