LinkedIn API Setup
Admin walkthrough for the LinkedIn integration. For the end-user connect flow see Connections → LinkedIn.
Overview
| Form field | Options key |
|---|---|
| Client ID | linkedin_client-id |
| Client Secret | linkedin_client-secret |
| Status | linkedin_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.com → My 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+profilescopes (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:Self-hosters: substitute your
https://app.sosyabot.com/api/v1/auth/linkedin/callbackBASE_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
| Symptom | Cause | Fix |
|---|---|---|
LinkedIn integration disabled: client id/secret not configured | Admin + ENV empty | Complete steps 1–4. |
redirect_uri does not match | Authorized redirect URLs mismatch | Add the exact …/api/v1/auth/linkedin/callback. |
unauthorized_scope_error for w_organization_social | Marketing Developer Platform not approved | Apply for the product; until then post to personal profiles only. |
| Token expires after ~60 days | LinkedIn long-lived tokens cap at 60 days | Sosyabot 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.