Skip to main content
User accounts in urBackend are managed through /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:
  1. Navigate to your project dashboard.
  2. Go to the Authentication page.
  3. Turn off the Allow Public Signups toggle.
Once disabled, new signups will receive a 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 POST request to create an account. You can include any extra fields defined in your users schema.
On success, urBackend returns a short-lived access token and a 7-day refresh token.
2

Log in

Authenticate with email and password to receive an access token.
The response also includes token as a backward-compatible alias for accessToken. Migrate your clients to use accessToken — the token field will be removed in a future release.
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 like password 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-reset
2

Reset the password

Submit the reset token (from the email link) along with the new password.Endpoint: POST /api/userAuth/reset-password

Email verification

After sign-up, you can prompt users to verify their email address. Endpoint: POST /api/userAuth/verify-email

Required headers reference