Endpoint
Creates a new user account in the F1 PitLane Predict platform. Passwords are securely hashed using bcrypt with a salt round of 12 before being stored in the database.
Request body
Unique username for the account. Must be unique across all users.
User’s email address. Must be unique across all users.
User’s password. Will be hashed using bcrypt before storage.
Response
HTTP status code (200 for success)
JSON stringified user object containing the created user data
Show User object properties
Auto-generated unique identifier for the user
The username provided during registration
The email address provided during registration
The hashed password (bcrypt hash)
Initial account balance (defaults to 0.00)
Timestamp when the account was created
Last login timestamp (null for new accounts)
User’s country (null for new accounts)
Type of user account (defaults to “regular”)
Example request
curl -X POST https://api.f1pitlane.com/api/user/register \
-H "Content-Type: application/json" \
-d '{
"username": "racing_fan_123",
"email": "[email protected] ",
"password": "SecureP@ssw0rd"
}'
Example response
{
"status" : 200 ,
"body" : "{ \" userId \" :42, \" username \" : \" racing_fan_123 \" , \" email \" : \" [email protected] \" , \" password \" : \" $2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/LewY5ux6K0H1g6pYS \" , \" balance \" : \" 0.00 \" , \" createdAt \" : \" 2026-03-03T10:30:00.000Z \" , \" lastLogin \" :null, \" country \" :null, \" userType \" : \" regular \" }"
}
Error responses
The endpoint may return errors in the following scenarios:
Duplicate username : If the username is already taken
Duplicate email : If the email is already registered
Invalid method : If a method other than POST is used
Database errors : If there are issues connecting to or writing to the database
Implementation details
Password hashing uses bcrypt with 12 salt rounds (source: server/api/user/register.ts:16)
User records are created in the PostgreSQL database via Prisma ORM (source: server/api/user/register.ts:18-24)
Username and email fields must be unique as defined in the database schema
New users are assigned a default balance of 0.00 and userType of “regular”