Authentication
The Fangate API uses token-based authentication via Laravel Sanctum. Most endpoints require a valid Bearer token in the request header.
Overview
- Login to receive an access token
- Include the token in all authenticated requests
- Header format:
Authorization: Bearer {token} - Tokens don't expire — revoke via logout when needed
Obtaining a Token
Register
Create a new creator account and receive a token immediately.
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:
json
{
"success": true,
"errors_message": null,
"data": {
"user": { ... },
"token": "1|9NasfkKFS32gndslNDKd0323213ldm"
}
}Login
Authenticate with existing credentials.
bash
curl -X POST https://fangate.info/api/login \
-H "Content-Type: application/json" \
-d '{
"email": "creator@example.com",
"password": "SecurePass123"
}'Response:
json
{
"success": true,
"errors_message": null,
"data": {
"user": { ... },
"token": "1|9NasfkKFS32gndslNDKd0323213ldm"
}
}Using the Token
Include the token in the Authorization header for all protected endpoints:
bash
curl -H "Authorization: Bearer 1|9NasfkKFS32gndslNDKd0323213ldm" \
https://fangate.info/api/userLogout
Invalidate the current token:
bash
curl -X POST https://fangate.info/api/logout \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json"Optional: Pass fcm_token as query parameter to also remove the FCM token from the user's devices.
Registration Fields
| Field | Required | Description |
|---|---|---|
email | Yes | Creator email address |
password | Yes | Minimum 8 characters |
first_name | Yes | First name |
last_name | Yes | Last name |
birth_date | Yes | Format YYYY-MM-DD, must be 18+ |
currency_id | Yes | Currency ID (USD=1, EUR, GBP) |
iban | No | Bank IBAN for payouts |
bic_swift | No | Bank BIC/SWIFT |
address | No | Address |
invite_code | No | 5-digit referral code |
is_adult_content | No | Default AVS setting |
is_verif_age | No | Default Yoti requirement |
Email Verification Flow
Before full registration, creators must verify their email:
- Send verification email:
POST /api/user/email/verifywithemail - User clicks "Yes, this is my email" in the email
- User is redirected to complete registration (currency, name, birth date, etc.)
Unauthenticated Endpoints
The following endpoints do not require authentication:
POST /api/registerPOST /api/loginPOST /api/user/email/verifyPOST /api/user/password/resetPOST /api/reportGET /api/app-dataPOST /api/yoti/webhookPOST /api/yoti/session/create