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
| Name | Value | Description |
|---|---|---|
| Authorization | Apikey your-api-key-here | Your API key for authentication |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| user | String | Yes | User identifier (profile name) |
| platform[] | Array | Yes | Must be ["linkedin"] - only LinkedIn supports document uploads |
| document | File/URL | Yes | The document file to upload (file upload or URL). Supported formats: PDF, PPT, PPTX, DOC, DOCX |
| title | String | Yes | Document 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. |
| description | String | No | Post commentary/text that appears above the document |
| visibility | String | No | Visibility setting: "PUBLIC", "CONNECTIONS", "LOGGED_IN", or "CONTAINER". Default: "PUBLIC" |
| target_linkedin_page_id | String | No | LinkedIn organization/page ID to post to a company page instead of personal profile |
| first_comment | String | No | Automatically post a first comment after publishing the document. |
| linkedin_first_comment | String | No | Platform-specific first comment override. Takes priority over first_comment. |
| scheduled_date | String | No | ISO 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. |
| timezone | String | No | IANA timezone (e.g. Europe/Madrid) used to interpret scheduled_date when it has no offset. Defaults to UTC. |
Document Requirements
| Requirement | Value |
|---|---|
| Supported Formats | PDF, PPT, PPTX, DOC, DOCX |
| Maximum File Size | 100 MB |
| Maximum Pages | 300 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:
| Status | Meaning | What to do |
|---|---|---|
400 | The 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. |
502 | LinkedIn is down or timed out. The failed platform result carries "retryable": true. | Retry later with the same payload. |
500 | A 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:
- Native Viewer: LinkedIn displays the document in a native carousel/viewer format
- Page Navigation: Users can swipe or click through pages
- Preview: LinkedIn generates thumbnail previews for each page
- Download: Depending on visibility settings, users may be able to download the document
Platform Limitations
| Platform | Document Support |
|---|---|
| Yes (native carousel/viewer) | |
| No | |
| No | |
| TikTok | No |
| X (Twitter) | No |
| YouTube | No |
| No | |
| Threads | No |
| Bluesky | No |
| No |
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
warningsentry saying so — send the long text indescriptioninstead. 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
Related Endpoints
- Upload Video - Upload videos to multiple platforms
- Upload Photo - Upload images to multiple platforms
- Upload Text - Post text-only content
- Get LinkedIn Pages - List available LinkedIn pages for your account