twitter_user_login
Log in to X with username and password, optionally adding TOTP for 2FA, to store a server-side session for authenticated account actions.
Instructions
Log in to X with a username and password (plus totp_secret if the account has 2FA) and store the resulting session against your API key, so the authenticated-account reads and the write tools then act as that account. On success returns { ok, username, message }; it does NOT return the session cookies (auth_token/ct0 are minted and kept server-side, never sent back). Typical failures: bad_credentials (401), two_factor_required (400, add totp_secret), captcha_required (422), acid_challenge (409, confirm the login from the account then retry). This handles real account credentials; never log or echo the values you pass.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| password | Yes | The X account password. | |
| username | Yes | The X account username/handle (without the leading @). Some accounts also accept the login email here. | |
| proxy_url | No | Optional. HTTP or SOCKS proxy URL to perform the login through, e.g. 'http://user:pass@host:port'. Stored with the session and reused for its later requests. Omit to log in directly from the service's own IP. A residential proxy is recommended: X treats datacenter logins as automated. | |
| user_agent | No | Optional. Browser User-Agent to mint and use the session with. Defaults to a current Chrome UA. Keep it consistent with the environment the account normally signs in from; a mismatch between the UA and the session is itself a signal to X. | |
| totp_secret | No | The account's base32 two-factor (TOTP) secret. Required only when the account has 2FA enabled. |