Users¶
The users resource manages user accounts on the ineep lakehouse server.
Methods¶
| Method | Admin only | Description |
|---|---|---|
list(limit, offset) |
✓ | List all users (paginated) |
get(user_id) |
Get a user and their ETag | |
get_etag(user_id) |
Fetch only the current ETag (HEAD, no body) | |
create(...) |
✓ | Create a new user |
update(user_id, etag?, ...) |
Update a user | |
delete(user_id) |
Delete a user |
Getting current user¶
The method returns a tuple of (UserResponse, etag_string).
Listing users (admin)¶
response = admin_client.users.list()
print(f'Total users: {response.metadata.total_count}')
for u in response.items:
print(u.email)
Creating a user (admin)¶
admin_client.users.create(
email='newuser@ineep.org.br',
password='8CharSecret',
scopes=['user'],
username='new_user',
)
Updating user profile¶
The etag parameter is optional. When omitted the current ETag is fetched automatically via a HEAD request before the write:
Note
Pass an explicit ETag (from get() or get_etag()) when you need to detect concurrent edits — a PreconditionFailedError means another update happened between your read and write. Retry with a fresh ETag.