Write

Save draft

Saves 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. 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. On an update, omitting media keeps existing attachments and media: [] removes them. media_urls and LinkedIn tokens are not accepted.

post/save_draft

Request

  • Base URL: https://pdb.postpen.ai/functions/v1/agent-api
  • URL: https://pdb.postpen.ai/functions/v1/agent-api/save_draft
  • Auth: HTTP bearer

Request body

contentstring

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.

idstring

Draft or scheduled post id to update in place. Omit to create a new draft.

destinationstring

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_commentstring nullable

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.

mentionsstring[]

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_reactboolean

Optional. true makes PostPen like the post from the same account right after it is published; false turns that off.

Response

Success. JSON object; never contains LinkedIn tokens.

object required

Changes

No recorded changes to this operation across all 1 revision of this API.