Send an invitation
curl --request POST \
--url https://win.oneshotagent.com/v1/tools/linkedin/invite \
--header 'Content-Type: application/json' \
--data '
{
"account_id": "<string>",
"profile": "<string>",
"note": "<string>"
}
'import requests
url = "https://win.oneshotagent.com/v1/tools/linkedin/invite"
payload = {
"account_id": "<string>",
"profile": "<string>",
"note": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({account_id: '<string>', profile: '<string>', note: '<string>'})
};
fetch('https://win.oneshotagent.com/v1/tools/linkedin/invite', 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://win.oneshotagent.com/v1/tools/linkedin/invite",
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([
'account_id' => '<string>',
'profile' => '<string>',
'note' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://win.oneshotagent.com/v1/tools/linkedin/invite"
payload := strings.NewReader("{\n \"account_id\": \"<string>\",\n \"profile\": \"<string>\",\n \"note\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://win.oneshotagent.com/v1/tools/linkedin/invite")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": \"<string>\",\n \"profile\": \"<string>\",\n \"note\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://win.oneshotagent.com/v1/tools/linkedin/invite")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_id\": \"<string>\",\n \"profile\": \"<string>\",\n \"note\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyLinkedIn
Send an invitation
Send a LinkedIn connection request with an optional note.
POST
/
v1
/
tools
/
linkedin
/
invite
Send an invitation
curl --request POST \
--url https://win.oneshotagent.com/v1/tools/linkedin/invite \
--header 'Content-Type: application/json' \
--data '
{
"account_id": "<string>",
"profile": "<string>",
"note": "<string>"
}
'import requests
url = "https://win.oneshotagent.com/v1/tools/linkedin/invite"
payload = {
"account_id": "<string>",
"profile": "<string>",
"note": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({account_id: '<string>', profile: '<string>', note: '<string>'})
};
fetch('https://win.oneshotagent.com/v1/tools/linkedin/invite', 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://win.oneshotagent.com/v1/tools/linkedin/invite",
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([
'account_id' => '<string>',
'profile' => '<string>',
'note' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://win.oneshotagent.com/v1/tools/linkedin/invite"
payload := strings.NewReader("{\n \"account_id\": \"<string>\",\n \"profile\": \"<string>\",\n \"note\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://win.oneshotagent.com/v1/tools/linkedin/invite")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": \"<string>\",\n \"profile\": \"<string>\",\n \"note\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://win.oneshotagent.com/v1/tools/linkedin/invite")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_id\": \"<string>\",\n \"profile\": \"<string>\",\n \"note\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodySends a connection request, with an optional note, from a connected account. Requires a connected account with the
Response. HTTP 202 returns
Meanings are on Errors. Retry with a new key.
Refunds. An invitation that fails before reaching LinkedIn is refunded as account credit within a day; refunds run daily at 03:00 UTC. The receipt gets a new signed revision marked failed.
Uncertain sends. A timeout, server error or throttled send may still have gone out. It stays
invite grant and an Idempotency-Key header. The default limit is 25 invitations per connected account per UTC day, shared across callers. Standard API rate limits also apply. Invitations are not paced: each one is sent as soon as it is picked up.
string
required
OneShot LinkedIn account ID.
string
required
HTTPS linkedin.com/in/ profile URL, or LinkedIn’s id for the person (a
external_id).string
Optional message, preserved verbatim. At most 300 Unicode characters. LinkedIn may impose a shorter account-specific limit or a custom-note allowance.
request_id, receipt_id, linkedin.invitation_id, and linkedin.scheduled_for, always null because invitations are not paced. Save the stable OneShot invitation ID to withdraw the invitation, including while it is queued. Poll GET /v1/requests/{request_id} for completion. SDK methods wait by default.
Result. Completed results contain action_request_id, invitation_id, status (sent, already_connected, or pending), and external_invitation_id (LinkedIn’s id for the invitation) when available. Duplicate targets return the original invitation ID. An invitation that was sent outside OneShot has tracked: false and cannot be withdrawn through this API.
Failures
A failed job’sresult carries reason, one plain sentence, and upstream_reason, LinkedIn’s own error type, when it gave one. retry_after (seconds) is set when the wait is known.
error_code | Retry |
|---|---|
recipient_unavailable (LinkedIn refuses invitations to this profile) | Terminal |
target_not_found, email_required, request_rejected | Terminal |
note_too_long, note_limit_reached, content_rejected | Terminal; change or drop the note |
invitation_cancelled, grant_revoked | Terminal |
account_disconnected | Retryable after reconnect |
account_send_limit | Retryable at UTC midnight |
rate_limited, service_unavailable, receipt_unavailable | Retryable later |
processing with send_status: ambiguous, and after 24 hours without confirmation reports send_unverified; it is never resent or refunded. A throttled send is checked after 10 minutes: if LinkedIn shows no invitation, it fails with rate_limited and is refunded.
Waiting. The SDKs wait up to 180 seconds; the job keeps running after that. Pass wait: false (Python wait=False) and poll GET /v1/requests/{request_id}.
Same key. It replays the original response, so polling shows the same job, failed or not. Nothing is resent. Use a new key to try again.
const invitation = await agent.linkedinInvite({
accountId,
profile: 'https://www.linkedin.com/in/jane-doe/',
note: 'Enjoyed your presentation.',
idempotencyKey: 'event-jane-invite',
});
invitation = client.linkedin_invite(account_id, "https://www.linkedin.com/in/jane-doe/",
note="Enjoyed your presentation.", idempotency_key="event-jane-invite")