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

InputWhat it isWhere to get it
to
needed
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
text
needed
Text, up to 8000 characters. The first message.You write it.
subject
optional
Text, up to 200 characters. Subject line (InMail).You write it.
via
optional
One of: classic, sales_navigator, recruiter. Which LinkedIn product sends it. sales_navigator and recruiter need that seat on your account.You write it.
inmail
optional
True or false. classic only: send as an InMail (to someone you are not connected to).You write it.
companyTopic
optional
One of: service_request, request_demo, support, careers, other. Required when writing to a company page.You write it.
applicantId
optional
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
invitationId
optional
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.
groupId
optional
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.
recruiter
optional
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.
attachmentUrls
optional
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.
voiceMessageUrl
optional
A link. An audio file to send as a voice note (.m4a preferred). A public https link, up to 10 MB.You write it.
videoMessageUrl
optional
A link. A video file to send as a video note. A public https link, up to 10 MB.You write it.
connectionId
optional
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:

MethodPOST
URLhttps://api.heyreagent.com/v1/actions/start_conversation
Send HeadersOn. Name Authorization, Value Bearer YOUR_KEY
Send BodyOn. 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
chatIdA chat id. Other actions take it.
messageIdA message id. Other actions take it.
fromthe account it ran on
usedTodaynumber
dailyLimitnumber

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

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.