Pinterest API Setup
Admin walkthrough for the Pinterest integration. End-user flow: Connections → Pinterest.
Overview
| Form field | Options key |
|---|---|
| App ID | pinterest_app-id |
| App Secret | pinterest_app-secret |
| Status | pinterest_integration_status |
ENV fallback: PINTEREST_APP_ID + PINTEREST_APP_SECRET.
Step-by-step on developers.pinterest.com
1. Sign in and create an app
https://developers.pinterest.com → My Apps → Connect app. Pinterest will prompt to create a developer profile if you don't have one (one-time form: company info, use case).
Provide:
- App name
- Description
- Website URL:
https://sosyabot.com
2. Configure redirect URI
In the new app's settings:
- Redirect URIs:Self-hosters: substitute
https://app.sosyabot.com/api/v1/auth/pinterest/callbackBASE_URL.
3. Request scopes
Pinterest API v5 scopes Sosyabot uses: boards:read, pins:read, pins:write, user_accounts:read. These are available immediately on Pinterest's Trial tier (limited request rate); for higher rate limits apply for Standard access via the Marketing API application form.
4. Grab App ID + App Secret
App settings page → App credentials. Copy App ID and App Secret.
Pasting into Sosyabot admin panel
/admin/api-integration/pinterest. Paste, Enable, Save, Test credentials.
Failure: Pinterest integration disabled: app id/secret not configured.
Verification
/app/channels → Connect → Pinterest → OAuth → approve → pick a default board on the post-connect screen. Pin a test image from /app/publishing.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
Pinterest integration disabled: app id/secret not configured | Admin + ENV empty | Steps 1–4. |
403 invalid scope on a v5 endpoint | Trial tier rate limit / scope unavailable | Apply for Standard access in the Pinterest Marketing API form. |
| Token expires after 30 days | Default Pinterest TTL | Sosyabot auto-refreshes via tokenRefresh.queue.ts 7 days before expiry — confirm the worker is running. |
Pin fails with board_id is invalid | User's selected default board no longer exists | User must re-select default board in channel settings. |
ENV fallback
PINTEREST_APP_ID=<your app id>
PINTEREST_APP_SECRET=<your app secret>After editing .env run ./service.sh restart api.