How do I post to LinkedIn with an API?
Send a request to Upload-Post with platform[]=linkedin: POST https://api.upload-post.com/api/upload for video, POST /api/upload_photos for images, POST /api/upload_text for text-only posts and POST /api/upload_document for native PDF/PPT/DOC document posts. Upload-Post uses its own approved LinkedIn app, so you skip the LinkedIn developer-program application and the Marketing API access request entirely. Connect the LinkedIn account once via OAuth, then post to the member profile or to any company page they administer.
Steps
- Create an account at upload-post.com and generate an API key under API Keys (Authentication).
- Connect LinkedIn at Manage Users (or via a white-label JWT link for your users).
- Post a video:
- cURL
- Python
- JavaScript
curl \
-H 'Authorization: Apikey your-api-key-here' \
-F 'video=@/path/to/your/video.mp4' \
-F 'title="Your Video Title"' \
-F 'description="Post commentary shown above the video"' \
-F 'user="test"' \
-F 'platform[]=linkedin' \
-X POST https://api.upload-post.com/api/upload
import requests
response = requests.post(
"https://api.upload-post.com/api/upload",
headers={"Authorization": "Apikey your-api-key-here"},
files={"video": open("/path/to/your/video.mp4", "rb")},
data={
"title": "Your Video Title",
"description": "Post commentary shown above the video",
"user": "test",
"platform[]": "linkedin",
},
)
print(response.json())
import fs from "node:fs";
const form = new FormData();
form.append("video", new Blob([fs.readFileSync("/path/to/your/video.mp4")]), "video.mp4");
form.append("title", "Your Video Title");
form.append("description", "Post commentary shown above the video");
form.append("user", "test");
form.append("platform[]", "linkedin");
const response = await fetch("https://api.upload-post.com/api/upload", {
method: "POST",
headers: { Authorization: "Apikey your-api-key-here" },
body: form,
});
console.log(await response.json());
Post as a company page
By default posts go to the member's personal profile. To post as an organization, pass target_linkedin_page_id with the page ID from Get LinkedIn Pages:
curl \
-H 'Authorization: Apikey your-api-key-here' \
-F 'user="test"' \
-F 'platform[]=linkedin' \
-F 'title="Our company is launching a new product!"' \
-F 'target_linkedin_page_id="your_linkedin_page_id_here"' \
-X POST https://api.upload-post.com/api/upload_text
Text posts and documents
- Text-only posts (optionally with a link preview via
linkedin_link_url): Upload Text. - Documents (PDF, PPT/PPTX, DOC/DOCX rendered as a native LinkedIn carousel viewer): Upload Document, aka
POST /api/upload_document.
Useful LinkedIn parameters
Full list in the Upload Video reference:
| Parameter | What it does | Default |
|---|---|---|
linkedin_title | LinkedIn-specific title (falls back to title) | title |
linkedin_description / description | Sent as the LinkedIn commentary | title |
visibility | PUBLIC, CONNECTIONS, LOGGED_IN, CONTAINER | PUBLIC |
target_linkedin_page_id | Post as an organization page | none |
first_comment / linkedin_first_comment | Auto-post a first comment | none |
scheduled_date | ISO-8601 date to schedule the post | none |
Limits and gotchas
- Daily cap: 150 LinkedIn posts per connected account per rolling 24 h (upload limits).
- Video specs: up to 5 GB / 10 min. See Video Requirements.
- Token expiry: LinkedIn tokens last ~60 days and auto-refresh with regular use (FAQ).