POST /api/auth/register
Registers a new user account with username and password credentials. Supports optional invite codes when invites are enabled.Request Body
Desired username (trimmed, minimum 1 character). Must be unique.
User’s password (trimmed, minimum 1 character)
Invite code. Required when invites are enabled and user registration is disabled.
Headers
Optional client identifier for tracking the source of the request
Response
The newly created user object
Rate Limiting
This endpoint is rate limited to 5 requests per second.Registration Modes
The server can be configured in different registration modes:- Open registration: Users can register without an invite code
- Invite-only: Users must provide a valid invite
code - Registration disabled: No new registrations allowed
Invite Code Validation
When an invite code is provided:- Code is matched against invite ID or code string
- Checks expiration date (if set)
- Checks maximum uses (if set)
- Increments usage counter on successful registration
Error Responses
400 Bad Request- Invites aren’t enabled (when code is provided but invites are disabled)400 Bad Request- User registration is disabled (when no code and registration disabled)400 Bad Request- Username is taken400 Bad Request- Invalid invite code (expired, max uses reached, or doesn’t exist)429 Too Many Requests- Rate limit exceeded
Example Request (Open Registration)
Example Request (With Invite Code)
Example Response
Notes
- Successfully registers the user and creates a session automatically
- Generates a unique API token for the new user
- Password is hashed using secure hashing before storage
- New users are assigned the
USERrole by default