Manage site users
This guide manages site users — the people who sign in to your app. It is not for cloud users, organization memberships, invitations, or Console-synchronized site access.
Choose an interface
You can create, read, update, delete, list, and search site users in TaruviBase Console, JavaScript, Python, Refine, and the REST API (JavaScript SDK 1.5.3, Python SDK 0.2.1, and Refine providers 1.3.6).
By default, lists exclude cloud users, superusers, inactive users, and deleted users. To include them, use that interface's filters.
Reading a user that doesn't exist returns 404; check the site and username.
Deletion is a soft delete: users cannot delete themselves, and non-superusers
cannot delete superusers.
Create and manage users
Use an authenticated client for every SDK or REST operation. Deleted users can't be restored through the Console or API; to recover one, contact TaruviBase support with the user's details.
- TaruviBase Console
- JavaScript SDK
- Python SDK
- REST API
- Refine
Select the target site, open Users, select Add User, then complete Create New User. Search or edit the resulting site user from the same screen. Fill in any custom attribute fields your site defines.
import {User} from '@taruvi/sdk';
const users = new User(taruvi);
const initialPassword = process.env.TARUVI_NEW_USER_PASSWORD;
if (!initialPassword) throw new Error("Set TARUVI_NEW_USER_PASSWORD");
const created = await users.createUser({
username: "onboarding-user",
password: initialPassword,
confirm_password: initialPassword,
first_name: "Onboarding",
last_name: "User",
});
const page = await users.list({search: "onboarding", page: 1, page_size: 20});
const user = await users.getUser("onboarding-user");
await users.updateUser("onboarding-user", {first_name: "Onboarding"});
const apps = await users.getUserApps("onboarding-user");
import os
initial_password = os.environ["TARUVI_NEW_USER_PASSWORD"]
created = client.users.create({
"username": "onboarding-user",
"password": initial_password,
"confirm_password": initial_password,
})
page = client.users.list(search="onboarding", page=1, page_size=20)
user = client.users.get("onboarding-user")
client.users.update("onboarding-user", {"first_name": "Onboarding"})
apps = client.users.apps("onboarding-user")
/api/users/curl -G "$TARUVI_SITE_URL/api/users/" \
-H "Authorization: Api-Key $TARUVI_API_KEY" \
--data-urlencode "page=1" \
--data-urlencode "page_size=20" \
--data-urlencode "search=$TARUVI_USER_SEARCH" \
--data-urlencode "ordering=username"
200
/api/users/curl -X POST "$TARUVI_SITE_URL/api/users/" \
-H "Authorization: Api-Key $TARUVI_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<JSON
{
"username": "$TARUVI_USERNAME",
"email": "$TARUVI_USER_EMAIL",
"password": "$TARUVI_NEW_USER_PASSWORD",
"confirm_password": "$TARUVI_NEW_USER_PASSWORD",
"first_name": "$TARUVI_USER_FIRST_NAME",
"last_name": "$TARUVI_USER_LAST_NAME"
}
JSON
201
/api/users/$TARUVI_USERNAME/curl "$TARUVI_SITE_URL/api/users/$TARUVI_USERNAME/" \
-H "Authorization: Api-Key $TARUVI_API_KEY"
200
/api/users/$TARUVI_USERNAME/curl -X PUT "$TARUVI_SITE_URL/api/users/$TARUVI_USERNAME/" \
-H "Authorization: Api-Key $TARUVI_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<JSON
{
"first_name": "$TARUVI_USER_FIRST_NAME"
}
JSON
200
/api/users/me/curl "$TARUVI_SITE_URL/api/users/me/" \
-H "Authorization: Api-Key $TARUVI_API_KEY"
200
Refine providers 1.3.6 support creating, reading, updating, deleting, and
listing users, reading the current user with id me, and reading roles and
apps. getMany and custom operations aren't supported. Manage organization
members in Console.
Remove a site user
- Affected resource and cascade: Verify the selected site user and every dependent application record before continuing.
- Reversibility: Deleted users can't be restored through the Console or API. Treat deletion as permanent.
- Authorization: Deleting users requires an organization owner or admin, or a user with the app's Super Admin role. Confirm you are on the right site.
- Backup or export: Export the user's record first if you may need it.
- Confirmation: Confirm the exact user and site before deleting.
- Success response and postcondition: Confirm the delete response, refresh the list, and verify the user no longer appears in the selected site.
- Recovery: To recover a deleted user, contact TaruviBase support with the exported record.
Delete the site user only after completing the checks above.
In the Console, select Delete User and confirm Delete. In JavaScript,
use users.deleteUser; in Python, use client.users.delete. The REST example
deletes only the site user. Refine has no separate
deletion workflow beyond its standard user create, read, update, and delete.
client.users.delete("onboarding-user")
/api/users/$TARUVI_USERNAME/curl -X DELETE "$TARUVI_SITE_URL/api/users/$TARUVI_USERNAME/" \
-H "Authorization: Api-Key $TARUVI_API_KEY"
200Runtime returns 200; the pinned OpenAPI contract declares 204.
For other problems, see troubleshooting.