---
title: "POST /twitter/login_by_2fa"
method: POST
path: "/twitter/login_by_2fa"
---

# POST /twitter/login_by_2fa

`POST /twitter/login_by_2fa`

## Request

- Base URL: `https://api.twitterapi.io`
- URL: `https://api.twitterapi.io/twitter/login_by_2fa`
- Auth: API key in header `X-API-Key`

Deprecated soon. Please use login V2 instead, as it is more stable.Login Step 2: by 2fa code.Price: 300 credits ($0.003 per call).

## Request body

- object
  - `login_data` string, required: The login data returned by /twitter/login_by_email_or_username
  - `2fa_code` string, required: The 2fa code of the user. get 2fa code from https://2fa.fb.rip/
  - `proxy` string, required: The proxy to use.Please use high-quality residential proxies and avoid free proxies.Required.Example: http://username:password@ip:port .You can get proxy from: https://www.webshare.io/?referral_code=4e0q1n00a504

## Response `200`

Login Step 2(2fa) response

- object
  - `session` string: The session of the login.Use this session to call other endpoints.eg. /twitter/create_tweet /twitter/like_tweet
  - `status` string: Status of the request.success or error
  - `msg` string: Message of the request.error message
  - `user` object: The user info of the login.
    - `id_str` string: The id of the user
    - `screen_name` string: The screen name of the user
    - `name` string: The name of the user

## Other responses

- `400`: Unexpected error

## Changes

- **2026-11-03** `03599c7e3236`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/twitterapi/apis/twitterapi-io-the-most-stable-fastest-cheapest-twitter-api/changes/twitter/login_by_2fa/post.md)

---

[API](https://skmtc.dev/twitterapi/apis/twitterapi-io-the-most-stable-fastest-cheapest-twitter-api.md) - [All operations](https://skmtc.dev/twitterapi/apis/twitterapi-io-the-most-stable-fastest-cheapest-twitter-api/llms.txt) - [OpenAPI document](https://skmtc.dev/twitterapi/apis/twitterapi-io-the-most-stable-fastest-cheapest-twitter-api/revisions/03599c7e3236?raw)
