Docs/Integrations/X (Twitter)
Integrations

X (Twitter)

Two X-related tools β€” x for posting and reading via the X API, and x_search for Grok-backed X research via xAI. The x tool uses dual authentication.

The x tool uses dual authentication β€” an App Bearer Token for reads and OAuth 1.0a for writes.

Tools

ToolPurposeActions
xPost/read X content via the X APIpost_tweet, delete_tweet, search_tweets, get_timeline, get_user
x_searchGrok-backed X research (xAI hosted tool)single query tool (see below)

x params

ParamUsed byNotes
textpost_tweetTweet text, max 280 chars
tweet_iddelete_tweetTarget tweet ID
querysearch_tweetsSearch query
usernameget_timeline, get_userHandle without @
max_resultsreads5–100, default 10

x_search params

query, allowed_x_handles, excluded_x_handles, from_date, to_date, enable_image_understanding, enable_video_understanding.

Authentication (x tool)

The x tool uses two credential paths depending on the operation:

  • Read (search_tweets, get_timeline, get_user): App-only Bearer Token.
  • Write (post_tweet, delete_tweet): OAuth 1.0a β€” consumer key/secret plus access token/secret, with an HMAC-SHA1 signed Authorization header.

Configuration (x tool)

The tool registers when bearerToken or apiKey is present. Full key set:

{
  "integrations": {
    "x": {
      "bearerToken": "",
      "apiKey": "",
      "apiSecret": "",
      "accessToken": "",
      "accessTokenSecret": ""
    }
  }
}
KeyRole
bearerTokenApp-only Bearer Token (read operations)
apiKeyOAuth 1.0a consumer key (write operations)
apiSecretOAuth 1.0a consumer secret
accessTokenOAuth 1.0a access token
accessTokenSecretOAuth 1.0a access token secret

Provide only bearerToken for read-only use; supply the four OAuth 1.0a values to enable posting/deleting.

There is no environment-variable fallback for the

x tool β€” config only. Missing-credential errors name the exact key required.

x_search (xAI)

x_search is a separate tool backed by xAI's hosted x_search capability. Its credentials are resolved in priority order:

  1. xAI OAuth subscription credentials (signed in via flowly xai login).
  2. Fallback to providers.xai.apiKey, or the XAI_API_KEY environment variable.

Setup

Run the interactive integrations setup and pick X:

flowly setup tools

The X card prompts for the relevant credentials, validates with a probe, and writes the integrations.x.* keys.

The integration needs a gateway restart to take effect (handled by setup, or run

flowly service restart).