Register
Create a new user account and receive JWT access and refresh tokens.
Register
POST
/api/v1/auth/registerCreate a new user account and receive JWT access and refresh tokens.
Authentication:No Auth Required
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
email | string | Required | Email address for the new account. Must be a valid email format. Maximum 255 characters. |
password | string | Required | Account password. Must be between 8 and 100 characters. |
first_name | string | Optional | User's first name. Maximum 100 characters. |
last_name | string | Optional | User's last name. Maximum 100 characters. |
country | string | Optional | User's country of residence. Maximum 100 characters. |
language | string | Optional | Preferred language code, e.g. "en", "fa", "de". Maximum 10 characters. |
referral_code | string | Optional | Referral code from an existing user. Maximum 20 characters. The new user gets the current referral offer, if one is running. The referrer earns commission on the money we receive and keep from the new user's payments. |
device_id | string | Optional | Unique device identifier (UUID recommended). |
platform | string | Optional | Client platform. One of: ios, android, windows, macos, linux, web. |
device_name | string | Optional | Human-readable device name, e.g. "Pixel 8 Pro" or "Firefox on Windows". |
fcm_token | string | Optional | Firebase Cloud Messaging token for push notifications. |
Code Examples
curl -X POST https://api.orbai.world/api/v1/auth/register \
-H "Content-Type: application/json" \
-d '{
"email": "newuser@example.com",
"password": "secureP@ssw0rd",
"first_name": "Jane",
"last_name": "Doe",
"country": "Germany",
"language": "de",
"referral_code": "REF_ABC123",
"device_id": "550e8400-e29b-41d4-a716-446655440000",
"platform": "android",
"device_name": "Pixel 8 Pro",
"fcm_token": "eyJhbGciOiJIUzI1NiIs..."
}'Responses
200Account created successfully. Returns the same AuthResponse structure as the login endpoint.
{
"success": true,
"data": {
"user": {
"id": 42,
"uuid": "usr_def456",
"username": "jane_doe",
"email": "newuser@example.com",
"role": "USER",
"active": true
},
"tokens": {
"access_token": "eyJhbGciOiJIUzI1NiIs...",
"refresh_token": "dGhpcyBpcyBhIHJlZnJlc2...",
"access_token_expires_at": "2026-02-09T12:00:00Z",
"refresh_token_expires_at": "2026-03-08T12:00:00Z",
"token_type": "Bearer"
},
"subscription": {
"plan_name": "Free",
"status": "active",
"expires_at": null
},
"requires_2fa": false
}
}409An account with this email address already exists.
{
"success": false,
"error": {
"code": "EMAIL_ALREADY_EXISTS",
"message": "An account with this email address already exists. Please log in or use a different email."
}
}422Validation error. One or more fields failed validation.
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Validation failed.",
"details": {
"email": "Must be a valid email address.",
"password": "Must be at least 8 characters."
}
}
}Related Endpoints
- Login -- Login
- OAuth Login -- OAuth Login
- Magic Link -- Magic Link