X (Twitter)
Publish posts and read profiles, mentions and searches on X
Managed auth
Authentication
Methods your end users can connect with. Credentials are stored encrypted, and secret values are never shown again or returned by the API.
OAuth 2.0
PKCEYour OAuth appBring your own OAuth app: register one with X (Twitter), then create a custom auth config with its client ID and secret and our redirect URI. Setup guide
Registering the OAuth app
- At console.x.com create an app (or open yours) and, under “User authentication settings”, set up OAuth 2.0: permissions “Read and write”, type “Web App, Automated App or Bot”, the redirect URI shown below as “Callback URI” and your company's website as “Website URL”.
- Under “Keys and tokens” copy the “OAuth 2.0 Client ID” and the “Client Secret”.
- Click “Continue with X” and sign in with the X account that will publish. The X API is pay-as-you-go: buy credits in the console (about 0.005 USD per post read, 0.01 USD per profile and 0.015 USD per post published, rising to 0.20 USD if the post contains a link). The connection test reads your own profile: a user read that X charges at most once a day.
Default scopes
tweet.readtweet.writeusers.readmedia.writeoffline.access
Tools (2)
X (Twitter) API request
TWITTER_SEND_REQUESTAuthenticated call to the X (Twitter) API (https://api.x.com/2). Any endpoint of the API is allowed. Examples: GET /users/me (your id and @username), GET /users/by/username/{username}?user.fields=description,public_metrics, GET /users/{id}/tweets?max_results=10&tweet.fields=created_at,public_metrics (your own posts and mentions are charged as owned reads, which are cheaper), GET /users/{id}/mentions?max_results=10&tweet.fields=created_at,author_id, GET /tweets/search/recent?query=coffee -is:retweet lang:en&max_results=10&tweet.fields=created_at,author_id,public_metrics (last 7 days), GET /tweets/{id}?tweet.fields=created_at,public_metrics, POST /tweets {"text": "…"} (or TWITTER_PUBLISH_POST; replies with "reply": {"in_reply_to_tweet_id": "…"}), DELETE /tweets/{id}, POST /media/upload {"media": "<base64>", "media_category": "tweet_image"} (returns data.id, which is used in "media": {"media_ids": ["…"]}). Pagination with pagination_token=meta.next_token.
Required scopes
No scopes required
Input
X (Twitter) API request input Name Type Description methodstringHTTP methodOne of: GET,POST,PUT,PATCH,DELETEDefault:"GET"pathrequiredstringPath relative to the API base URL, or a full URL on the same API (e.g. a next-page link) queryobjectQuery string parameters bodyunknownJSON body formobjectBody as application/x-www-form-urlencoded instead of JSON body_base64stringBinary body, base64 (at most 960000 characters) content_typestringContent-Type of body_base64 headersobjectExtra headers such as Accept. Authentication is added automatically. Publish a post
TWITTER_PUBLISH_POSTPublish a post on X with the connected account; also replies and quotes. Returns its id and link. Each post is charged: 0.015 USD, or 0.20 USD if the text contains a link.
Required scopes
No scopes required
Input
Publish a post input Name Type Description textrequiredstringPost text (up to 280 characters, except Premium accounts) reply_tostringID of the post being replied to quotestringID of the post being quoted mediastring[]IDs of images uploaded beforehand with POST /media/upload (TWITTER_SEND_REQUEST)

