/🔐 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:readlist connected social accounts.
  • posts:readread scheduled and published posts.
  • posts:writecreate, update, and delete posts.
  • media:writeupload files to the media library.
  • analytics:readread 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_STRING

2. 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/callback

3. 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_token
Next
API Reference → List Accounts
Continue