Skip to main content

X (Twitter)

Search and read public posts, users and trends on X with your app's bearer token.

Connect it with: API key. X (Twitter)'s own documentation: https://docs.x.com/fundamentals/authentication/oauth-2-0/bearer-tokens.

What agents can do​

Connect X (Twitter) so the agents working your tasks can reach it. With it connected, they can:

  • Search recent public posts for a keyword, hashtag or mention.
  • Look up a user's profile and their recent public posts.
  • Count posts over time for a topic to spot a spike after a launch.

Before you start​

  • An X developer account with a Project and an App (console.x.com).
  • Credit or a plan on the developer account: X bills every read on pay-per-use pricing.
  • A Jaah account. Anyone can add a personal secret; an organization secret needs an Org Owner or Admin.

Connect with X (Twitter)​

Jaah connects to X (Twitter) with an API key, not with a sign-in button.

Connect with an API key​

Find each value first:

  • Bearer token: console.x.com (developer portal) > Projects & Apps > your app > Keys and tokens > Bearer Token > Generate (or Regenerate). X shows it once; copy it straight away.

Then add it to Jaah:

  1. In Jaah, open Secrets, select New, and pick the X (Twitter) card.
  2. Name the secret and choose who can use it.
  3. Fill in Bearer token.
  4. Select Save. Jaah tests the secret straight away (see Test the connection).

Jaah encrypts what you type and never shows it again — not to you, and not to an admin.

Use your own OAuth app​

Not used: Jaah connects to X (Twitter) with an API key, not through an OAuth app.

Test the connection​

Select Test on the secret. Jaah checks that each value has the right shape, but does not call X (Twitter): the result reads Format checked — X (Twitter) was not called. The first real check is when an agent uses it.

Who can use it​

Every secret has an owner, and the owner decides who can use it:

  • Personal — only your own tasks can use it. This is the default.
  • Organization — every task in the organization can use it. Only Org Owners and Admins can choose this.
  • Attached to a project — every task on that project can use it, whoever started the task. See Attach a secret to a project.

More on owners and access: How secrets work.

Use it in an agent session​

An agent asks for the secret with its credential_get tool, by the secret's path, when it needs it, and gets the values for that one call. The path is the owner's prefix and the secret's name:

  • org/<name> for an organization secret,
  • projects/<project>/<name> for one attached to a project,
  • me/<name> for your personal one.

A key connection hands the agent its fields: bearer_token.

Tell the agent in your task description which secret to use, for example “use the X (Twitter) secret org/x-twitter”.

Manage, rotate or disconnect​

Everything is on the secret's page under Secrets:

  • Rotate a key: create a new key at the vendor first, then select Replace on the secret and paste it. Revoke the old key at X (Twitter) once the test passes. Steps: Replace or delete a secret.
  • Disconnect: select Delete. The stored values are destroyed and agents lose access on their next call. To end access at X (Twitter)'s side too, revoke or delete the key at X (Twitter).

Limitations​

  • Jaah's Test checks only the token's shape and does not call X, because X bills every read. The first real check is an agent's first call.
  • An app-only bearer token reads public data only. Agents cannot post, like, follow or read direct messages with it.
  • X applies per-endpoint rate limits and a monthly cap on posts read; a busy agent can hit them and must wait.
  • Agents can do only what the connected X (Twitter) account allows.

Troubleshooting​

Test says Bearer token is not in the format X (Twitter) uses

Paste the token alone, without the word Bearer, spaces or quotes. Regenerate it under Keys and tokens if you no longer have it.

An agent gets 401 Unauthorized although the format check passed

The token was regenerated or the app was deleted. Generate a new bearer token and select Replace on the secret.

An agent gets 402 or a CreditsDepleted error

The developer account has no credit left. Add credit or a plan in the developer console.

An agent gets 429 Too Many Requests

The endpoint's rate limit for the app is spent. Wait for the window shown in the x-rate-limit-reset header.

Still stuck? Select Test and read the result: it names the first value that is missing or not in the shape X (Twitter) uses. It does not call X (Twitter), so X (Twitter)'s own errors show only in the agent's session.

FAQ​

Why is the Test only a format check?

Every X API read is billed, so testing on each save would cost money. The format check catches typos; the first agent call proves the token.

Can agents post as our account?

Not with a bearer token. Posting needs user-context OAuth, which this connection does not use.

Can Jaah or an admin see the key or token?

No. Jaah stores it encrypted and never shows it again. Only the tasks allowed to use the secret receive it, at the moment they ask for it.

Can I connect more than one X (Twitter) account?

Yes. Add one secret per account, each with its own name, and tell the agent which one to use.