/🔐 Authentication/OAuth 2.0
OAuth 2.0
OAuth 2.0 is the recommended flow when your app needs to act on behalf of PlanSched users. Use it whenever you're building a third-party integration or a public product.
Overview
PlanSched implements the standard authorization-code flow with PKCE. Register your app in the dashboard to receive a client_id and client_secret.
Scopes
- accounts:read — list connected social accounts.
- posts:read — read scheduled and published posts.
- posts:write — create, update, and delete posts.
- media:write — upload files to the media library.
- analytics:read — read post-level analytics.
1. Authorize the user
Redirect the user to the authorization endpoint:
https://api.plansched.com/oauth/authorize
?client_id=YOUR_CLIENT_ID
&redirect_uri=https://yourapp.com/callback
&response_type=code
&scope=posts:write+accounts:read
&state=RANDOM_STRING2. Exchange code for token
curl -X POST https://api.plansched.com/oauth/token \
-d client_id=YOUR_CLIENT_ID \
-d client_secret=YOUR_CLIENT_SECRET \
-d code=AUTH_CODE \
-d grant_type=authorization_code \
-d redirect_uri=https://yourapp.com/callback3. Refresh tokens
Access tokens expire after 1 hour. Use the refresh token to get a new one without user interaction.
curl -X POST https://api.plansched.com/oauth/token \
-d client_id=YOUR_CLIENT_ID \
-d client_secret=YOUR_CLIENT_SECRET \
-d refresh_token=REFRESH_TOKEN \
-d grant_type=refresh_tokenNext
API Reference → List Accounts