System
Server info + system initialization.
Namespace: Goodmem.Client.Api · Class: SystemApi
Reach this surface as client.System 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
InfoAsync
Returns the server's advertised semantic version, git metadata, build timestamp, and optional capability flags. The endpoint is intentionally unauthenticated so bootstrap tooling can call it before API keys exist.
Declaration
public Task<SystemInfoResponse> InfoAsync(CancellationToken ct = default)
HTTP — GET /v1/system/info
Parameters
| Type | Name | Description |
|---|---|---|
CancellationToken | ct | Cancellation / deadline signal for the call. (optional) |
Returns
Task<SystemInfoResponse> — an awaitable that resolves to SystemInfoResponse.
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 info = await client.System.InfoAsync();
Console.WriteLine(info.Version);InitAsync
Initializes the system by creating a root user and API key. This endpoint should only be called once during first-time setup. If the system is already initialized, the endpoint will return a success response without creating new credentials.
Declaration
public Task<SystemInitResponse> InitAsync(CancellationToken ct = default)
HTTP — POST /v1/system/init
Parameters
| Type | Name | Description |
|---|---|---|
CancellationToken | ct | Cancellation / deadline signal for the call. (optional) |
Returns
Task<SystemInitResponse> — an awaitable that resolves to SystemInitResponse.
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 result = await client.System.InitAsync();
Console.WriteLine(result.AlreadyInitialized);Data Models
Types in the Goodmem.Client.Models namespace. Each row lists the C# property, its type, the JSON wire name, and a description.
SystemInfoResponse
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
Version | string | version | Semantic version string advertised by the running server. |
Major | int | major | Major version component parsed from the advertised semantic version. |
Minor | int | minor | Minor version component parsed from the advertised semantic version. |
Patch | int | patch | Patch version component parsed from the advertised semantic version. |
Dirty | bool | dirty | Whether the running build reports uncommitted workspace changes. |
GitCommit | string | gitCommit | Git commit SHA baked into the build, when available. (optional) |
GitDescribe | string | gitDescribe | Git describe output baked into the build, when available. (optional) |
BuildTime | string | buildTime | Build timestamp recorded for this server binary, when available. (optional) |
Capabilities | IReadOnlyDictionary<string, string> | capabilities | Optional capability flags or metadata advertised by the running server. (optional) |
SystemInitResponse
Response from the system initialization endpoint.
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
AlreadyInitialized | bool | alreadyInitialized | Indicates whether the system was already initialized before this request. |
Message | string | message | A human-readable message about the initialization status. |
RootApiKey | string | rootApiKey | The API key for the root user. Only present if system was just initialized (not previously initialized). (optional) |
UserId | string | userId | The user ID of the root user. Only present if system was just initialized (not previously initialized). (optional) |