Skip to content
Docs

Getting an X app-only Bearer Token

This guide is part of the Publicus connection catalog. Once you have the credentials, connect the service and Publicus stores them for you.

Distilled from X’s own documentation: Getting Access, Using and generating an app-only Bearer Token, App only authentication and OAuth 2.0 Bearer Token, OAuth 2.0 and X API pay-per-usage pricing. Retrieved 2026-10-25.

An app-only Bearer Token authenticates as your X app itself, with no user behind it. That makes it the simple choice for reading public data (looking up posts and accounts, searching recent posts, reading timelines and Lists), and useless for anything a user would do: it cannot post, read or send Direct Messages, search for users, or see protected accounts. For those, use the OAuth 2.0 auth system.

The X API is paid. Every request, app-only ones included, spends pay-per-usage credits bought in the X Developer Console, priced per resource read (a post, a user) or per write. Requests are refused once the balance hits zero or your spending limit is reached, and pay-per-usage is capped at 3 million Post reads per monthly billing cycle. The current rates are in the console and on the pricing page.

  1. Go to the X Developer Console and sign in with your X account. The first time, accept the Developer Agreement and Policy and complete your profile.
  2. Buy credits. Optionally turn on Auto-recharge and set a Spending limit per billing cycle.
  3. Create an app (New App) and give it a name, a description and a use case.
  4. Open the app’s Keys and tokens page. The Bearer Token is listed there with the API keys; generate it if none is shown.
  5. Copy the Bearer Token straight away: credentials are shown once only. Paste it into this connection’s Bearer Token field.

Operational notes:

  • Requests carry the token as Authorization: Bearer <token> against https://api.x.com, for example GET https://api.x.com/2/users/by/username/xdevelopers.
  • An app has one Bearer Token at a time. Regenerating it, clicking Revoke next to it on Keys and tokens, or calling POST oauth2/invalidate_token invalidates the old one, and every connection using it stops working.
  • You can also mint the same token from the app’s API Key & Secret with POST https://api.x.com/oauth2/token and grant_type=client_credentials. Asking again returns the same token until it is invalidated.
  • Treat the token like a password: it lets anyone spend your credits.
  • App-only requests are rate-limited per endpoint for the app, in a pool separate from requests made with user tokens.

Open Connections under Credentials, choose X, and pick X app-only Bearer Token. Publicus asks for exactly the fields listed above and keeps them in your workspace’s secret storage.

See also: X in the catalog.

This guide is maintained by Publicus and published under CC BY 4.0.