Skip to main content

Upload Document

Upload documents (PDF, PPT, PPTX, DOC, DOCX) to LinkedIn as native document posts. Documents are displayed as carousels/viewers on LinkedIn.

Endpoint​

POST /api/upload_document

Headers​

NameValueDescription
AuthorizationApikey your-api-key-hereYour API key for authentication

Parameters​

NameTypeRequiredDescription
userStringYesUser identifier (profile name)
platform[]ArrayYesMust be ["linkedin"] - only LinkedIn supports document uploads
documentFile/URLYesThe document file to upload (file upload or URL). Supported formats: PDF, PPT, PPTX, DOC, DOCX
titleStringYesDocument title (displayed on the post). LinkedIn caps this field at 400 characters, counting each emoji as two and each line break as one. Longer titles are trimmed to 400 characters with an ellipsis; put the full text in description, which has a much larger limit.
descriptionStringNoPost commentary/text that appears above the document
visibilityStringNoVisibility setting: "PUBLIC", "CONNECTIONS", "LOGGED_IN", or "CONTAINER". Default: "PUBLIC"
target_linkedin_page_idStringNoLinkedIn organization/page ID to post to a company page instead of personal profile
first_commentStringNoAutomatically post a first comment after publishing the document.
linkedin_first_commentStringNoPlatform-specific first comment override. Takes priority over first_comment.
scheduled_dateStringNoISO 8601 date/time to publish the document later (e.g. 2026-09-01T10:00:00Z). Must be in the future. When present the request returns 202 with a job_id and the document is published by the scheduler.
timezoneStringNoIANA timezone (e.g. Europe/Madrid) used to interpret scheduled_date when it has no offset. Defaults to UTC.

Document Requirements​

RequirementValue
Supported FormatsPDF, PPT, PPTX, DOC, DOCX
Maximum File Size100 MB
Maximum Pages300 pages

Example Request (File Upload)​

curl -X POST "https://api.upload-post.com/api/upload_document" \
-H "Authorization: Apikey your-api-key-here" \
-F "user=your_profile" \
-F "platform[]=linkedin" \
-F "document=@/path/to/document.pdf" \
-F "title=My Presentation" \
-F "description=Check out this presentation on our latest product updates!"

Example Request (URL)​

curl -X POST "https://api.upload-post.com/api/upload_document" \
-H "Authorization: Apikey your-api-key-here" \
-F "user=your_profile" \
-F "platform[]=linkedin" \
-F "document=https://example.com/document.pdf" \
-F "title=My Presentation" \
-F "description=Check out this presentation!"

Example Request (Company Page)​

curl -X POST "https://api.upload-post.com/api/upload_document" \
-H "Authorization: Apikey your-api-key-here" \
-F "user=your_profile" \
-F "platform[]=linkedin" \
-F "document=@/path/to/document.pdf" \
-F "title=Company Update Q4 2024" \
-F "description=Our quarterly report is now available." \
-F "target_linkedin_page_id=12345678" \
-F "visibility=PUBLIC"

Example Request (Scheduled)​

curl -X POST https://api.upload-post.com/api/upload_document \
-H "Authorization: Apikey your-api-key-here" \
-F "user=my_profile" \
-F "platform[]=linkedin" \
-F "document=@/path/to/deck.pdf" \
-F "title=Q3 Results" \
-F "description=Our quarterly results, in 12 slides." \
-F "scheduled_date=2026-09-01T10:00:00" \
-F "timezone=Europe/Madrid"

Scheduled documents answer with 202 Accepted and a job_id; manage them with the scheduled posts endpoints like any other scheduled post.

Success Response​

{
"success": true,
"message": "Document uploaded successfully",
"request_id": "abc123def456",
"results": {
"linkedin": {
"success": true,
"document_urn": "urn:li:document:1234567890",
"post_id": "urn:li:activity:7654321098765432",
"url": "https://www.linkedin.com/feed/update/urn:li:activity:7654321098765432/",
"platform": "linkedin",
"content_type": "document",
"file_size": 1048576,
"filename": "document.pdf"
}
}
}

Error Response​

{
"success": false,
"message": "Document upload failed: Your title is too long for LinkedIn. LinkedIn limits the media title of a video or document post to 400 characters, counting each emoji as two.",
"request_id": "abc123def456",
"results": {
"linkedin": {
"success": false,
"error": "Your title is too long for LinkedIn. LinkedIn limits the media title of a video or document post to 400 characters, counting each emoji as two.",
"error_source": "platform",
"linkedin_status": 422
}
}
}

Error status codes​

The HTTP status tells you what to do next, so you do not have to parse the message:

StatusMeaningWhat to do
400The request must change. Either we rejected it (error_source: "client" — unreadable URL, unsupported file, bad target_linkedin_page_id) or LinkedIn did (error_source: "platform" with a 4xx in linkedin_status — title too long, missing permission, connection needing reconnection).Fix the request or reconnect the account. Retrying as-is will fail again.
502LinkedIn is down or timed out. The failed platform result carries "retryable": true.Retry later with the same payload.
500A failure we could not attribute — ours.Retry; if it persists, contact support with the request_id.

A dead LinkedIn connection answers 400, not 401. A 401 from this API always means your Upload-Post credentials failed, never that a social account needs reconnecting.

How Documents Appear on LinkedIn​

When you upload a document:

  1. Native Viewer: LinkedIn displays the document in a native carousel/viewer format
  2. Page Navigation: Users can swipe or click through pages
  3. Preview: LinkedIn generates thumbnail previews for each page
  4. Download: Depending on visibility settings, users may be able to download the document

Platform Limitations​

PlatformDocument Support
LinkedInYes (native carousel/viewer)
FacebookNo
InstagramNo
TikTokNo
X (Twitter)No
YouTubeNo
PinterestNo
ThreadsNo
BlueskyNo
RedditNo

Notes​

  • Document processing may take a few seconds on LinkedIn's side before the post becomes fully visible
  • The document title appears as the post's media title, and LinkedIn limits it to 400 characters. Titles above that are trimmed and the response carries a warnings entry saying so — send the long text in description instead. See Character Limits.
  • The description/commentary appears as the post text above the document
  • For company pages, ensure the authenticated LinkedIn account has admin access to the page
  • LinkedIn may compress or optimize documents for viewing