/api/auth/register

Register a new user account and log them in. Works with invites.

POST
Request

Body

Content-Type: application/json

PropertyTypeDescription
usernamestringRequired. The username for the new account.
passwordstringRequired. The password for the new account.
codestring?The invite code. Required if invites are enabled. Omit if registration is open.

Example

{
"username": "test",
"password": "test"
}

Response

Status: 200 OK

Content-Type: application/json

PropertyTypeDescription
userUserThe authenticated user object.

Example

{
"user": {
"id": "cmb6042f500029kenox2u8npu",
"username": "admin",
"createdAt": "2025-05-27T04:13:22.625Z",
"updatedAt": "2025-05-28T02:20:05.997Z",
"role": "SUPERADMIN",
"view": {},
"oauthProviders": [],
"totpSecret": null,
"passkeys": [],
"quota": null,
"sessions": [],
"token": "MTc0ODMxOTIwMjYyNQ==.ejV1UVFRODBJNHltU0VGZWVaTXNzRmc2UFZKUTlIMmg="
}
}

Error Responses

  • 400 Bad Request
    • Invites are not enabled but an invite code was provided.
    • Invites are enabled but code is missing or invalid.
    • Registration is disabled.
    • Username or password is missing.
    • Username is already taken.


Last updated: 5/30/2025
Edit this page on GitHub