Skip to main content
On a self-hosted PostQueen the X app is yours. PostQueen connects X accounts with OAuth 1.0a and publishes through the X API v2, so it reads only the app’s Consumer Keys. The OAuth 2.0 Client ID and secret, the Bearer token and your own account’s access token are not used.

Before you start

Create the app

1

Sign in to the Developer Console

Open the Developer Console and sign in with the X account that will own the app. Accept the Developer Agreement and Policy, and fill in how you will use the API.
2

Buy credits

The X API has no free tier. Buy credits in the console before you connect anything: every post PostQueen creates is charged against them, and so are PostQueen’s analytics and automation reads. Set a spending limit per billing cycle if you want a cap.
3

Create the app

Create a new app and enter its name, description and use case. The console then shows the app’s keys once: you only need the API Key and API Key Secret, the Consumer Keys, from it. Store them safely.
4

Set up user authentication

Open the app’s User authentication settings and set:
  • App permissions: Read and write. PostQueen does not need Direct Messages.
  • Callback URI / Redirect URL: the callback URL below.
  • Website URL: your public site.
The form also asks for a type of app. That choice is for OAuth 2.0, which PostQueen does not use.If you change the permissions later, every X account that already connected has to reconnect: its token keeps the old permissions.
5

Register the callback URL

The redirect URI is where the network sends the browser back after someone approves PostQueen. It is your FRONTEND_URL + /integrations/social/ + the network’s identifier, for example https://postqueen.example.com/integrations/social/pinterest.Most networks need exactly one URI, with no trailing slash. Two exceptions: TikTok Business needs the trailing slash (/integrations/social/tiktok-business/), and a Google web client that also serves Google Business Profile lists both /integrations/social/youtube and /integrations/social/gmb. Channel developer apps lists every network’s ending.For X the host comes from X_URL when it is set, otherwise from FRONTEND_URL. PostQueen never wraps the X callback through redirectmeto.com, so a plain http address is registered as it is. X compares the URL exactly, trailing slash included, and takes up to 10 per app.
6

Copy the Consumer Keys

If you did not save them when the app was created, open the app’s keys and tokens and regenerate the Consumer Keys. The API Key goes in X_API_KEY, the API Key Secret in X_API_SECRET.

Set the variables

Add the two keys to your environment:
Three optional variables change how X behaves: Recreate the app container so it reads the new variables. A plain docker restart or docker compose restart keeps the old container and its old environment. In the folder that holds docker-compose.yaml, recreate only the postqueen service:
The database, Redis and Temporal keep running. Avoid docker compose down for a settings change: on a host that runs other Compose services in the same project, it stops them too. Then open PostQueen, go to Channels, choose Add Channel and pick this network. You are sent to its login to authorize PostQueen, and the channel appears in the Channels list once you accept.
The channel is in the Channels list with its avatar and name.
Add Channel does not check whether your variables are set. A missing or misspelled key shows up as a broken authorization page on the network’s side rather than a helpful message in PostQueen, so if the login page itself looks wrong, check the keys before anything else.
Pick X. PostQueen connects whichever X account is signed in on x.com in that browser, so switch accounts on X first if you want a different one. The Long posts setting, which raises the limit from 280 to 4,000 characters, is read from X when the account connects. Change it later in the channel’s menu under Publishing options.
With billing on (both STRIPE_PUBLISHABLE_KEY and STRIPE_SECRET_KEY set), a workspace still in its free trial cannot connect X until the trial ends. Without billing there is no trial, and no lock.

App review

X’s getting-started docs describe no review for a pay-per-use app: once it has credits and the settings above, any X account can connect through it. What X does control is spending. When the credits run out or the spending limit is reached, X refuses the requests until you add credits. X’s own account limits still apply to every account that connects: unverified accounts can publish 50 posts and 200 replies a day across every app.

Troubleshooting

The callback PostQueen sent is not in the app’s list. Register FRONTEND_URL + /integrations/social/x exactly as in step 5, or the X_URL address if you set one.
Billing is on and the workspace is in its free trial. End the trial in the app, or wait for it to end.
X refused the post. If every post fails this way, check that App permissions is Read and write, then reconnect the channel so its token carries the new permission.
X capped the app’s usage. Check the credit balance and the spending limit in the Developer Console.
X no longer accepts the account’s token, for example after the app’s permissions changed. Reconnect the channel.
Last modified on September 23, 2026