st.createPost
This action allows you to create a post on LinkedIn. You can post as yourself or on behalf of a company page you have admin access to. The action supports text content with optional mentions of people and companies, and media attachments including images, videos, and documents.
Constraints
⏺️ Root Start: allowed.
⬆️ Parent Actions: N/A.
⬇️ Child Actions: st.openPost.
Parameters
json
{
"actionType": "st.createPost",
"label": "post1",
"text": "Excited to share my latest insights on building scalable APIs, together with @[teammate]!",
"mentions": [
{
"key": "teammate",
"name": "Example Person",
"personHashedUrl": "https://www.linkedin.com/in/ACwAAAxxxxxxxxx"
}
],
"attachments": [
{
"url": "https://example.com/images/team-photo.jpg",
"type": "image"
}
],
"companyUrl": "https://www.linkedin.com/company/microsoft"
}label(optional) – custom label for tracking this action in workflow completion.text(required) – post text, must be up to 3000 characters.mentions(optional) – people and companies to mention intext. Write@[key]where the mention should appear, and describe thatkeyhere. Maximum 20 items.key(required) – placeholder name used in the text as@[key]. From 1 to 30 characters: letters, digits,_or-.name(required) – name to find the person or company by, from 1 to 100 characters.urn(optional) – URN of the entity:urn:li:member:<id>for a person,urn:li:organization:<id>for a company.personHashedUrl(optional) – hashed LinkedIn profile URL of the person.companyHashedUrl(optional) – hashed LinkedIn company page URL.
attachments(optional) – array of media attachments. Maximum 9 items.url(required) – publicly accessible URL of the file to attach.type(required) – type of attachment:image,video, ordocument.name(required when type isdocument) – display name for the document.
companyUrl(optional) – LinkedIn company page URL. When provided, the post will be published on behalf of the company. Requires content admin access to the company page.then(optional) – object or array of child actions to be executed on the created post.
Mention rules
- Provide at most one of
urn,personHashedUrlandcompanyHashedUrlper mention. - Every
@[key]in the text must have a matching mention, and every mention must appear in the text. - Two mentions cannot share the same
key. nameis required even when an identifier is given, because LinkedIn resolves a mention through its own name suggestions. The identifier only decides which of the offered namesakes is taken. See publishing posts for the full explanation.
Attachment limits
- Maximum 9 images per post (JPEG, PNG, GIF, WebP, max 8mb).
- Maximum 1 video per post (MP4, MOV, WebM, max 200 mb).
- Maximum 1 document per post (PDF, max 100 mb).
- Cannot mix different attachment types (e.g., images and video together).
Result options
- Successful post creation:
json
{
"actionType": "st.createPost",
"label": "post1",
"success": true,
"data": {
"postUrl": "https://www.linkedin.com/feed/update/urn:li:activity:1234567890123456789",
"postUrn": "urn:li:activity:1234567890123456789",
"then": { ... }
}
}label– included only if specified in the action parameters.data.postUrl– URL of the created post.data.postUrn– URN of the created post.data.then– results of child actions execution.
postUrlandpostUrnarenullwhen the post was published but LinkedIn did not return its address. In that case the child actions inthendid not run. Do not retry: the post is already live.
- Failed post creation:
json
{
"actionType": "st.createPost",
"label": "weeklyUpdate1",
"success": false,
"error": {
"type": "companyNotFound",
"message": "Provided URL is not an existing LinkedIn company."
}
}label– included only if specified in the action parameters.error.type– enum with the following possible values:textTooLong– post text exceeds 3000 characters limit.companyNotFound– specified company page was not found on LinkedIn.noPostingPermission– no permission to post on behalf of this company.mentionNotResolved– a person or company the post text mentions was not among the options LinkedIn offered for that name. Nothing was published.unsupportedAttachmentType– attachment type is not supported. Useimage,video, ordocument.missingDocumentName– document attachment requires anamefield.urlNotAccessible– attachment URL is not publicly accessible or returned an error.fileTooLarge– attachment file exceeds the maximum allowed size.unsupportedMimeType– file's MIME type is not supported by LinkedIn.tooManyAttachments– more than 9 attachments were provided.mixingNotAllowed– cannot mix different attachment types (e.g., images with video).