Send message to lead by ID
curl --request POST \
--url https://api.sendpilot.ai/v1/inbox/send/lead/{leadId} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"senderId": "sender_123",
"message": "Hi {{firstName}}, I wanted to follow up on our conversation...",
"campaignId": "<string>"
}
'import requests
url = "https://api.sendpilot.ai/v1/inbox/send/lead/{leadId}"
payload = {
"senderId": "sender_123",
"message": "Hi {{firstName}}, I wanted to follow up on our conversation...",
"campaignId": "<string>"
}
headers = {
"X-API-Key": "<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': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
senderId: 'sender_123',
message: 'Hi {{firstName}}, I wanted to follow up on our conversation...',
campaignId: '<string>'
})
};
fetch('https://api.sendpilot.ai/v1/inbox/send/lead/{leadId}', 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.sendpilot.ai/v1/inbox/send/lead/{leadId}",
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([
'senderId' => 'sender_123',
'message' => 'Hi {{firstName}}, I wanted to follow up on our conversation...',
'campaignId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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.sendpilot.ai/v1/inbox/send/lead/{leadId}"
payload := strings.NewReader("{\n \"senderId\": \"sender_123\",\n \"message\": \"Hi {{firstName}}, I wanted to follow up on our conversation...\",\n \"campaignId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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.sendpilot.ai/v1/inbox/send/lead/{leadId}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"senderId\": \"sender_123\",\n \"message\": \"Hi {{firstName}}, I wanted to follow up on our conversation...\",\n \"campaignId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sendpilot.ai/v1/inbox/send/lead/{leadId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"senderId\": \"sender_123\",\n \"message\": \"Hi {{firstName}}, I wanted to follow up on our conversation...\",\n \"campaignId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"messageId": "msg_123",
"recipientLinkedinUrl": "<string>",
"status": "sent",
"timestamp": "2023-11-07T05:31:56Z",
"leadId": "<string>",
"conversationId": "<string>",
"error": "<string>"
}Inbox and Senders
Send Message to Lead
Send a message to an existing campaign lead using its stored recipient.
POST
/
v1
/
inbox
/
send
/
lead
/
{leadId}
Send message to lead by ID
curl --request POST \
--url https://api.sendpilot.ai/v1/inbox/send/lead/{leadId} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"senderId": "sender_123",
"message": "Hi {{firstName}}, I wanted to follow up on our conversation...",
"campaignId": "<string>"
}
'import requests
url = "https://api.sendpilot.ai/v1/inbox/send/lead/{leadId}"
payload = {
"senderId": "sender_123",
"message": "Hi {{firstName}}, I wanted to follow up on our conversation...",
"campaignId": "<string>"
}
headers = {
"X-API-Key": "<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': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
senderId: 'sender_123',
message: 'Hi {{firstName}}, I wanted to follow up on our conversation...',
campaignId: '<string>'
})
};
fetch('https://api.sendpilot.ai/v1/inbox/send/lead/{leadId}', 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.sendpilot.ai/v1/inbox/send/lead/{leadId}",
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([
'senderId' => 'sender_123',
'message' => 'Hi {{firstName}}, I wanted to follow up on our conversation...',
'campaignId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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.sendpilot.ai/v1/inbox/send/lead/{leadId}"
payload := strings.NewReader("{\n \"senderId\": \"sender_123\",\n \"message\": \"Hi {{firstName}}, I wanted to follow up on our conversation...\",\n \"campaignId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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.sendpilot.ai/v1/inbox/send/lead/{leadId}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"senderId\": \"sender_123\",\n \"message\": \"Hi {{firstName}}, I wanted to follow up on our conversation...\",\n \"campaignId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sendpilot.ai/v1/inbox/send/lead/{leadId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"senderId\": \"sender_123\",\n \"message\": \"Hi {{firstName}}, I wanted to follow up on our conversation...\",\n \"campaignId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"messageId": "msg_123",
"recipientLinkedinUrl": "<string>",
"status": "sent",
"timestamp": "2023-11-07T05:31:56Z",
"leadId": "<string>",
"conversationId": "<string>",
"error": "<string>"
}Requires
inbox:send. Supply the campaign lead ID in the path and senderId plus message in the body. message is limited to 1–8,000 characters. campaignId is optional.
Supported lead-name variables, such as {{firstName}}, are resolved from the lead. Review your message before sending. Unlike MCP’s preview-and-confirm flow, a valid REST request acts immediately.
Use an Idempotency-Key. After an uncertain outcome, read the conversation before trying again.Authorizations
API key for authentication (prefix: sp_live_ or sp_test_)
Path Parameters
Body
application/json
Response
Message sent or queued
Success status
Example:
true
Message ID
Example:
"msg_123"
Recipient LinkedIn URL
Message status
Available options:
queued, sent, failed Example:
"sent"
Timestamp when message was sent/queued
Lead ID if message was sent to a lead
LinkedIn conversation ID, when the provider returns one (use with GET /v1/inbox/conversations/:conversationId/messages)
Error message if failed