Send a LinkedIn message
Send one LinkedIn message from your account to one person or conversation.
curl --request POST \
--url https://api.groovin.ai/functions/v1/api/v1/linkedin/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "REPLACE_WITH_YOUR_MESSAGE",
"conversation_id": "REPLACE_WITH_CONVERSATION_ID"
}
'import requests
url = "https://api.groovin.ai/functions/v1/api/v1/linkedin/messages"
payload = {
"text": "REPLACE_WITH_YOUR_MESSAGE",
"conversation_id": "REPLACE_WITH_CONVERSATION_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({
text: 'REPLACE_WITH_YOUR_MESSAGE',
conversation_id: 'REPLACE_WITH_CONVERSATION_ID'
})
};
fetch('https://api.groovin.ai/functions/v1/api/v1/linkedin/messages', 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/messages",
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([
'text' => 'REPLACE_WITH_YOUR_MESSAGE',
'conversation_id' => 'REPLACE_WITH_CONVERSATION_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/messages"
payload := strings.NewReader("{\n \"text\": \"REPLACE_WITH_YOUR_MESSAGE\",\n \"conversation_id\": \"REPLACE_WITH_CONVERSATION_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/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"REPLACE_WITH_YOUR_MESSAGE\",\n \"conversation_id\": \"REPLACE_WITH_CONVERSATION_ID\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.groovin.ai/functions/v1/api/v1/linkedin/messages")
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 \"text\": \"REPLACE_WITH_YOUR_MESSAGE\",\n \"conversation_id\": \"REPLACE_WITH_CONVERSATION_ID\"\n}"
response = http.request(request)
puts response.read_body{
"org_linkedin_account_id": 4821,
"sent": true,
"conversation_id": "example-conversation-id",
"message_id": "example-message-id",
"recipient_linkedin_profile_id": null,
"recipient_resolution": "conversation_id",
"used_live_profile_fetch": false
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}conversation_id can be a group: everyone in it gets the message.What this call does
| Sends a real message. Can also cost 1 live profile view | |
| Your CRM | Recorded automatically by the message sync. 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 100 messages a day |
| Repeating it | Never repeat blindly. After a timeout, a 5xx or no answer at all, the message may have gone out. Wait a few minutes, check the chat, and only then try once. |
Good to know
- Send exactly one of
conversation_id,linkedin_profile_id,sales_nav_profile_id,linkedin_profile_slugorcrm_contact_id. sent: truemeans LinkedIn accepted the message.- Do not build bulk sequences with this route. It is made for one approved message at a time, and sending too much can get your LinkedIn account restricted.
send_linkedin_message.Authorizations
Your Groovin API key (gv_live_…), created in the extension under Settings, MCP and API.
Body
The message, up to 8,000 characters.
Who to reach, by existing conversation: the best option. It can be a group conversation.
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.
Leave this out to use your own LinkedIn account. Another person's account is refused with a 403.
Response
Success.
LinkedIn accepted the message.
Groovin's id for the LinkedIn account this answer is about.
Always true on success.
The conversation the message went to.
The new message's id, when LinkedIn gives one.
Who it was addressed to. null when you sent a conversation_id.
How Groovin found the recipient.
conversation_id, provided_id, provided_slug, pair_table, crm_record true when finding the recipient cost one live LinkedIn profile view.
curl --request POST \
--url https://api.groovin.ai/functions/v1/api/v1/linkedin/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "REPLACE_WITH_YOUR_MESSAGE",
"conversation_id": "REPLACE_WITH_CONVERSATION_ID"
}
'import requests
url = "https://api.groovin.ai/functions/v1/api/v1/linkedin/messages"
payload = {
"text": "REPLACE_WITH_YOUR_MESSAGE",
"conversation_id": "REPLACE_WITH_CONVERSATION_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({
text: 'REPLACE_WITH_YOUR_MESSAGE',
conversation_id: 'REPLACE_WITH_CONVERSATION_ID'
})
};
fetch('https://api.groovin.ai/functions/v1/api/v1/linkedin/messages', 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/messages",
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([
'text' => 'REPLACE_WITH_YOUR_MESSAGE',
'conversation_id' => 'REPLACE_WITH_CONVERSATION_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/messages"
payload := strings.NewReader("{\n \"text\": \"REPLACE_WITH_YOUR_MESSAGE\",\n \"conversation_id\": \"REPLACE_WITH_CONVERSATION_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/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"REPLACE_WITH_YOUR_MESSAGE\",\n \"conversation_id\": \"REPLACE_WITH_CONVERSATION_ID\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.groovin.ai/functions/v1/api/v1/linkedin/messages")
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 \"text\": \"REPLACE_WITH_YOUR_MESSAGE\",\n \"conversation_id\": \"REPLACE_WITH_CONVERSATION_ID\"\n}"
response = http.request(request)
puts response.read_body{
"org_linkedin_account_id": 4821,
"sent": true,
"conversation_id": "example-conversation-id",
"message_id": "example-message-id",
"recipient_linkedin_profile_id": null,
"recipient_resolution": "conversation_id",
"used_live_profile_fetch": false
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}