Docs / Messages
start_conversation
Start a new conversation: an InMail, a message through Sales Navigator or Recruiter, a group, a company page, a job applicant.
This action can change or spend something, and when it does it happens right away. Read “Good to know” first.
What you give it
| Input | What it is | Where to get it |
|---|---|---|
toneeded | A profile link or a member id or a Sales Navigator id or a Recruiter id or a company messaging id. Who to write to: LinkedIn profile URLs or member ids. One person, or several for a group conversation. For a company page pass its messaging id. | Open the person's profile on LinkedIn and copy the address from your browser. It looks like https://www.linkedin.com/in/their-name Or run search_people and use people[].profileUrl from its answer.54 more places to get it
|
textneeded | Text, up to 8000 characters. The first message. | You write it. |
subjectoptional | Text, up to 200 characters. Subject line (InMail). | You write it. |
viaoptional | One of: classic, sales_navigator, recruiter. Which LinkedIn product sends it. sales_navigator and recruiter need that seat on your account. | You write it. |
inmailoptional | True or false. classic only: send as an InMail (to someone you are not connected to). | You write it. |
companyTopicoptional | One of: service_request, request_demo, support, careers, other. Required when writing to a company page. | You write it. |
applicantIdoptional | A applicant id. Required when writing to an applicant of your job posting (from list_job_applicants). | Run list_job_applicants and use applicants[].id from its answer.1 more place to get it
|
invitationIdoptional | A invitation id. Required when writing to someone whose invitation you have neither accepted nor declined (from list_received_invitations). | Run list_received_invitations and use invitations[].invitationId from its answer. |
groupIdoptional | Text. Required when writing to someone through a LinkedIn group you share. A LinkedIn group you share with the person. No action here lists your groups. | You write it. |
recruiteroptional | A group of fields. via recruiter only: signature, hiringProjectId (the project to start the conversation in), jobPostingId, sourcingChannel, emailAddress (send by email instead of InMail), visibility (default PRIVATE), inmailIntent, and followUp { subject, text, days 3–28 or weeks 1–4, timezone } to schedule a follow-up (Recruiter PRO).What goes inside
| You write it. |
attachmentUrlsoptional | A list (a link), up to 9. Files or images to attach. Public https links; each file up to 10 MB, 20 MB in total. | You write it. |
voiceMessageUrloptional | A link. An audio file to send as a voice note (.m4a preferred). A public https link, up to 10 MB. | You write it. |
videoMessageUrloptional | A link. A video file to send as a video note. A public https link, up to 10 MB. | You write it. |
connectionIdoptional | A connection id. Which of your LinkedIn accounts to act from (its id from list_linkedin_accounts). Omit to use your first live one. | Run list_linkedin_accounts and use accounts[].id from its answer.15 more places to get it
|
Call it
curl -X POST https://api.heyreagent.com/v1/actions/start_conversation \
-H "Authorization: Bearer YOUR_KEY" \
-H "content-type: application/json" \
-d '{"to":["PASTE_PROFILE_LINK_HERE"],"text":"Hello!"}'The same call in JavaScript
const response = await fetch("https://api.heyreagent.com/v1/actions/start_conversation", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_KEY",
"content-type": "application/json",
},
body: JSON.stringify({
"to": [
"PASTE_PROFILE_LINK_HERE"
],
"text": "Hello!"
}),
});
const answer = await response.json();
console.log(answer);The same call in Python
import requests
response = requests.post(
"https://api.heyreagent.com/v1/actions/start_conversation",
headers={"Authorization": "Bearer YOUR_KEY"},
json={
"to": ["PASTE_PROFILE_LINK_HERE"],
"text": "Hello!",
},
)
print(response.json())The same call in n8n
Add an HTTP Request node and fill it in like this:
| Method | POST |
| URL | https://api.heyreagent.com/v1/actions/start_conversation |
| Send Headers | On. Name Authorization, Value Bearer YOUR_KEY |
| Send Body | On. Body Content Type JSON, Specify Body Using JSON, then paste the body below |
{
"to": [
"PASTE_PROFILE_LINK_HERE"
],
"text": "Hello!"
}Put your own key where it says YOUR_KEY. Put your own value where it says PASTE_…_HERE: the table above says where each one comes from. New here? Start with your first call.
What you get back
When it worked, the answer is { "ok": true, "result": { … } }. Inside result:
sent | |
chatId | A chat id. Other actions take it. |
messageId | A message id. Other actions take it. |
from | the account it ran on |
usedToday | number |
dailyLimit | number |
A field that does not apply to an answer is left out, or is null.
When it did not work, the answer is { "ok": false, "error": "…", "message": "…" }. What each error means.
Good to know
- The id must match the product in via: a member id or a profile link for "classic", a Sales Navigator id for "sales_navigator", a Recruiter id for "recruiter".
- A company page is written to at its company messaging id (get_company → messaging.id), with companyTopic set; its company id does not work here.
- An InMail spends one credit unless the person has an open profile: check get_inmail_credits, and isOpenProfile on get_profile_details.
- inmail true is added to the answer when the send was an InMail.
In Claude or ChatGPT
Once connected, ask in your own words. The assistant sees this action as a tool with the same name, start_conversation, and the same inputs.