πŸš€ Fansly API (Alpha) is live!WIP - Updated Daily
Fansly API Logo
Connect fansly account

Submit 2FA

Submit the Two-Factor Authentication code for account connection.


If the account has Two-Factor Authentication enabled, you will need to submit the 2FA code to complete the connection process.

https://v1.apifansly.com
POST
/api/fansly/verify-2fa

Get Started

All requests to the Fansly API require an API Key. See the Authentication page for details.

Request Body

curl -X POST "https://v1.apifansly.com/api/fansly/verify-2fa" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "username": "Email-or-Username",
    "password": "accountPasswordhere",
    "twoFactorToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "twoFactorCode": "XXXXX",
    "name": "Account-Name",
    "countryCode": "ES"
  }'
const res = await fetch('https://v1.apifansly.com/api/fansly/verify-2fa', {
  method: 'POST',
  headers: { 
    'x-api-key': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    username: "Email-or-Username",
    password: "accountPasswordhere",
    twoFactorToken: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    twoFactorCode: "XXXXX",
    name: "Account-Name",
    countryCode: "ES"
  })
});
const data = await res.json();
console.log(data);
import requests

url = "https://v1.apifansly.com/api/fansly/verify-2fa"
headers = {
    "x-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json"
}
payload = {
    "username": "Email-or-Username",
    "password": "accountPasswordhere",
    "twoFactorToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "twoFactorCode": "XXXXX",
    "name": "Account-Name",
    "countryCode": "ES"
}

response = requests.post(url, json=payload, headers=headers)
print(response.json())
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
String json = "{\"username\": \"Email-or-Username\", \"password\": \"accountPasswordhere\", \"twoFactorToken\": \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\", \"twoFactorCode\": \"XXXXX\", \"name\": \"Account-Name\", \"countryCode\": \"ES\"}";

HttpRequest request = HttpRequest.newBuilder()
        .uri(URI.create("https://v1.apifansly.com/api/fansly/verify-2fa"))
        .header("x-api-key", "YOUR_API_KEY")
        .header("Content-Type", "application/json")
        .POST(BodyPublishers.ofString(json))
        .build();

client.sendAsync(request, HttpResponse.BodyHandlers.ofString())
        .thenApply(HttpResponse::body)
        .thenAccept(System.out::println)
        .join();
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

var client = new HttpClient();
client.DefaultRequestHeaders.Add("x-api-key", "YOUR_API_KEY");

var json = "{\"username\": \"Email-or-Username\", \"password\": \"accountPasswordhere\", \"twoFactorToken\": \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\", \"twoFactorCode\": \"XXXXX\", \"name\": \"Account-Name\", \"countryCode\": \"ES\"}";
var content = new StringContent(json, Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://v1.apifansly.com/api/fansly/verify-2fa", content);
var responseString = await response.Content.ReadAsStringAsync();

Console.WriteLine(responseString);
package main

import (
    "bytes"
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {
    url := "https://v1.apifansly.com/api/fansly/verify-2fa"
    payload := []byte(`{"username": "Email-or-Username", "password": "accountPasswordhere", "twoFactorToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "twoFactorCode": "XXXXX", "name": "Account-Name", "countryCode": "ES"}`)

    req, _ := http.NewRequest("POST", url, bytes.NewBuffer(payload))
    req.Header.Set("x-api-key", "YOUR_API_KEY")
    req.Header.Set("Content-Type", "application/json")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()

    body, _ := ioutil.ReadAll(resp.Body)
    fmt.Println(string(body))
}
username*
string
The email or username of the Fansly account.
password*
string
The password of the Fansly account.
twoFactorToken*
string
The token received from the initial connect request if 2FA is required.
twoFactorCode*
string
The verification code from the authenticator app or email or phone.
name*
string
The display name for the account in your dashboard.
countryCode*
string
The ISO country code for proxy rotation. Must be in CAPITAL LETTERS.

Response

{
    "statusCode": 201,
    "message": "Success",
    "data": {
        "status_code": 200,
        "account_id": "fansly_4xxxxxxxxxxxxxxxxxxxxxx",
        "data": {
            "success": true,
            "response": {
                "accountId": "86283xxxxxxxxxxxx",
                "deviceId": null,
                "ip": "Proxy_IP_Address",
                "status": 2,
                "metadata": null,
                "id": "xxxxxxxxxxxx",
                "token": "Your_Token",
                "checkToken": null
            }
        }
    },
    "timestamp": "2026-01-19T15:36:33.916Z"
}

Response

FieldTypeDescription
statusCodenumberThe HTTP status code of the response (e.g., 201)
messagestringA human-readable message about the result
dataobjectThe main response payload
β”œβ”€ status_codenumberThe internal status code of the Fansly operation
β”œβ”€ account_idstringThe unique identifier for the connected account in our database
β”œβ”€ dataobjectFansly session and status data
β”‚ └─ responseobjectDetailed account and session information
β”‚ └─── tokenstringThe authentication token for the Fansly account
β”‚ └─── idstringThe authentication id for the Fansly account
β”‚ └─── ipstringThe authentication Proxy IP
timestampstringThe ISO 8601 timestamp of when the response was generated

On this page