Composio connects AI agents to X (Twitter) so they can work with posts, profiles and other account features using the permissions you approve.
This guide shows how to create an X OAuth app and connect it to Composio. Composio-managed OAuth is unavailable for this toolkit, so you need your own X developer credentials. X API usage follows X’s access and billing requirements.
Part 1: Create your X OAuth app
Step 1: Create an app in the X Developer Console
Sign in to the X Developer Console. Open Apps → Create App. Enter your Application Name and select at least one existing project under Project Access. Select the appropriate environment and click Create.


Step 2: Enable OAuth 2.0 user authentication
Open the app and select Settings to reach User authentication settings. In the older console, select Set up or Edit under that heading.
Under App permissions, choose the access your workflow needs. Select the OAuth 2.0 scopes later in Composio.
For Type of App, select Web App, Automated App or Bot. This confidential client type enables the OAuth 2.0 credentials after you save the user authentication settings.

Step 3: Register the Composio callback
Under App info, add this exact Callback URI / Redirect URL:
https://backend.composio.dev/api/v1/auth-apps/add
Enter your application’s public Website URL. Complete any other fields X marks as required, then select Save Changes. The callback must match the Composio Redirect URI exactly, including its path and trailing slash.

Step 4: Get the OAuth 2.0 Client ID and Client Secret
After saving the user authentication settings, open Keys & Tokens. Save the Client ID and Client Secret from OAuth 2.0 Keys. Also save the Bearer Token from App-Only Authentication for the same app. Keep these values private when they are issued.

The API Key / API Key Secret shown at app creation are not the OAuth 2.0 Client ID / Client Secret. This guide uses OAuth 2.0 only.
Part 2: Connect X in Composio
Step 1: Create a custom auth config
Use the product switcher to open Platform. In your Composio developer project, open Auth Configs → Create. Search for Twitter, select the toolkit and enter a config name.


Use OAuth 2.0. Enter your app’s Client id and Client secret. Enter its app-only Bearer Token in Application Bearer Token. All three values must come from the same X app.

Keep Redirect URI identical to the callback registered in X.
Step 2: Choose scopes for your workflow
Choose only the scopes needed by the tools you plan to use. The minimum scopes for the read-only profile and post example are tweet.read and users.read. Add offline.access if you need Composio to refresh access without another sign-in. Posting also needs tweet.write. Use X’s endpoint-to-scope reference for additional permissions required by your workflow.
Remove preselected scopes you do not need, then select Create Auth Config. Changing a saved scope list does not update permissions on an existing connection; reconnect and review the new consent when your requirements change.
Step 3: Authorize your X account
Open the saved auth config and select Connect Account. Sign in to the X account you want to connect. Review the app name and requested permissions, then select Authorize app if they match your intended workflow.

Step 4: Confirm the connection is Active
Return to the auth config and open Accounts. Confirm that the connected account shows Active. The auth config’s Enabled label alone does not confirm a connection.

Connection troubleshooting
Invalid client: use the OAuth 2.0 Client ID and Client Secret from a confidential Web App or Automated App.
Callback mismatch: compare the complete production callback in X and Composio.
Missing refresh token: include
offline.accessand reconnect to grant it.403 or client-not-enrolled: check the app’s project access and the endpoint’s access requirements in X. Successful OAuth does not guarantee access to every endpoint.
Credits or usage-limit error: review the account’s X usage and billing status. OAuth scopes do not replace API access or usage credits.