LateLate API
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

PropertyRequirement
Max Images20 per post
FormatsJPEG, PNG, GIF
Max File Size8 MB per image
Recommended1200 × 627 px
Min Dimensions552 × 276 px
Max Dimensions8192 × 8192 px

Aspect Ratios

TypeRatioDimensionsUse Case
Landscape1.91:11200 × 627 pxLink shares, standard
Square1:11080 × 1080 pxEngagement
Portrait1:1.251080 × 1350 pxMobile 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

PropertyRequirement
Max Videos1 per post
FormatsMP4, MOV, AVI
Max File Size5 GB
Max Duration15 minutes (personal), 30 min (Pages)
Min Duration3 seconds
Resolution256 × 144 px to 4096 × 2304 px
Aspect Ratio1:2.4 to 2.4:1
Frame Rate10-60 fps
PropertyRecommended
Resolution1920 × 1080 px (1080p)
Aspect Ratio16:9 (landscape) or 1:1 (square)
Frame Rate30 fps
CodecH.264
AudioAAC, 192 kbps
Bitrate10-30 Mbps

Document Posts

LinkedIn uniquely supports PDF documents:

PropertyRequirement
Max Documents1 per post
FormatsPDF, PPT, PPTX, DOC, DOCX
Max File Size100 MB
Max Pages300 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

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" }
  ]
}

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

The preview uses Open Graph meta tags from the URL. Update the og:image tag on your website.