Skip to content

LinkedIn API Setup

Admin walkthrough for the LinkedIn integration. For the end-user connect flow see Connections → LinkedIn.

Overview

Form fieldOptions key
Client IDlinkedin_client-id
Client Secretlinkedin_client-secret
Statuslinkedin_integration_status

ENV fallback: LINKEDIN_CLIENT_ID + LINKEDIN_CLIENT_SECRET.

Step-by-step on developer.linkedin.com

1. Sign in and create an app

Go to https://developer.linkedin.comMy Apps → Create app. You need a LinkedIn Company Page to associate the app with — create one in advance if you don't have one.

Provide:

  • App name
  • LinkedIn Page (the company that owns the app)
  • Privacy policy URL: https://sosyabot.com/privacy (or your own)
  • App logo

2. Add the products you need

In the new app's Products tab, request:

  • Sign In with LinkedIn using OpenID Connect — required for openid + profile scopes (auto-approved).
  • Share on LinkedIn — required for w_member_social (auto-approved for personal profiles).
  • Marketing Developer Platform — required for w_organization_social (Company Page publishing). This requires a manual application to LinkedIn and can take several weeks.

3. Configure OAuth 2.0

Open the Auth tab.

  • Authorized redirect URLs for your app:
    https://app.sosyabot.com/api/v1/auth/linkedin/callback
    Self-hosters: substitute your BASE_URL.
  • Save.

4. Grab Client ID + Client Secret

The same Auth tab lists Client ID and Client Secret under Application credentials. Copy both — Client Secret can be re-revealed later, unlike X.

Pasting into Sosyabot admin panel

Open /admin/api-integration/linkedin. Paste both fields, set Status: Enable, Save, then click Test credentials.

Failure messages:

  • LinkedIn integration disabled: client id/secret not configured → admin + ENV empty.

Verification

/app/channels → Connect → LinkedIn → OAuth → approve openid profile w_member_social → bounce back, channel active. Post a test update from /app/publishing.

Troubleshooting

SymptomCauseFix
LinkedIn integration disabled: client id/secret not configuredAdmin + ENV emptyComplete steps 1–4.
redirect_uri does not matchAuthorized redirect URLs mismatchAdd the exact …/api/v1/auth/linkedin/callback.
unauthorized_scope_error for w_organization_socialMarketing Developer Platform not approvedApply for the product; until then post to personal profiles only.
Token expires after ~60 daysLinkedIn long-lived tokens cap at 60 daysSosyabot doesn't auto-refresh; users reconnect after expiry.

ENV fallback

LINKEDIN_CLIENT_ID=<your client id>
LINKEDIN_CLIENT_SECRET=<your client secret>

After editing .env run ./service.sh restart api.