Skip to content

Auth

Authentication endpoints for registration, login, logout, and account recovery.


Register a new user

POST /api/register

Registers a new creator account and returns a user object with an access token.

Authentication: None (public endpoint)

Request Body

FieldTypeRequiredDescription
emailstringYesCreator email address
passwordstringYesMinimum 8 characters
first_namestringYesFirst name
last_namestringYesLast name
birth_datestringYesFormat YYYY-MM-DD, must be 18+
currency_idintegerYesCurrency ID
ibanstringNoBank IBAN
bic_swiftstringNoBank BIC/SWIFT
addressstringNoAddress
invite_codestringNo5-digit referral code
master_idintegerNoReferrer user ID (from invite deep link)
fee_percentagefloatNoAffiliate fee (from invite deep link)
is_adult_contentbooleanNoDefault AVS setting
is_verif_agebooleanNoDefault Yoti requirement

Example Request

bash
curl -X POST https://fangate.info/api/register \
  -H "Content-Type: application/json" \
  -d '{
    "email": "creator@example.com",
    "password": "SecurePass123",
    "first_name": "John",
    "last_name": "Doe",
    "birth_date": "2000-01-30",
    "currency_id": 1
  }'

Response (200)

json
{
  "success": true,
  "errors_message": null,
  "data": {
    "user": {
      "id": 1,
      "type": "business",
      "email": "creator@example.com",
      "first_name": "John",
      "last_name": "Doe",
      "birth_date": "2000-01-30",
      "stripe_url": "...",
      "fee": { ... },
      "iban": "...",
      "bic_swift": "...",
      "is_adult_content": true,
      "is_verif_age": true,
      "currency_id": 1
    },
    "token": "1|9NasfkKFS32gndslNDKd0323213ldm"
  }
}

Login

POST /api/login

Authenticates an existing user and returns an access token.

Authentication: None (public endpoint)

Request Body

FieldTypeRequiredDescription
emailstringYesUser email
passwordstringYesUser password

Example Request

bash
curl -X POST https://fangate.info/api/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "creator@example.com",
    "password": "SecurePass123"
  }'

Response (200)

json
{
  "success": true,
  "errors_message": null,
  "data": {
    "user": { ... },
    "token": "1|9NasfkKFS32gndslNDKd0323213ldm"
  }
}

Logout

POST /api/logout

Invalidates the current access token. Optionally removes FCM token.

Authentication: Required

Query Parameters

ParameterTypeRequiredDescription
fcm_tokenstringNoFCM token to remove from user devices

Example Request

bash
curl -X POST "https://fangate.info/api/logout?fcm_token=long.fcm.token" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json"

Response (200)

json
{
  "success": true,
  "errors_message": null,
  "data": "Logged out"
}

Send email verification

POST /api/user/email/verify

Sends a verification email to the user. Used in the onboarding flow before full registration.

Authentication: None (public endpoint)

Query Parameters

ParameterTypeRequiredDescription
emailstringYesUser email
master_idintegerNoReferrer user ID
fee_percentagenumberNoAffiliate fee
is_webbooleanNoWhether request is from web app

Response (200)

json
{
  "success": true,
  "errors_message": null,
  "data": "Mail was sent"
}

Send password reset email

POST /api/user/password/reset

Sends a password reset email to the user. Always returns success (does not reveal if email exists).

Authentication: None (public endpoint)

Query Parameters

ParameterTypeRequiredDescription
emailstringYesUser email

Response (200)

json
{
  "success": true,
  "errors_message": null,
  "data": "Mail was sent"
}

Update password

PATCH /api/user/password

Updates the authenticated user's password.

Authentication: Required

Request Body

FieldTypeRequiredDescription
passwordstringYesNew password

Response (200)

json
{
  "success": true,
  "errors_message": null,
  "data": { "user": { ... } }
}

Fangate API Documentation