> ## 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.

> ## Agent Instructions
> Base URL: https://api.social-api.ai/v1. Send your API key in the Authorization header: Authorization: Bearer <your API key>.
> Every error response from /v1 is JSON: { "error": { "code", "message", "meta" (optional) }, "request_id" }. Branch on error.code; use error.message only for logs.
> A 429 response carries a Retry-After header, in seconds, when the limit has a known wait.
> Paginated list endpoints return next_cursor, at the top level or inside pagination (see /guides/pagination). Pass it as the cursor query parameter to get the next page. An absent or empty next_cursor means you have the last page.
> Treat every ID as an opaque string: do not parse it or assume a format.
> Support differs by platform and by operation. Check /platforms/overview before assuming an operation works on a platform. An unsupported operation returns 501 with error.code resource.not_supported.

# LinkedIn API

> Connect a LinkedIn member profile or company Page to publish posts, and on a Page read and answer comments and mentions.

The LinkedIn API in SocialAPI connects a LinkedIn member profile (`linkedin`) and, with beta access, a company Page (`linkedin_page`). A member connection publishes text, image, video, multi-image, and link posts as the person. A Page connection publishes as the Page and adds comments, mentions, and analytics. SocialAPI's own LinkedIn app connects both the profile and the Page, so you register nothing: see [Platform apps](/guides/platform-credentials).

## At a glance

| Field | Value |
| - | - |
| Platform slug | `linkedin` |
| Auth | OAuth 2.0 with LinkedIn Sign In (OpenID Connect) |
| Platform API | LinkedIn Posts API |
| Status | Available |

## Capabilities

An unsupported call returns `501 resource.not_supported`.

| Feature | Status | Condition |
| - | - | - |
| Publish text, image, video, multi-image, link posts | Yes | See [LinkedIn publishing](/platforms/linkedin/publishing) |
| Schedule a post | Yes | `scheduled_at` on the post |
| First comment on a post | No | `first_comment` is ignored |
| Update a published post | No | `PATCH /v1/posts/{pid}` returns `409 post.state_invalid` for a published post. Delete the post and publish a new one |
| Delete a published post | Yes | |
| List posts | Partial | Returns the posts you published through SocialAPI, not a live read from LinkedIn |
| Comments | Beta | Page connection (`linkedin_page`, beta access): list, reply, like, and delete. Profile connection (`connection_type: "profile"`, beta access): reply, like, and delete only, because LinkedIn does not allow reading comments on a member's posts: listing returns `501 resource.not_supported`. The default member connection returns `501 resource.not_supported` for every comment call. Hide and private reply are not supported |
| Analytics | Beta | `GET /v1/platforms/linkedin/insights` on a Page connection or on a profile connection: see [Insights](#insights-beta). The default member connection has none. Live post metrics return `501 resource.not_supported` |
| DMs | No | `501 resource.not_supported` |
| Mentions | Beta | Page connection only (beta access): `GET /v1/accounts/{id}/mentions` returns posts and comments that mention the Page from the last 60 days, and `POST /v1/accounts/{id}/mentions/reply` answers them as the Page. Member and profile connections return `501 resource.not_supported` |
| Reviews | No | LinkedIn has no reviews. `GET /v1/inbox/reviews/{account_id}` returns `422 account.platform_unsupported` |
| Automations | No | `422 automation.platform_unsupported` |
| Webhook events | Partial | `account.connected` and the `post.*` events |

The cross-platform matrix is on [Platforms](/platforms/overview).

## Connect an account

Connect with `POST /v1/accounts/connect` and `"platform": "linkedin"`. The shared flow, request fields, and result are in [Connect accounts](/guides/connect-accounts), and the redirect parameters are in [Redirect parameters](/guides/connect-accounts#redirect-parameters).

```bash theme={null}
curl -X POST https://api.social-api.ai/v1/accounts/connect \
  -H "Authorization: Bearer $SOCAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "platform": "linkedin",
    "redirect_uri": "https://app.example.com/oauth/callback",
    "state": "session_abc123"
  }'
```

Response (HTTP 202):

```json theme={null}
{
  "auth_url": "https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=77abc123&state=4a8f2c1e9b3d7f06a5c2e8b4d1f3a7e2",
  "state": "4a8f2c1e9b3d7f06a5c2e8b4d1f3a7e2",
  "message": "Open this link to connect your linkedin account. Once you've authorized, the account will be connected automatically."
}
```

LinkedIn-specific rules:

* **Member connection.** The connected account is the person who signed in. Posts publish to that person's feed.
* **Profile connection (beta).** Send `"metadata": {"connection_type": "profile"}` to connect the member for posting, replying to comments, and analytics as that person. This option is in beta and available to accounts with beta access. `GET /v1/accounts` returns `connection_type: "profile"` on these accounts and omits the field on every other account. See [Insights](#insights-beta).
* **Company Page connection (beta).** Connect with `"platform": "linkedin_page"` to act as a company Page you administer. This option is in beta and available to accounts with beta access. The account publishes as the Page and supports comments, mentions, and [insights](#insights-beta).
* **Token lifetime.** LinkedIn access tokens last 60 days and cannot be refreshed. When one expires, the first call that fails returns `401 platform.linkedin.auth` and the account is marked `token_expired`. Every later call that acts on the account returns `403 account.reconnection_required` until you reconnect it. See [Reconnect an account](/guides/connect-accounts#reconnect-an-account).
* **Disconnect.** LinkedIn offers apps no way to end an authorization. Disconnecting an account removes it from SocialAPI, and the person removes SocialAPI's app in their LinkedIn settings.

## Insights (beta)

`GET /v1/platforms/linkedin/insights?account_id={id}` returns the follower count and per-post counts for a company Page or for a profile connected with `connection_type` `profile`. `kind` tells them apart: `member` for a profile, `organization` for a Page. On a Page, `posts` covers the Page's 50 most recent posts.

* On a profile, `posts` covers the 5 most recent posts published to the profile through SocialAPI. It is an empty array until you publish one, and `follower_count` is returned either way.
* Each profile post returns `impressions`, `unique_views`, `likes`, `comments`, and `shares`. `clicks` and `engagement_rate` are always 0 for a profile.
* A count LinkedIn cannot return for a post is 0.
* The route requires the `analytics.read` [permission](/guides/permissions).

## Webhook events

| Event | When it fires |
| - | - |
| `account.connected` | The account was connected |
| `account.updated` | The account lost [permissions](/guides/permissions) you did not remove yourself (`change` is `permissions_reduced`) |
| `post.published`, `post.partial`, `post.failed` | A post to this account finished: see [Delivery](/guides/delivery) |

Every event is described in [Webhook events](/guides/webhook-events).

## Limits

| Limit | Value |
| - | - |
| Post text | 3,000 characters |
| Multi-image post | 2 to 20 images |
| Posts | 25 per hour and 50 per 24 hours for each account: see [Posting velocity caps](/guides/rate-limits#posting-velocity-caps) |
| LinkedIn's own rate limit | `429 platform.linkedin.rate_limit`. Credit rules: see [when a credit comes back](/guides/plans#when-a-credit-comes-back) |

## Scopes

SocialAPI's LinkedIn app requests these scopes at connect. You apply for no app review. Each scope belongs to the account [permissions](/guides/permissions) in the last column, and the consent screen asks for the scopes of the permissions you selected.

| Scope | Used for | Permissions |
| - | - | - |
| `openid`, `profile` | Identify the member: name, picture, and ID | Every account |
| `w_member_social` | Publish posts as the member | `posts.write` |

A profile connected with `connection_type: "profile"` (beta) requests these scopes instead:

| Scope | Used for | Permissions |
| - | - | - |
| `r_basicprofile` | Identify the member: name, picture, and ID | Every account |
| `w_member_social` | Publish posts as the member | `posts.write` |
| `w_member_social_feed` | Reply to comments on the member's posts | `comments.write` |
| `r_member_postAnalytics`, `r_member_profileAnalytics` | Post counts and the follower count | `analytics.read` |

A company Page connection (`linkedin_page`, beta) requests these scopes:

| Scope | Used for | Permissions |
| - | - | - |
| `r_basicprofile`, `rw_organization_admin` | Identify the member and list the Pages they administer | Every account |
| `r_organization_social` | Read the Page's posts | `posts.read` |
| `w_organization_social` | Publish posts as the Page | `posts.write` |
| `r_organization_social_feed` | Read comments on the Page's posts | `comments.read` |
| `w_organization_social_feed` | Reply to, like, and delete comments | `comments.write` |
| `r_organization_followers` | Follower count and post statistics | `analytics.read` |

## Related

* [LinkedIn publishing](/platforms/linkedin/publishing): fields, media rules, text formatting, and quirks for publishing
* [Connect accounts](/guides/connect-accounts): the shared connect flow
* [Platforms](/platforms/overview): the capability matrix
* [Errors](/guides/errors): every error code


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.