pos_ access token. PostQueen supports the OAuth2 Authorization Code flow.
That token works on the Public API: list their connected channels, create and schedule posts, and pull analytics for their accounts.
OAuth tokens work with all the same Public API endpoints as API keys. The only difference is how the token is obtained.
How It Works
Implementation
1
Register Your OAuth App
Go to Settings > Developers > Apps in your PostQueen dashboard and create an OAuth application.You will need:
Each organization has one OAuth application. The Developers tab appears for organization admins on a plan that includes the public API.
- App Name - displayed to users on the consent screen
- Description (optional) - explains what your app does
- Profile Picture (optional) - shown on the consent screen
- Redirect URL - where PostQueen sends users after they approve/deny access
- Client ID - a public identifier for your app (starts with
pca_) - Client Secret - a secret key for token exchange (starts with
pcs_)
2
Redirect Users to Authorize
When a user wants to connect their PostQueen account to your app, redirect them to:Self-hosting? Use The user will see a consent screen showing your app’s name, description, and the permissions being requested. They can choose to Authorize or Deny.
https://postqueen.example.com/oauth/authorize instead.Example:
3
Catch the callback
After the user makes a decision, PostQueen redirects them to your Redirect URL with query parameters.If approved:
If denied:
4
Exchange Code for Token
Make a server-side
POST request to exchange the authorization code for an access token:Self-hosting? The token endpoint is
https://postqueen.example.com/api/oauth/token.Response:An
access_token in the response means the grant is complete. Store the token, not the code: the code is spent.5
Make API Calls
Use the access token in the The token works with all Public API endpoints:
Authorization header, just like you would with an API key:- List Integrations
- Create Posts
- View Analytics
- And all other endpoints documented in this API reference
OAuth tokens do not expire. Users can revoke access at any time from Settings > Approved Apps in their PostQueen dashboard.
Managing Your App
Rotate Client Secret
If your client secret is compromised, go to Settings > Developers > Apps and click Rotate Secret. This invalidates the old secret immediately, and any token exchange requests using the old secret will fail.Rotating the secret does not invalidate existing access tokens. Only new token exchange requests require the new secret.
Delete Your App
Full Example (Node.js)
Express app: redirect, callback, token exchange, first API call
Express app: redirect, callback, token exchange, first API call
Error Reference
Next steps
Check a client_id first
GET /oauth/authorize, the call behind the consent screen.Exchange the code
POST /oauth/token, field by field, with its failure modes.List the user's channels
The first call most apps make with a fresh
pos_ token.Rate limits and errors
Base URLs, the per-hour limit, and what each status code means.