Send a LinkedIn invitation
Send one connection invitation from your account, with an optional note.
curl --request POST \
--url https://api.groovin.ai/functions/v1/api/v1/linkedin/invitations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"linkedin_profile_id": "REPLACE_WITH_LINKEDIN_PROFILE_ID"
}
'import requests
url = "https://api.groovin.ai/functions/v1/api/v1/linkedin/invitations"
payload = { "linkedin_profile_id": "REPLACE_WITH_LINKEDIN_PROFILE_ID" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({linkedin_profile_id: 'REPLACE_WITH_LINKEDIN_PROFILE_ID'})
};
fetch('https://api.groovin.ai/functions/v1/api/v1/linkedin/invitations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.groovin.ai/functions/v1/api/v1/linkedin/invitations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'linkedin_profile_id' => 'REPLACE_WITH_LINKEDIN_PROFILE_ID'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.groovin.ai/functions/v1/api/v1/linkedin/invitations"
payload := strings.NewReader("{\n \"linkedin_profile_id\": \"REPLACE_WITH_LINKEDIN_PROFILE_ID\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.groovin.ai/functions/v1/api/v1/linkedin/invitations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"linkedin_profile_id\": \"REPLACE_WITH_LINKEDIN_PROFILE_ID\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.groovin.ai/functions/v1/api/v1/linkedin/invitations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"linkedin_profile_id\": \"REPLACE_WITH_LINKEDIN_PROFILE_ID\"\n}"
response = http.request(request)
puts response.read_body{
"org_linkedin_account_id": 4821,
"sent": true,
"invitation_id": "example-invitation-id",
"recipient_linkedin_profile_id": "ACoAAExampleLinkedinProfileId",
"recipient_resolution": "provided_id",
"used_live_profile_fetch": false,
"crm_contact_id": "example-crm-contact-id",
"crm_contact_auto_created": false
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}What this call does
| Sends a real invitation. Can also cost 1 live profile view | |
| Your CRM | Updates a linked contact and can add a note. With your auto-create preference on, it can also create a contact, turn on sync, import the history and spend an email credit |
| Also | About 80 to 100 invitations a day, 200 a week |
| Repeating it | Never repeat blindly. After a timeout, a 5xx or no answer at all, the invitation may have gone out. Wait a few minutes, check the pending invitations, and only then try once. |
Good to know
- Send exactly one of
linkedin_profile_id,sales_nav_profile_id,linkedin_profile_slugorcrm_contact_id. sent: truemeans LinkedIn accepted the invitation.- Check your connections and pending invitations first: a repeat attempt wastes your quota.
send_linkedin_invitation.Authorizations
Your Groovin API key (gv_live_…), created in the extension under Settings, MCP and API.
Body
An optional note, up to 300 characters. Leave it out for an invitation without a note.
Who to reach, by LinkedIn profile id (ACoAA…).
Who to reach, by Sales Navigator profile id (ACwAA…).
Who to reach, by the end of their LinkedIn URL. This can cost one live LinkedIn profile view, and a URL that changed owner can point to someone else: prefer an id.
Who to reach, by CRM contact id. The contact needs a linked profile or a LinkedIn URL on its record.
Their email address, if LinkedIn refuses the invitation because it needs one.
Leave this out to use your own LinkedIn account. Another person's account is refused with a 403.
Response
Success.
LinkedIn accepted the invitation.
Groovin's id for the LinkedIn account this answer is about.
Always true on success.
The invitation's id, when LinkedIn gives one.
Who it was addressed to.
How Groovin found the recipient.
provided_id, provided_slug, pair_table, crm_record true when finding the recipient cost one live LinkedIn profile view. Automatic contact creation can cost one more.
The CRM contact the invitation was recorded on, if any.
true when this call created a brand-new CRM contact. false when it only linked an existing one.
curl --request POST \
--url https://api.groovin.ai/functions/v1/api/v1/linkedin/invitations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"linkedin_profile_id": "REPLACE_WITH_LINKEDIN_PROFILE_ID"
}
'import requests
url = "https://api.groovin.ai/functions/v1/api/v1/linkedin/invitations"
payload = { "linkedin_profile_id": "REPLACE_WITH_LINKEDIN_PROFILE_ID" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({linkedin_profile_id: 'REPLACE_WITH_LINKEDIN_PROFILE_ID'})
};
fetch('https://api.groovin.ai/functions/v1/api/v1/linkedin/invitations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.groovin.ai/functions/v1/api/v1/linkedin/invitations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'linkedin_profile_id' => 'REPLACE_WITH_LINKEDIN_PROFILE_ID'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.groovin.ai/functions/v1/api/v1/linkedin/invitations"
payload := strings.NewReader("{\n \"linkedin_profile_id\": \"REPLACE_WITH_LINKEDIN_PROFILE_ID\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.groovin.ai/functions/v1/api/v1/linkedin/invitations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"linkedin_profile_id\": \"REPLACE_WITH_LINKEDIN_PROFILE_ID\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.groovin.ai/functions/v1/api/v1/linkedin/invitations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"linkedin_profile_id\": \"REPLACE_WITH_LINKEDIN_PROFILE_ID\"\n}"
response = http.request(request)
puts response.read_body{
"org_linkedin_account_id": 4821,
"sent": true,
"invitation_id": "example-invitation-id",
"recipient_linkedin_profile_id": "ACoAAExampleLinkedinProfileId",
"recipient_resolution": "provided_id",
"used_live_profile_fetch": false,
"crm_contact_id": "example-crm-contact-id",
"crm_contact_auto_created": false
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}