How to Post to LinkedIn via API

8 min read B2B teamsUpdated 2026-05-06

LinkedIn's API has historically been the most fragmented of the major social networks: separate endpoints for UGC posts (personal profiles) and Organization shares (Company Pages), each with different OAuth scopes, permissions models, and rate limits. CodivUpload abstracts both behind a single platforms=["linkedin"] entry. The trick is the linkedin_page_id override: leave it empty to post to the connected personal profile, or pass the Organization ID to post to a Company Page where the connected user has admin rights. This guide shows the connect flow, both posting paths, and the LinkedIn-specific overrides like visibility (PUBLIC vs CONNECTIONS) and how multi-image posts differ between personal and company contexts.

Prerequisites

  • A LinkedIn personal account, or admin access to a LinkedIn Company Page
  • A CodivUpload profile with LinkedIn connected
  • An API key from Dashboard → API Keys

Step-by-step

  1. 1

    Connect LinkedIn inside a CodivUpload profile

    Dashboard → Profiles → Connect → LinkedIn. CodivUpload requests scopes for both personal posting (w_member_social) and organization posting (w_organization_social). The OAuth callback auto-detects which Company Pages the connected user has admin or content-admin rights on — those Pages become available as targets via the linkedin_page_id override.

  2. 2

    Post to your personal profile

    Set platforms=["linkedin"] and omit linkedin_page_id. CodivUpload routes the post to LinkedIn's UGC endpoint, attributed to the connected personal account. Use linkedin_visibility to control reach: PUBLIC means anyone on or off LinkedIn can see it, CONNECTIONS limits visibility to your first-degree network.

    curl -X POST https://api.codivupload.com/v1/posts \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "post_type": "text",
        "profile_name": "my_brand",
        "platforms": ["linkedin"],
        "description": "Three lessons from shipping our v2 API:\n\n1. Async beats elegant.\n2. Type-check the boundaries.\n3. Webhooks > polling, always.",
        "linkedin_visibility": "PUBLIC"
      }'
  3. 3

    Post to a Company Page

    Pass linkedin_page_id with the Organization URN's numeric ID (find it in your Company Page's admin URL: linkedin.com/company/123456 → page ID is 123456). CodivUpload routes the call to LinkedIn's Organization shares endpoint, attributed to the Company Page itself rather than the admin user. Pages support the same content types as personal profiles plus a few extras (e.g. multi-image carousels).

    curl -X POST https://api.codivupload.com/v1/posts \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "post_type": "image",
        "profile_name": "my_brand",
        "platforms": ["linkedin"],
        "media_urls": ["https://your-cdn.example.com/launch-banner.jpg"],
        "description": "Today we shipped CodivUpload v2 — the cross-platform publishing API that nine other platforms make harder than it has to be.",
        "linkedin_visibility": "PUBLIC",
        "linkedin_page_id": "123456789"
      }'
  4. 4

    Attach images, video, or document carousels

    Set post_type=image with up to nine images for a carousel, post_type=video with a single MP4 URL, or post_type=document for PDF carousels (LinkedIn supports up to 300 pages). Animated GIFs are not supported through LinkedIn's API — convert to MP4 if you need motion. Use linkedin_page_id only when targeting a Company Page; for personal posts omit it entirely.

  5. 5

    Schedule for later or use best-time scheduling

    Add scheduled_date in ISO 8601 UTC, or schedule_best_time=true to let CodivUpload pick the optimal slot based on the connected account's last 90 days of LinkedIn analytics. LinkedIn's algorithm rewards posts that get engagement in the first hour, so picking the right slot matters — best-time scheduling typically lifts initial engagement by 30-50% versus posting at random times.

Frequently asked

Can I tag people in LinkedIn posts?+

Mentions via @ syntax inside the description text are supported on personal posts. LinkedIn's API parses them server-side and converts to mentions if the user grants you permission to mention them — otherwise the @ remains as plain text. Company Page mentions of personal users follow the same rules.

Why is my Company Page missing from the linkedin_page_id options?+

You must be a Page admin or content admin. Super admin permission is best — viewer or analyst roles cannot publish via API. Verify in LinkedIn → your Page → Admin tools → Page admins. After granting yourself the right role, disconnect and reconnect LinkedIn in CodivUpload to refresh the available Pages list.

What's the LinkedIn API rate limit?+

100 calls per user per day for UGC posts, separate 100/day per Organization for Company Page shares. CodivUpload tracks usage per connected account and surfaces remaining quota in the Dashboard → Profiles → LinkedIn detail view. Hitting the daily limit returns a 429 from LinkedIn — CodivUpload defers the post to the next reset window automatically.

Can I post a clickable link with a custom preview?+

Yes. Include the URL inside the description text and LinkedIn auto-fetches the OG image, title, and description from the page. The preview is unstyleable — LinkedIn does not let third-party APIs override the OG fields. To get the preview you want, set the OG tags correctly on the destination page.

How do I post a multi-image carousel?+

Set post_type=image and pass up to nine items in media_urls. LinkedIn renders them as a swipeable carousel on personal posts. Note that Company Page carousels render slightly differently — first image is dominant and subsequent ones are tiled below.

Is video posting supported?+

Yes — set post_type=video with a single MP4 URL in media_urls. Max file size 5 GB, max duration 10 minutes, 16:9 or 9:16 aspect ratios both work. LinkedIn re-encodes server-side; expect a 5-15 minute processing delay before the video is visible to viewers.

Can I disable comments on a LinkedIn post?+

Not via the API. LinkedIn doesn't expose a comment-disable parameter on the UGC or Organization shares endpoints. Comment moderation has to happen post-publish from the LinkedIn UI.

Related guides

Ready to automate?

Free plan includes 30 posts/month across 11 platforms. No credit card required.

See pricing