Skip to main content
POST
/
twitter
/
user_login_v2
cURL
curl --request POST \
  --url https://api.twitterapi.io/twitter/user_login_v2 \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "user_name": "<string>",
  "email": "<string>",
  "password": "<string>",
  "proxy": "<string>",
  "totp_secret": "<string>"
}
'
{
  "login_cookie": "<string>",
  "status": "<string>",
  "msg": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.twitterapi.io/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

X-API-Key
string
header
required

Body

application/json
user_name
string
required

User name.Must be set

email
string
required

Email.Must be set

password
string
required

The password of the user

proxy
string
required

The proxy to use.Please use high-quality residential proxies and avoid free proxies.Required.Example: http://username:password@ip:port [blocked] . You can get proxy from: https://www.webshare.io/?referral_code=4e0q1n00a504

totp_secret
string

TOTP/2FA secret (base32 seed, not a 6-digit code). Optional, but strongly recommended — accounts without 2FA may yield a login_cookie that gets flagged and can't post. To obtain: on X, enable 2FA, choose "can't scan the QR code", and X shows a 10+ character string — that's the TOTP secret.

Response

Login response

The login cookie of the user.Use this cookie to post tweets, etc.You can only call v2 APIs with this cookie.If your account is in good standing and you're using residential proxies, the cookies will generally remain valid indefinitely.

status
string

Status of the request.success or error

msg
string

Message of the request.error message