/api/userAuth/* endpoints. Do not use the generic data API (/api/data/users*) for user management — that route is blocked.
All auth endpoints require your publishable key (pk_live_...) in the x-api-key header.
Base URL: https://api.ub.bitbros.in
Disabling Public Signups
By default, any user can create an account. To block new registrations:- Navigate to your project dashboard.
- Go to the Authentication page.
- Turn off the Allow Public Signups toggle.
403 Forbidden error, but existing users can still log in.
The users collection contract
Before using authentication, create a collection named users in your project. It must include at least these two fields:
You can add any extra fields (e.g.,
username, avatar, preferences). urBackend validates them automatically during sign-up based on your schema.
Passwords are hashed with Bcrypt before storage. Neither you nor your users can retrieve the raw password.
Sign up, log in, and call the API
1
Sign up a new user
Send a On success, urBackend returns a short-lived access token and a 7-day refresh token.
POST request to create an account. You can include any extra fields defined in your users schema.2
Log in
Authenticate with email and password to receive an access token.
3
Call authenticated endpoints
Pass the access token in the
Authorization header for any endpoint that requires authentication.4
Refresh the access token
Access tokens are short-lived. When one expires, request a new one using the refresh token.Web clients — the refresh token cookie is sent automatically:Mobile or non-browser clients — send the refresh token in a header:
Refresh tokens are rotated on every use and are replay-protected.
5
Log out
Revoke the current refresh session. After this call the refresh token is invalidated.
Profile management
Get current user profile
Returns the profile of the currently authenticated user. Endpoint:GET /api/userAuth/me
Update profile
Update editable profile fields for the authenticated user. Endpoint:PUT /api/userAuth/update-profile
Change password
Endpoint:PUT /api/userAuth/change-password
Public profile
Fetch a safe, public view of any user’s profile by username. No authentication is required. Sensitive fields likepassword and email are never returned.
Endpoint: GET /api/userAuth/public/:username
Password reset
1
Request a password reset
Send the user’s email address to trigger a reset email.Endpoint:
POST /api/userAuth/request-password-reset2
Reset the password
Submit the reset token (from the email link) along with the new password.Endpoint:
POST /api/userAuth/reset-passwordEmail verification
After sign-up, you can prompt users to verify their email address. Endpoint:POST /api/userAuth/verify-email
