Save draft
save_draftSaves LinkedIn post text (up to 3,000 characters) as a draft, or updates an existing unpublished post. Without id it creates a draft. With id it updates a draft or a scheduled post that has not been sent; the schedule time and destination stay as they are and nothing is sent to LinkedIn. content is required to create; an update takes content and/or media, and optionally destination, mentions, first_comment, or auto_react. first_comment and auto_react are stored on the post and applied when it is published by schedule_post or publish_now. mentions tags LinkedIn company pages named in the text; people cannot be tagged. The result includes preview_url, a link that opens the post in PostPen for the signed-in account owner; it is meant to be shown to the user whenever a draft is saved or a post is scheduled. destination selects the personal profile or a company page from list_destinations. media attaches images, a video, or a PDF. Each media item has exactly one source: { url } for a public HTTPS file, { upload_id } for a file sent through create_upload, or { data } for a small base64 file up to 4MB. PostPen checks each file and copies it into its own storage. An image item can carry alt_text, the alternative text LinkedIn gives the image for screen readers (up to 4,086 characters, about 120 recommended; images only). On an update, omitting media keeps existing attachments and their alt text, and media: [] removes them. media_alt_text changes the alt text of images already on the post, one entry per image in the order of media_urls; it cannot be sent together with media. schedule_post and publish_now use the stored alt text. media_urls and LinkedIn tokens are not accepted.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Draft or scheduled post id to update in place. Omit to create a new draft. | |
| media | No | Optional attachments, one source per item: { url }, { upload_id }, or { data, content_type }. Images: jpeg, png, webp, gif, max 5MB, up to 9. Video: mp4, 75KB–200MB, one per post. Document: pdf, max 100MB, one per post (LinkedIn shows it as a swipeable carousel). Types cannot be mixed in one post. | |
| content | No | The post text, up to 3,000 characters (LinkedIn’s limit; longer text is refused). Required to create a draft; optional when id is set and only media or destination changes. | |
| mentions | No | Optional LinkedIn company pages to tag, each as a page link such as https://www.linkedin.com/company/acme. The company’s name must appear in content exactly as LinkedIn spells it; that text becomes the clickable tag when the post is published, and if it is missing the error gives the exact spelling. [] removes the tags; leaving it out keeps what is saved. Only company pages can be tagged, not people, and tags are not applied to PDF posts. | |
| auto_react | No | Optional. true makes PostPen like the post from the same account right after it is published; false turns that off. | |
| destination | No | Where to post: an id from list_destinations. Each destination has a network (linkedin today). "personal" (the default on a personal draft) is the personal LinkedIn profile; a company page is identified by its id from list_destinations (usually the organization URN). On schedule_post and publish_now, leaving it out keeps a company destination already saved on the draft, and "personal" switches to the profile. | |
| first_comment | No | Optional comment PostPen adds to the post right after it is published, for example a link. Up to 1,250 characters. null or "" removes a saved one; leaving it out keeps what is saved. | |
| media_alt_text | No | Optional alt text for the images already on the post, one entry per image in the order of media_urls from list_posts. A string (up to 4,086 characters; about 120 recommended) sets that image’s alt text, null or "" removes it, and images past the end of a shorter array keep theirs. Refused when the post has no images or the array is longer than its images. |