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
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Creator email address |
password | string | Yes | Minimum 8 characters |
first_name | string | Yes | First name |
last_name | string | Yes | Last name |
birth_date | string | Yes | Format YYYY-MM-DD, must be 18+ |
currency_id | integer | Yes | Currency ID |
iban | string | No | Bank IBAN |
bic_swift | string | No | Bank BIC/SWIFT |
address | string | No | Address |
invite_code | string | No | 5-digit referral code |
master_id | integer | No | Referrer user ID (from invite deep link) |
fee_percentage | float | No | Affiliate fee (from invite deep link) |
is_adult_content | boolean | No | Default AVS setting |
is_verif_age | boolean | No | Default Yoti requirement |
Example Request
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)
{
"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
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | User email |
password | string | Yes | User password |
Example Request
curl -X POST https://fangate.info/api/login \
-H "Content-Type: application/json" \
-d '{
"email": "creator@example.com",
"password": "SecurePass123"
}'Response (200)
{
"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
| Parameter | Type | Required | Description |
|---|---|---|---|
fcm_token | string | No | FCM token to remove from user devices |
Example Request
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)
{
"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
| Parameter | Type | Required | Description |
|---|---|---|---|
email | string | Yes | User email |
master_id | integer | No | Referrer user ID |
fee_percentage | number | No | Affiliate fee |
is_web | boolean | No | Whether request is from web app |
Response (200)
{
"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
| Parameter | Type | Required | Description |
|---|---|---|---|
email | string | Yes | User email |
Response (200)
{
"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
| Field | Type | Required | Description |
|---|---|---|---|
password | string | Yes | New password |
Response (200)
{
"success": true,
"errors_message": null,
"data": { "user": { ... } }
}