GoodMemGoodMem
ReferenceSdkV2.NET

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

MethodSummary
GetAsyncGet a user by ID.
MeAsyncGet current user profile.

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)

HTTPGET /v1/users/&#123;id&#125;

Parameters

TypeNameDescription
UsersGetOptionsoptionsOptions bag carrying the lookup key(s) / convenience knobs; the linked type lists them all.
CancellationTokenctCancellation / deadline signal for the call. (optional)

Returns

Task<UserResponse> — an awaitable that resolves to UserResponse.

Exceptions

TypeCondition
ArgumentNullExceptionoptions is null.
NetworkExceptionThe request could not reach the server (DNS, connection, or TLS failure).
ApiExceptionThe 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)

HTTPGET /v1/users/me

Parameters

TypeNameDescription
CancellationTokenctCancellation / deadline signal for the call. (optional)

Returns

Task<UserResponse> — an awaitable that resolves to UserResponse.

Exceptions

TypeCondition
NetworkExceptionThe request could not reach the server (DNS, connection, or TLS failure).
ApiExceptionThe 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

PropertyTypeJSON (wire)Description
UserIdstringuserIdThe UUID of the user
EmailstringemailThe user's email address
DisplayNamestringdisplayNameThe user's display name
UsernamestringusernameThe user's username (optional) (optional)
CreatedAtDateTimeOffsetcreatedAtTimestamp when the user was created (milliseconds since epoch)
UpdatedAtDateTimeOffsetupdatedAtTimestamp when the user was last updated (milliseconds since epoch)