Send Message
curl --request POST \
--url https://api.linkupapi.com/v1/messages/send-message \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"linkedin_url": "<string>",
"message_text": "<string>",
"country": "<string>",
"media_link": "<string>",
"login_token": "<string>"
}
'import requests
url = "https://api.linkupapi.com/v1/messages/send-message"
payload = {
"linkedin_url": "<string>",
"message_text": "<string>",
"country": "<string>",
"media_link": "<string>",
"login_token": "<string>"
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
linkedin_url: '<string>',
message_text: '<string>',
country: '<string>',
media_link: '<string>',
login_token: '<string>'
})
};
fetch('https://api.linkupapi.com/v1/messages/send-message', 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.linkupapi.com/v1/messages/send-message",
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_url' => '<string>',
'message_text' => '<string>',
'country' => '<string>',
'media_link' => '<string>',
'login_token' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-key>"
],
]);
$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.linkupapi.com/v1/messages/send-message"
payload := strings.NewReader("{\n \"linkedin_url\": \"<string>\",\n \"message_text\": \"<string>\",\n \"country\": \"<string>\",\n \"media_link\": \"<string>\",\n \"login_token\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
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.linkupapi.com/v1/messages/send-message")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"linkedin_url\": \"<string>\",\n \"message_text\": \"<string>\",\n \"country\": \"<string>\",\n \"media_link\": \"<string>\",\n \"login_token\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.linkupapi.com/v1/messages/send-message")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"linkedin_url\": \"<string>\",\n \"message_text\": \"<string>\",\n \"country\": \"<string>\",\n \"media_link\": \"<string>\",\n \"login_token\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Message sent successfully",
"data": {
"entityUrn": "urn:li:msg_message:(urn:li:fsd_profile:ACoAAFHoUZgB6wGz0HEW1MdqGW45NI4e-JhvGqQ,2-MTc1MzY5NjE4NzkxMmIyODM2My0xMDAmZDYxZWIyZjUtMDQ5MS00NjJmLWJjY2ItOWFkYWVhZmM4MWFmXzEwMA==)",
"conversation_id": "urn:li:msg_conversation:(urn:li:fsd_profile:ACoAAFHoUZgB6wGz0HEW1MdqGW45NI4e-JhvGqQ,2-ZDYxZWIyZjUtMDQ5MS00NjJmLWJjY2ItOWFkYWVhZmM4MWFmXzEwMA==)",
"deliveredAt": 1753696188256
}
}
Messaging
Send Message
Send a message to a LinkedIn user
POST
/
v1
/
messages
/
send-message
Send Message
curl --request POST \
--url https://api.linkupapi.com/v1/messages/send-message \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"linkedin_url": "<string>",
"message_text": "<string>",
"country": "<string>",
"media_link": "<string>",
"login_token": "<string>"
}
'import requests
url = "https://api.linkupapi.com/v1/messages/send-message"
payload = {
"linkedin_url": "<string>",
"message_text": "<string>",
"country": "<string>",
"media_link": "<string>",
"login_token": "<string>"
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
linkedin_url: '<string>',
message_text: '<string>',
country: '<string>',
media_link: '<string>',
login_token: '<string>'
})
};
fetch('https://api.linkupapi.com/v1/messages/send-message', 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.linkupapi.com/v1/messages/send-message",
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_url' => '<string>',
'message_text' => '<string>',
'country' => '<string>',
'media_link' => '<string>',
'login_token' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-key>"
],
]);
$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.linkupapi.com/v1/messages/send-message"
payload := strings.NewReader("{\n \"linkedin_url\": \"<string>\",\n \"message_text\": \"<string>\",\n \"country\": \"<string>\",\n \"media_link\": \"<string>\",\n \"login_token\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
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.linkupapi.com/v1/messages/send-message")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"linkedin_url\": \"<string>\",\n \"message_text\": \"<string>\",\n \"country\": \"<string>\",\n \"media_link\": \"<string>\",\n \"login_token\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.linkupapi.com/v1/messages/send-message")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"linkedin_url\": \"<string>\",\n \"message_text\": \"<string>\",\n \"country\": \"<string>\",\n \"media_link\": \"<string>\",\n \"login_token\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Message sent successfully",
"data": {
"entityUrn": "urn:li:msg_message:(urn:li:fsd_profile:ACoAAFHoUZgB6wGz0HEW1MdqGW45NI4e-JhvGqQ,2-MTc1MzY5NjE4NzkxMmIyODM2My0xMDAmZDYxZWIyZjUtMDQ5MS00NjJmLWJjY2ItOWFkYWVhZmM4MWFmXzEwMA==)",
"conversation_id": "urn:li:msg_conversation:(urn:li:fsd_profile:ACoAAFHoUZgB6wGz0HEW1MdqGW45NI4e-JhvGqQ,2-ZDYxZWIyZjUtMDQ5MS00NjJmLWJjY2ItOWFkYWVhZmM4MWFmXzEwMA==)",
"deliveredAt": 1753696188256
}
}
Send a direct message to any LinkedIn user. The message can be sent to either a new conversation or an existing one.
This endpoint costs 1 credit for text-only messages and 2 credits for messages with media attachments. Ignore this if you’re on per-seat pricing: usage is unlimited.
Header Parameters
string
required
Your API key
Body Parameters
string
required
LinkedIn profile URL of the recipient (e.g., “https://www.linkedin.com/in/username”) or profile URN (e.g., “ACoAAFHoUZgB6wGz0HEW1MdqGW45NI4e-JhvGqQ”)
string
required
Content of the message to send
string
default:"FR"
Country code for proxy selection. Available: US, CA, MX, CR, BR, AR, CL, CO, FR, UK, DE, NL, ES, IT, PT, BE, CH, AT, IE, SE, DK, FI, LT, LV, EE, PL, CZ, SK, HU, RO, UA, SI, HR, RS, AL, GR, CY, TR, IL, AE, EG, ZA, IN, PK, BD, JP, SG, MY, ID, TH, PH, AU
string
Direct URL to media file to attach to the message (use .png,.mp4,jpeg,.pdf link extension)
file
Media file to attach to the message (second priority)
Click to select a file from your computer. The file will be automatically converted to base64 format with metadata.
string
required
LinkedIn authentication cookie obtained from the login/verify process
Response
string
Request status (success/error)
string
Detailed message about the message status
object
{
"status": "success",
"message": "Message sent successfully",
"data": {
"entityUrn": "urn:li:msg_message:(urn:li:fsd_profile:ACoAAFHoUZgB6wGz0HEW1MdqGW45NI4e-JhvGqQ,2-MTc1MzY5NjE4NzkxMmIyODM2My0xMDAmZDYxZWIyZjUtMDQ5MS00NjJmLWJjY2ItOWFkYWVhZmM4MWFmXzEwMA==)",
"conversation_id": "urn:li:msg_conversation:(urn:li:fsd_profile:ACoAAFHoUZgB6wGz0HEW1MdqGW45NI4e-JhvGqQ,2-ZDYxZWIyZjUtMDQ5MS00NjJmLWJjY2ItOWFkYWVhZmM4MWFmXzEwMA==)",
"deliveredAt": 1753696188256
}
}
Notes
- The API automatically determines if there’s an existing conversation with the recipient
- The API includes a typing indicator for existing conversations
- Messages are sent with push notification enabled for the recipient
- The recipient profile must be accessible with your login token
- Media Priority: If multiple media parameters are provided, the system uses this priority order:
media_link(direct URL) - highest prioritymedia_file(base64 with metadata) - second priority
- For
media_file, the base64 data can include the data URL prefix (e.g., “data:image/jpeg;base64,…”) - Temporary files created from
media_fileare automatically cleaned up after sending - The following errors can occur:
- Invalid profile URL format
- Invalid media_file format or base64 encoding
- Network or permission errors
- Rate limiting from LinkedIn
Was this page helpful?