Skip to main content
Available LinkedIn is fully supported for posts, comments, moderation, and publishing.

Details

FieldValue
Platform sluglinkedin
Auth typeOAuth 2.0 (LinkedIn)
APILinkedIn API v2

Feature support

FeatureSupportedNotes
List postsProfile and page posts
CommentsScoped to a specific post
Reply to comment
Comment replies (thread)
Moderate commentdelete onlyHide/unhide not supported by LinkedIn API
Toggle post comments
DMs-Not supported by LinkedIn API
Reviews-Not applicable
Mentions-Not supported via LinkedIn API
Create postText, images, articles
Update postText only - media cannot be updated
Delete post

Connecting

curl -X POST https://api.social-api.ai/v1/accounts/connect \
  -H "Authorization: Bearer $SOCAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "platform": "linkedin",
    "metadata": {
      "redirect_uri": "https://app.example.com/oauth/callback"
    }
  }'
Response:
{
  "auth_url": "https://www.linkedin.com/oauth/v2/authorization?client_id=...&state=...",
  "state": "4a8f2c1e9b3d7f06a5c2e8b4d1f3a7e2"
}
Redirect your user to auth_url. After they authorize, LinkedIn redirects to your redirect_uri with ?code=...&state=.... Then call:
curl -X POST https://api.social-api.ai/v1/oauth/exchange \
  -H "Authorization: Bearer $SOCAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "platform": "linkedin",
    "code": "AQR1234...",
    "metadata": {
      "state": "4a8f2c1e9b3d7f06a5c2e8b4d1f3a7e2",
      "redirect_uri": "https://app.example.com/oauth/callback"
    }
  }'

Sample: List posts

curl "https://api.social-api.ai/v1/accounts/{id}/posts?limit=10" \
  -H "Authorization: Bearer $SOCAPI_KEY"

Sample: List comments on a post

curl "https://api.social-api.ai/v1/accounts/{id}/posts/{post_id}/comments?limit=10" \
  -H "Authorization: Bearer $SOCAPI_KEY"

Publishing

Create a LinkedIn organization page post:
curl -X POST https://api.social-api.ai/v1/posts \
  -H "Authorization: Bearer $SOCAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "account_ids": ["acc_01HZ9X3Q4R5M6N7P8V2K0W1J"],
    "text": "Exciting news from our team!",
    "media_ids": ["https://cdn.example.com/photo.jpg"]
  }'
For the full field reference, media constraints, and error recovery, see LinkedIn posts.

Notes

  • Moderation - LinkedIn only supports deleting comments. Hide and unhide actions return 501.
  • Post updates - Only the text content of a post can be updated. Media attachments cannot be changed after publishing.
  • Toggle comments - You can enable or disable comments on posts you own.
  • Token refresh - LinkedIn OAuth tokens expire after 60 days. SocialAPI handles refresh automatically. If you receive 401 with code: "invalid_token", reconnect the account.
  • Required scopes - Your LinkedIn App must have these scopes approved: r_liteprofile, rw_organization_admin, r_organization_social, w_organization_social.