LinkedIn documents publishing API

A LinkedIn document post is one PDF, attached as the only media item on a feed post and named with documentTitle. LinkedIn's rules below were read 2026-12-05.

Live · platform rules read 2026-12-05View as Markdown

Rules for LinkedIn documents

RuleValue
Placementfeed
Mediadocument
Items per post1 PDF
Caption limit3,000 characters
  • A document post carries exactly one PDF and no other media.
  • A PDF needs a documentTitle, and a post without a PDF cannot carry one.
FactValueTheir wordsSource
Document size100MB and 300 pages"The file size can't exceed 100MB and 300 pages."Documents API, read 2026-12-05
Post text (characters)3,000"The maximum length of the text of a UGC Post is 3,000 characters."UGC Post API (legacy), read 2026-12-05

Settings

Set these under the target's settings. All are optional unless marked required.

FieldWhat it does
pollA poll; send text and no media, altText, or documentTitle.
firstCommentA comment PubNio posts under the published post.
threadUp to 24 comments posted on the post.
visibilityPUBLIC or CONNECTIONS.
altTextAlt text for images, up to 4,086 characters.
documentTitleThe title shown on the document. Required with a PDF.

Publish request

One PDF, posted publicly with a document title.

linkedin-documents-request.http
POST /api/v1/posts?workspaceId=4e5f6a7b-8c9d-4e0f-9a1b-2c3d4e5f6a7b
Authorization: Bearer pn_live_***
Idempotency-Key: linkedin-document-report
Content-Type: application/json

{
  "text": "Our 2026 delivery report, twelve pages.",
  "publishNow": true,
  "targets": [
    {
      "accountId": "7f3c2a10-5b4e-4d6f-8a9b-0c1d2e3f4a5b",
      "provider": "linkedin",
      "placement": "feed",
      "settings": {
        "visibility": "PUBLIC",
        "documentTitle": "2026 delivery report"
      },
      "media": [
        {
          "mediaId": "2d6e8f10-3a5b-4c7d-9e1f-a2b3c4d5e6f7"
        }
      ]
    }
  ]
}

Limits

  • A media URL fails with media_upload_required: import the file into the workspace from its URL, or send up to 8 MiB inline, then pass its mediaId to the target.

Sources