Users
User lookup by id, email, or me.
Namespace: Goodmem.Client.Api · Class: UsersApi
Reach this surface as client.Users on a GoodmemClient. Every network method is asynchronous — it returns a Task<T> (or an IAsyncEnumerable<T> for pagination and streaming) and accepts a CancellationToken; the Async suffix marks the standard .NET Task-based async pattern.
Methods
GetAsync
Retrieves a user by ID or email address. Exactly one of id and email must be provided.
Declaration
public Task<UserResponse> GetAsync(UsersGetOptions options, CancellationToken ct = default)
HTTP — GET /v1/users/{id}
Parameters
| Type | Name | Description |
|---|---|---|
UsersGetOptions | options | Options bag carrying the lookup key(s) / convenience knobs; the linked type lists them all. |
CancellationToken | ct | Cancellation / deadline signal for the call. (optional) |
Returns
Task<UserResponse> — an awaitable that resolves to UserResponse.
Exceptions
| Type | Condition |
|---|---|
ArgumentNullException | options is null. |
NetworkException | The request could not reach the server (DNS, connection, or TLS failure). |
ApiException | The server returned a non-success (non-2xx) status. A status-specific subtype is thrown where it applies — e.g. NotFoundException (404), PermissionDeniedException (403), ConflictException (409). |
Examples
Example 1:
var user = await client.Users.GetAsync(new UsersGetOptions { Id = "your-user-id" });
Console.WriteLine(user.Email);Example 2:
// Or look a user up by email instead of ID.
var user = await client.Users.GetAsync(
new UsersGetOptions { Email = "[email protected]" }
);
Console.WriteLine(user.UserId);MeAsync
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.
Declaration
public Task<UserResponse> MeAsync(CancellationToken ct = default)
HTTP — GET /v1/users/me
Parameters
| Type | Name | Description |
|---|---|---|
CancellationToken | ct | Cancellation / deadline signal for the call. (optional) |
Returns
Task<UserResponse> — an awaitable that resolves to UserResponse.
Exceptions
| Type | Condition |
|---|---|
NetworkException | The request could not reach the server (DNS, connection, or TLS failure). |
ApiException | The server returned a non-success (non-2xx) status. A status-specific subtype is thrown where it applies — e.g. NotFoundException (404), PermissionDeniedException (403), ConflictException (409). |
Example
var user = await client.Users.MeAsync();
Console.WriteLine($"{user.Email} {user.UserId}");Data Models
Types in the Goodmem.Client.Models namespace. Each row lists the C# property, its type, the JSON wire name, and a description.
UserResponse
User information response
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
UserId | string | userId | The UUID of the user |
Email | string | email | The user's email address |
DisplayName | string | displayName | The user's display name |
Username | string | username | The user's username (optional) (optional) |
CreatedAt | DateTimeOffset | createdAt | Timestamp when the user was created (milliseconds since epoch) |
UpdatedAt | DateTimeOffset | updatedAt | Timestamp when the user was last updated (milliseconds since epoch) |