Authentication API
Endpoints for user authentication, registration, and session management.
Create Guest Account
Create a guest account for anonymous browsing.
POST /auth/guest
Authentication
None required
Request Body
{}
Response
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"user": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"username": "guest_1234567890",
"email": null,
"displayName": "Guest",
"avatarUrl": null,
"tier": "free",
"isGuest": true,
"createdAt": "2024-01-15T10:30:00Z"
}
}
Errors
500 InternalServerError- Server error creating guest account
Sign Up
Register a new user account.
POST /auth/signup
Authentication
None required
Request Body
{
"username": "johndoe",
"email": "john@example.com",
"password": "SecureP@ssw0rd",
"displayName": "John Doe"
}
Response
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"user": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"username": "johndoe",
"email": "john@example.com",
"displayName": "John Doe",
"avatarUrl": null,
"tier": "free",
"isGuest": false,
"createdAt": "2024-01-15T10:30:00Z"
}
}
Errors
400 ValidationError- Invalid request body (missing fields, invalid format)409 Conflict- Username or email already exists500 InternalServerError- Server error