> ## Documentation Index
> Fetch the complete documentation index at: https://docs.social-api.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# LinkedIn

> Connect a LinkedIn member account to publish posts as the individual, or connect a LinkedIn organization page (beta).

## Overview

The LinkedIn connector lets you publish posts as the **authenticated individual member** (your personal LinkedIn profile). It authenticates through LinkedIn's OAuth 2.0 flow with OpenID Connect and uses the "Share on LinkedIn" REST API.

Organization (company) page support is available in beta via the separate `linkedin_page` platform identifier. See [LinkedIn organization pages](#linkedin-organization-pages-beta) below.

## Capabilities

### LinkedIn member (`linkedin`)

| Capability                                      | Supported |
| ----------------------------------------------- | --------- |
| Publish posts (text, image, video, multi-image) | Yes       |
| Update post text                                | Yes       |
| Delete posts                                    | Yes       |
| Read posts                                      | No        |
| Comments                                        | No        |
| Direct messages                                 | No        |
| Reviews                                         | No        |
| Mentions                                        | No        |

Posts only. Reading existing posts from the platform, comments, DMs, reviews, and mentions are not available for member accounts. Direct messages, reviews, and mentions are not offered by LinkedIn's API and will remain unavailable.

### LinkedIn organization page (`linkedin_page`, beta)

| Capability                                      | Supported  |
| ----------------------------------------------- | ---------- |
| Publish posts (text, image, video, multi-image) | Yes (beta) |
| Update post text                                | Yes (beta) |
| Delete posts                                    | Yes (beta) |
| Read posts                                      | Yes (beta) |
| Comments (read, reply, like, delete)            | Yes (beta) |
| Page insights                                   | Yes (beta) |
| Direct messages                                 | No         |
| Reviews                                         | No         |
| Mentions                                        | No         |

## Authentication

LinkedIn uses OAuth 2.0. Connect an account through the standard connect flow:

1. Call the connect endpoint with `platform=linkedin`.
2. Redirect the user to the returned `auth_url`.
3. LinkedIn redirects back to your `redirect_uri` with a `code`.
4. The code is exchanged for an access token automatically.

### Scopes

The connector requests these scopes:

* `openid`, `profile` — identify the member (used to read the person's name, picture, and ID)
* `w_member_social` — publish posts as the member

### Token lifetime

LinkedIn member access tokens last about 60 days and cannot be refreshed programmatically. When a token expires, the member reconnects the account to continue publishing.

### Required header

All API calls send `LinkedIn-Version` (currently `202605`) and use the Rest.li protocol.

## Connecting an account

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.social-api.ai/v1/accounts/connect \
    -H "Authorization: Bearer $SOCIALAPI_KEY" \
    -H "Content-Type: application/json" \
    -d '{"platform": "linkedin", "redirect_uri": "https://yourapp.com/callback"}'
  ```
</CodeGroup>

After connecting, the response contains a single connected account: the authenticated member. That account is what you publish to.

## Publishing a post

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.social-api.ai/v1/posts \
    -H "Authorization: Bearer $SOCIALAPI_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "targets": [{ "account_id": "acc_01HZ9X3Q4R5M6N7P8V2K0W1J" }],
      "text": "Hello from SocialAPI!",
      "media_ids": ["f47ac10b-58cc-4372-a567-0e02b2c3d479"]
    }'
  ```
</CodeGroup>

Posts publish to the member's feed. You can attach a single image, a single video, or multiple images (a carousel). Mixed image and video carousels are not supported.

## LinkedIn organization pages (beta)

LinkedIn organization (company) page support is live in beta via the `linkedin_page` platform identifier. It uses the `w_organization_social` scope and the LinkedIn Community Management API.

Access is beta-gated: your account must have `linkedin_page` in its `allowed_platforms` list. Contact support to request access.

### Connecting an organization page

Pass `"connection_type": "organization"` inside the `"metadata"` field to anchor the credential on the first administered company page (the default behavior). The returned account includes all administered organization pages.

```bash theme={null}
curl -X POST https://api.social-api.ai/v1/accounts/connect \
  -H "Authorization: Bearer $SOCIALAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "platform": "linkedin_page",
    "redirect_uri": "https://yourapp.com/callback",
    "metadata": { "connection_type": "organization" }
  }'
```

### Scopes

The `linkedin_page` organization flow (default) requests these 7 scopes:

* `r_organization_followers`: read the company page's follower statistics
* `r_organization_social`: read the page's posts and comments
* `rw_organization_admin`: read and write page administrative data (manage the page)
* `r_organization_social_feed`: read the page's social feed
* `w_organization_social`: publish posts as the page
* `w_organization_social_feed`: create comments and replies on the page's feed
* `r_basicprofile`: resolve the connecting admin's identity via /v2/me

The optional `"connection_type": "personal"` variant uses a different scope set (`w_member_social`, `w_member_social_feed`, `r_member_postAnalytics`, `r_member_profileAnalytics`, `r_basicprofile`, `r_1st_connections_size`) and anchors the credential on the connecting member rather than a company page.

### Organization URN requirement

All org-page operations require the LinkedIn organization URN (for example, `urn:li:organization:12345678`). This URN is returned as the account's `platform_account_id` when the account is connected.

### Capabilities

The `linkedin_page` connector supports publishing posts (text, image, video, multi-image), reading posts, managing comments (read, reply, like, delete, hide), and retrieving page-level analytics via `GetPageInsights`. DMs, reviews, and mentions are not available through LinkedIn's API.

## Quirks and limitations

* LinkedIn member (`linkedin`) connects as the individual member. Use `linkedin_page` for organization pages.
* Reading a member's own posts from the platform requires elevated permissions and is not available, so listing posts returns the posts SocialAPI has stored, not a live read from LinkedIn.
* Comments, direct messages, reviews, and mentions are not available for member accounts. Use the `linkedin_page` connector for organization page comment management.
* LinkedIn does not scrape link previews; provide your own thumbnail, title, and description for article posts.
* The post URN is returned in a response header, not the body.
* Member access tokens last about 60 days with no programmatic refresh; the member reconnects when the token expires.
* LinkedIn does not provide a token revocation API; disconnecting removes the stored token on our side only.

## Next steps

<CardGroup cols={2}>
  <Card title="Publishing posts" icon="paper-plane" href="/posts/linkedin">
    Full reference for the LinkedIn post payload.
  </Card>

  <Card title="Publishing overview" icon="paper-plane" href="/posts/overview">
    How publishing works across platforms.
  </Card>
</CardGroup>
