Docs / Posts

create_post

Publish one post, or repost one.

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
text
optional
Text, up to 3000 characters. The post text, exactly as it should appear. May be empty only for a plain repost.You write it.
attachmentUrls
optional
A list (a link), up to 9. Images, one video or one document to attach. Public https links; each file up to 10 MB, 20 MB in total.You write it.
videoThumbnailUrl
optional
A link. Cover image for an attached video (a public https link).You write it.
repostOf
optional
A post link or a post social id. URL of an existing LinkedIn post to repost. With empty text it is a plain repost; with text, a repost with your thoughts.On LinkedIn, click the More icon (the three dots) at the top right of the post, then "Copy link to post".
Or run search_posts and use posts[].url from its answer.
9 more places to get it
mentions
optional
A list (a group of fields), up to 20. People or companies to mention. Put {{0}}, {{1}}, … in the text where each one goes (its position in this list).
What goes inside
You write it.
link
optional
A link. A link to show as a preview card. It should also appear in the text; otherwise LinkedIn adds it at the end.You write it.
jobPostingId
optional
A job id. Id of one of your job postings to show as a card (from list_job_postings).Run list_job_postings and use jobPostings[].id from its answer.
7 more places to get it
asOrganization
optional
A organization id. Act as a company page you administer instead of yourself: that page's numeric id. No action here lists the pages you administer.No action here gives it.
audience
optional
A search filter id. Limit who sees the post (company-page posts). Each list holds LinkedIn ids from lookup_search_ids (types LANGUAGE, POST_JOB_FUNCTION, SCHOOL, SENIORITY, INDUSTRY, REGION, LOCATION); headcount is company-size ranges such as { min: 51, max: 200 }.
What goes inside
  • language (optional): a list (text).
  • jobFunction (optional): a list (text).
  • school (optional): a list (text).
  • seniority (optional): a list (text).
  • industry (optional): a list (text).
  • region (optional): a list (text).
  • location (optional): a list (text).
  • headcount (optional): a list (a group of fields).
language: run lookup_search_ids with type LANGUAGE, and use matches[].id from its answer.jobFunction: run lookup_search_ids with type POST_JOB_FUNCTION, and use matches[].id from its answer.school: run lookup_search_ids with type SCHOOL, and use matches[].id from its answer.seniority: run lookup_search_ids with type SENIORITY, and use matches[].id from its answer.industry: run lookup_search_ids with type INDUSTRY, and use matches[].id from its answer.region: run lookup_search_ids with type REGION, and use matches[].id from its answer.location: run lookup_search_ids with type LOCATION, and use matches[].id from its answer.
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/create_post \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "content-type: application/json" \
  -d '{"text":"Hello LinkedIn!"}'
The same call in JavaScript
const response = await fetch("https://api.heyreagent.com/v1/actions/create_post", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_KEY",
    "content-type": "application/json",
  },
  body: JSON.stringify({
    "text": "Hello LinkedIn!"
  }),
});
const answer = await response.json();
console.log(answer);
The same call in Python
import requests

response = requests.post(
    "https://api.heyreagent.com/v1/actions/create_post",
    headers={"Authorization": "Bearer YOUR_KEY"},
    json={
        "text": "Hello LinkedIn!",
    },
)
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/create_post
Send HeadersOn. Name Authorization, Value Bearer YOUR_KEY
Send BodyOn. Body Content Type JSON, Specify Body Using JSON, then paste the body below
{
  "text": "Hello LinkedIn!"
}

Put your own key where it says YOUR_KEY. New here? Start with your first call.

What you get back

When it worked, the answer is { "ok": true, "result": { … } }. Inside result:

published
postIdA post 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, create_post, and the same inputs.