Platforms
LinkedIn API
Post to LinkedIn with Late API - Personal profiles, Company pages, images, videos, and documents
Quick Start
Post to LinkedIn in under 60 seconds:
curl -X POST https://getlate.dev/api/v1/posts \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Excited to share our latest update! 🚀\n\nWe have been working hard on this feature...",
"platforms": [
{"platform": "linkedin", "accountId": "YOUR_ACCOUNT_ID"}
],
"publishNow": true
}'const response = await fetch('https://getlate.dev/api/v1/posts', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
content: 'Excited to share our latest update! 🚀\n\nWe have been working hard on this feature...',
platforms: [
{ platform: 'linkedin', accountId: 'YOUR_ACCOUNT_ID' }
],
publishNow: true
})
});
const { post } = await response.json();
console.log('Posted to LinkedIn!', post._id);import requests
response = requests.post(
'https://getlate.dev/api/v1/posts',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
json={
'content': 'Excited to share our latest update! 🚀\n\nWe have been working hard on this feature...',
'platforms': [
{'platform': 'linkedin', 'accountId': 'YOUR_ACCOUNT_ID'}
],
'publishNow': True
}
)
post = response.json()
print(f"Posted to LinkedIn! {post['_id']}")Image Requirements
| Property | Requirement |
|---|---|
| Max Images | 20 per post |
| Formats | JPEG, PNG, GIF |
| Max File Size | 8 MB per image |
| Recommended | 1200 × 627 px |
| Min Dimensions | 552 × 276 px |
| Max Dimensions | 8192 × 8192 px |
Aspect Ratios
| Type | Ratio | Dimensions | Use Case |
|---|---|---|---|
| Landscape | 1.91:1 | 1200 × 627 px | Link shares, standard |
| Square | 1:1 | 1080 × 1080 px | Engagement |
| Portrait | 1:1.25 | 1080 × 1350 px | Mobile feed |
Multi-Image Posts
LinkedIn supports up to 20 images in carousel-style posts:
curl -X POST https://getlate.dev/api/v1/posts \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Highlights from our team retreat! 🏔️",
"mediaItems": [
{"url": "https://example.com/photo1.jpg"},
{"url": "https://example.com/photo2.jpg"},
{"url": "https://example.com/photo3.jpg"}
],
"platforms": [
{"platform": "linkedin", "accountId": "YOUR_ACCOUNT_ID"}
],
"publishNow": true
}'const response = await fetch('https://getlate.dev/api/v1/posts', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
content: 'Highlights from our team retreat! 🏔️',
mediaItems: [
{ url: 'https://example.com/photo1.jpg' },
{ url: 'https://example.com/photo2.jpg' },
{ url: 'https://example.com/photo3.jpg' }
],
platforms: [
{ platform: 'linkedin', accountId: 'YOUR_ACCOUNT_ID' }
],
publishNow: true
})
});response = requests.post(
'https://getlate.dev/api/v1/posts',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
json={
'content': 'Highlights from our team retreat! 🏔️',
'mediaItems': [
{'url': 'https://example.com/photo1.jpg'},
{'url': 'https://example.com/photo2.jpg'},
{'url': 'https://example.com/photo3.jpg'}
],
'platforms': [
{'platform': 'linkedin', 'accountId': 'YOUR_ACCOUNT_ID'}
],
'publishNow': True
}
)Video Requirements
| Property | Requirement |
|---|---|
| Max Videos | 1 per post |
| Formats | MP4, MOV, AVI |
| Max File Size | 5 GB |
| Max Duration | 15 minutes (personal), 30 min (Pages) |
| Min Duration | 3 seconds |
| Resolution | 256 × 144 px to 4096 × 2304 px |
| Aspect Ratio | 1:2.4 to 2.4:1 |
| Frame Rate | 10-60 fps |
Recommended Video Specs
| Property | Recommended |
|---|---|
| Resolution | 1920 × 1080 px (1080p) |
| Aspect Ratio | 16:9 (landscape) or 1:1 (square) |
| Frame Rate | 30 fps |
| Codec | H.264 |
| Audio | AAC, 192 kbps |
| Bitrate | 10-30 Mbps |
Document Posts
LinkedIn uniquely supports PDF documents:
| Property | Requirement |
|---|---|
| Max Documents | 1 per post |
| Formats | PDF, PPT, PPTX, DOC, DOCX |
| Max File Size | 100 MB |
| Max Pages | 300 pages |
Documents display as carousels users can swipe through:
curl -X POST https://getlate.dev/api/v1/posts \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Download our 2024 Industry Report 📊",
"mediaItems": [
{"url": "https://example.com/report.pdf"}
],
"platforms": [
{"platform": "linkedin", "accountId": "YOUR_ACCOUNT_ID"}
],
"publishNow": true
}'const response = await fetch('https://getlate.dev/api/v1/posts', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
content: 'Download our 2024 Industry Report 📊',
mediaItems: [
{ url: 'https://example.com/report.pdf' }
],
platforms: [
{ platform: 'linkedin', accountId: 'YOUR_ACCOUNT_ID' }
],
publishNow: true
})
});response = requests.post(
'https://getlate.dev/api/v1/posts',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
json={
'content': 'Download our 2024 Industry Report 📊',
'mediaItems': [
{'url': 'https://example.com/report.pdf'}
],
'platforms': [
{'platform': 'linkedin', 'accountId': 'YOUR_ACCOUNT_ID'}
],
'publishNow': True
}
)Document Tips
- First page is the cover/preview
- Design for mobile viewing
- Keep text readable (large fonts)
- Ideal: 10-15 pages for engagement
Link Previews
When posting text with URLs and no media, LinkedIn auto-generates link previews:
{
"content": "Check out our latest blog post! https://example.com/blog/new-post",
"platforms": [
{ "platform": "linkedin", "accountId": "acc_123" }
]
}Disable Link Preview
To post a URL without the preview card:
{
"platforms": [
{
"platform": "linkedin",
"accountId": "acc_123",
"platformSpecificData": {
"disableLinkPreview": true
}
}
]
}First Comment
Add an automatic first comment:
{
"platforms": [
{
"platform": "linkedin",
"accountId": "acc_123",
"platformSpecificData": {
"firstComment": "What do you think? Share your thoughts below! 👇"
}
}
]
}GIF Support
GIFs on LinkedIn:
- Converted to video format
- Auto-play in feed (muted)
- Max recommended: 10 MB
- Counts as video (1 per post limit)
Common Issues
"Cannot mix media types"
LinkedIn doesn't allow images + videos or images + documents. Choose one type per post.
Document not displaying
- Check file size (≤100 MB)
- Ensure valid format (PDF recommended)
- Password-protected PDFs won't work
Video processing failed
- Ensure codec is H.264
- Check duration limits (15 min personal, 30 min Pages)
- Verify aspect ratio is between 1:2.4 and 2.4:1
Link preview wrong image
The preview uses Open Graph meta tags from the URL. Update the og:image tag on your website.
Related API Endpoints
- Connect LinkedIn Account — OAuth flow
- Create Post — Post creation and scheduling
- Upload Media — Image and video uploads
- LinkedIn Mentions — Track mentions
- Analytics — Post performance metrics