Users
Methods on this page are called as client.users.<method>(...) where client is either a synchronous Goodmem or asynchronous AsyncGoodmem instance initialized below:
from goodmem import Goodmem
client = Goodmem(base_url='http://localhost:8080', api_key='gm_...')from goodmem import AsyncGoodmem
client = AsyncGoodmem(base_url='http://localhost:8080', api_key='gm_...')Get a user by ID or email
users.get(*, email: str = None, id: str = None) → UserResponse
Retrieves a user by ID or email address. Exactly one of id and email must be provided. For getting your own profile, use client.users.me().
Parameters:
- email (
str, optional) — The user's email address. Mutually exclusive withid— exactly one must be provided. - id (
str, optional) — The user's UUID. Mutually exclusive withemail— exactly one must be provided.
Returns:
UserResponse — Returns the user profile.
Raises:
APIError— Any other non-2xx HTTP response (base class; exposesstatus_codeandbody).
Examples
Example 1:
user = client.users.get(id="your-user-id")
print(user.email)Example 2:
user = client.users.get(email="[email protected]")
print(user.user_id)Get current user profile
users.me() → UserResponse
Retrieves the authenticated user's profile information including email, display name, and creation time. This endpoint does not require any parameters as it automatically returns the caller's information.
Returns:
UserResponse — Returns the user profile.
Raises:
APIError— Any other non-2xx HTTP response (base class; exposesstatus_codeandbody).
Example
user = client.users.me()
print(user.email)Async usage: client.users exposes the same methods on AsyncGoodmem; use await / async for as needed.
Data Models
All data models are pydantic v2 models. Fields are shown with their Python attribute names; JSON responses use camelCase aliases (e.g., owner_id → ownerId).
UserResponse
User information response
- user_id (
str) — The UUID of the user - email (
str) — The user's email address - display_name (
str) — The user's display name - username (
str, optional) — The user's username (optional) - created_at (
int) — Timestamp when the user was created (milliseconds since epoch) - updated_at (
int) — Timestamp when the user was last updated (milliseconds since epoch)