🚀 Fansly API (Alpha) is live!WIP - Updated Daily
Fansly API Logo
Connect fansly account

Verify OTP

Verify the One-Time Password (OTP) code to validate a 2FA session.

This endpoint verifies the OTP code received by the user against the session token. Successful verification is required to authorize sensitive actions.

https://v1.apifansly.com
POST
/api/fansly/{accountId}/twofa/session/verify

Get Started

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

curl -X POST "https://v1.apifansly.com/api/fansly/{accountId}/twofa/session/verify" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "token": "87545xxxxxxxxxxxxxx:1:1:47b47xxxxxxxxxxxxxx",
    "code": "xxxxxx",
    "mode": 1
  }'
fetch("https://v1.apifansly.com/api/fansly/{accountId}/twofa/session/verify", {
  method: "POST",
  headers: {
    "x-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "token": "87545xxxxxxxxxxxxxx:1:1:47b47xxxxxxxxxxxxxx",
    "code": "xxxxxx",
    "mode": 1
  })
})
import requests

url = "https://v1.apifansly.com/api/fansly/{accountId}/twofa/session/verify"
headers = {
    "x-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json"
}
data = {
    "token": "87545xxxxxxxxxxxxxx:1:1:47b47xxxxxxxxxxxxxx",
    "code": "xxxxxx",
    "mode": 1
}

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

String jsonBody = "{\"token\": \"87545xxxxxxxxxxxxxx:1:1:47b47xxxxxxxxxxxxxx\", \"code\": \"xxxxxx\", \"mode\": 1}";

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
        .uri(URI.create("https://v1.apifansly.com/api/fansly/{accountId}/twofa/session/verify"))
        .header("x-api-key", "YOUR_API_KEY")
        .header("Content-Type", "application/json")
        .POST(HttpRequest.BodyPublishers.ofString(jsonBody))
        .build();

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

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

var json = JsonSerializer.Serialize(new { 
    token = "87545xxxxxxxxxxxxxx:1:1:47b47xxxxxxxxxxxxxx",
    code = "xxxxxx",
    mode = 1
});
var content = new StringContent(json, Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://v1.apifansly.com/api/fansly/{accountId}/twofa/session/verify", content);
var responseString = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseString);
package main

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

func main() {
    url := "https://v1.apifansly.com/api/fansly/{accountId}/twofa/session/verify"
    
    values := map[string]interface{}{
        "token": "87545xxxxxxxxxxxxxx:1:1:47b47xxxxxxxxxxxxxx",
        "code": "xxxxxx",
        "mode": 1,
    }
    jsonData, _ := json.Marshal(values)

    req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
    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))
}

Path Variables

accountId*
string
The unique identifier for the account.

Request Body Parameters

The request body must be sent as JSON with the following parameters:

token*
string
The 2FA session token obtained from the Send OTP endpoint.
code*
string
The verification code received by the user.
mode*
integer
The 2FA mode (default: 1).

Response

Success Response (200 OK)

{
  "statusCode": 201,
  "message": "Success",
  "data": {
    "status_code": 200,
    "data": {
      "success": true,
      "response": {
        "id": "xxxxxxxxxxxxxxx",
        "accountId": "8654xxxxxxxxxxxxxxx",
        "deviceId": null,
        "ip": "8x.xx.xx",
        "email": "xxxxxxxxxxxxxx@gmail.com",
        "code": "xxxxxxxxx",
        "token": "ODc1ODxxxxNzUxxxxxxxxxxxxxxxxg",
        "status": 3,
        "tries": 1,
        "version": 1,
        "createdAt": 1770311068000
      }
    }
  },
  "timestamp": "2026-02-05T17:06:11.491Z"
}

On this page