User
gRPC UserService reference for CreateUser, GetUser, ListUsers, UpdateUser and other RPCs, with request messages, response types, and service documentation.
Services
UserService Service
Manages human-user lifecycle and preserves the provisioning-only initialization entry point.
Authentication: gRPC metadata x-api-key: <api-key> for every RPC except
CompleteUserEnrollment and InitializeSystem. Completion authenticates one narrowly scoped
enrollment credential inside its transaction; initialization is available only through the
singleton bootstrap state.
Authorization Model:
- Each protected RPC evaluates a typed operation against the singleton instance or target user.
- Role names are not interpreted by this service.
- Creating a user never creates a credential, grant, authentication mapping, or role assignment.
Global Errors: All RPCs may return DEADLINE_EXCEEDED, CANCELLED, UNAVAILABLE,
RESOURCE_EXHAUSTED, or INTERNAL in addition to their operation-specific errors.
CreateUser
Creates a dormant human user without creating credentials or assigning roles.
| Type | |
|---|---|
| Request | goodmem.v1.CreateUserRequest |
| Response | goodmem.v1.User |
Auth: gRPC metadata x-api-key: <api-key>
Authorization Required: Instance-wide CREATE_USER with an ANY selector.
Request Behavior:
emailis required, nonblank, at most 255 characters, and globally unique, including among deleted users. It is treated as an identifier rather than subjected to a restrictive email syntax check.usernameis optional and globally unique when present.display_nameandlabelsare optional profile metadata.- The server generates
user_idwhen the caller omits it.
Response: The newly created User, including lifecycle and audit metadata. No credential
material is returned.
Side Effects:
- Atomically creates the durable
HUMANprincipal and its human-profile row. - Records the exact authenticated principal or API key as the audit actor.
- Does not create an API key, role assignment, direct grant, or authentication mapping.
Error Codes:
UNAUTHENTICATED: Missing or invalid authentication.INVALID_ARGUMENT: Malformed UUID; blank or overlong email; invalid profile field or labels.PERMISSION_DENIED: Caller lacks instance-wideCREATE_USER ANY.ALREADY_EXISTS: The UUID, email, or username is already occupied.INTERNAL: Unexpected server or database failure.
Idempotency: Not inherently idempotent. When a caller supplies user_id, a retry after a
successful creation returns ALREADY_EXISTS because that durable UUID remains occupied.
Examples:
grpcurl -plaintext \
-H 'x-api-key: <api-key>' \
-d '{
"email": "[email protected]",
"username": "avery",
"display_name": "Avery Person",
"labels": { "team": "platform" }
}' \
localhost:8080 goodmem.v1.UserService/CreateUserGetUser
Retrieves one human user by UUID, email, username, or the current request principal.
| Type | |
|---|---|
| Request | goodmem.v1.GetUserRequest |
| Response | goodmem.v1.User |
Auth: gRPC metadata x-api-key: <api-key>
Authorization Required: READ_USER on the resolved user.
Request (Lookup Logic):
- If
user_idis set, resolves that exact UUID. - If
emailis set, resolves that exact email address. - If
usernameis set, resolves that exact username. - If no selector is set, resolves the authenticated principal's own human-user record.
include_deleted=truepermits a tombstone to participate in lookup, but grants no authority.- UUID and current-user lookups preserve the ordinary distinction between
NOT_FOUNDandPERMISSION_DENIED. - Email and username lookups deliberately return
NOT_FOUNDfor both an absent value and an existing user the caller may not read. This prevents guessable natural keys from becoming a user-existence oracle.
Response: The resolved User in the requested lifecycle view.
Side Effects: None; this is a read-only operation.
Error Codes:
UNAUTHENTICATED: Missing or invalid authentication.INVALID_ARGUMENT: Malformed selector value.NOT_FOUND: No user exists in the requested lifecycle view, or an email/username match is not readable by the caller.PERMISSION_DENIED: A UUID/current-user lookup resolves a user the caller may not read.INTERNAL: Unexpected server or database failure.
Idempotency: Read-only and safe to retry.
Examples:
grpcurl -plaintext \
-H 'x-api-key: <api-key>' \
-d '{ "email": "[email protected]" }' \
localhost:8080 goodmem.v1.UserService/GetUserListUsers
Lists one stable, authorization-filtered page of human users.
| Type | |
|---|---|
| Request | goodmem.v1.ListUsersRequest |
| Response | goodmem.v1.ListUsersResponse |
Auth: gRPC metadata x-api-key: <api-key>
Authorization Required:
LIST_USERon the singleton GoodMem instance; andREAD_USERon every user returned in the page.
Request Behavior:
label_selectorsare combined with logical AND.include_deleted=trueadds tombstones to the candidate set but does not bypass either gate.max_resultsdefaults to 50 and may not exceed 1,000.next_tokenis opaque and bound to the caller, authentication context, and stable filters.include_enrollment_summary=truerequests non-secret bootstrap posture. A summary is present only on active rows for which the caller also has effectiveMANAGE_USER_ENROLLMENT; rows remain readable when that additional check is denied.- Filtering, authorization, and keyset pagination execute in PostgreSQL.
Response: A ListUsersResponse ordered by ascending creation time and UUID. next_token
is absent after the final page.
Side Effects: None; this is a read-only operation.
Error Codes:
UNAUTHENTICATED: Missing or invalid authentication.INVALID_ARGUMENT: Invalid filters, page size, or continuation token.PERMISSION_DENIED: Caller lacks the instance-levelLIST_USERcollection gate.INTERNAL: Unexpected server or database failure.
Idempotency: Read-only and safe to retry. Concurrent mutations may change later pages.
Examples:
grpcurl -plaintext \
-H 'x-api-key: <api-key>' \
-d '{ "label_selectors": { "team": "platform" }, "max_results": 50 }' \
localhost:8080 goodmem.v1.UserService/ListUsersUpdateUser
Updates mutable human profile fields or labels.
| Type | |
|---|---|
| Request | goodmem.v1.UpdateUserRequest |
| Response | goodmem.v1.User |
Auth: gRPC metadata x-api-key: <api-key>
Authorization Required: UPDATE_USER on the resolved user.
Request Behavior:
- At least one mutable field or label strategy must be present.
- A present empty
usernameordisplay_nameclears that optional field. - A present
emailmust be nonblank and at most 255 characters. replace_labelsreplaces the complete label map;merge_labelsupserts supplied entries.- The two label strategies are mutually exclusive.
- In protobuf JSON and
grpcurl, the bytes-valueduser_idis base64-encoded. - The final write rechecks authorization and active lifecycle state.
Response: The updated User, including refreshed update-audit metadata.
Side Effects: Updates explicitly selected profile fields, labels, and update-audit metadata.
Error Codes (in precedence order):
UNAUTHENTICATED: Missing or invalid authentication.INVALID_ARGUMENT: Malformed UUID; blank or overlong email; invalid/no-op mutation; or invalid labels.NOT_FOUND: The user UUID does not exist.PERMISSION_DENIED: Caller lacksUPDATE_USERon the resolved user.FAILED_PRECONDITION: The user is permanently deleted.ALREADY_EXISTS: The replacement email or username is already occupied.ABORTED: A concurrent lifecycle or authorization change invalidated the final write.INTERNAL: Unexpected server or database failure.
Idempotency: Repeating the same explicit values preserves the same profile state, although each successful call advances update-audit metadata.
Examples:
grpcurl -plaintext \
-H 'x-api-key: <api-key>' \
-d '{
"user_id": "BASE64_ENCODED_UUID",
"display_name": "Avery Person",
"merge_labels": { "labels": { "environment": "production" } }
}' \
localhost:8080 goodmem.v1.UserService/UpdateUserDeleteUser
Permanently soft-deletes one human user.
| Type | |
|---|---|
| Request | goodmem.v1.DeleteUserRequest |
| Response | google.protobuf.Empty |
Auth: gRPC metadata x-api-key: <api-key>
Authorization Required: Instance-wide DELETE_USER with an ANY selector.
Request Behavior:
- The target must be an existing human principal.
- In protobuf JSON and
grpcurl, the bytes-valueduser_idis base64-encoded. - The current GoodMem instance owner cannot be deleted; ownership must first be transferred.
- Deleting an already deleted user succeeds without changing its original tombstone or audit provenance.
Response: An empty protobuf message after the tombstone is committed.
Side Effects:
- Atomically records the permanent principal tombstone and deleting audit actor.
- Preserves the human profile, roles, grants, API keys, and resource ownership for history.
- Authentication subsequently rejects API keys whose subject is the deleted principal.
Error Codes (in precedence order):
UNAUTHENTICATED: Missing or invalid authentication.INVALID_ARGUMENT: Malformed user UUID.NOT_FOUND: The user UUID does not exist.PERMISSION_DENIED: Caller lacks instance-wideDELETE_USER ANY.FAILED_PRECONDITION: The user owns the GoodMem instance.ABORTED: A concurrent lifecycle or authorization change invalidated the final write.INTERNAL: Unexpected server or database failure.
Idempotency: Authorized retries succeed without changing the original tombstone or its audit provenance.
Examples:
grpcurl -plaintext \
-H 'x-api-key: <api-key>' \
-d '{ "user_id": "BASE64_ENCODED_UUID" }' \
localhost:8080 goodmem.v1.UserService/DeleteUserCreateUserEnrollment
Creates a short-lived enrollment credential for one dormant human user.
| Type | |
|---|---|
| Request | goodmem.v1.CreateUserEnrollmentRequest |
| Response | goodmem.v1.CreateUserEnrollmentResponse |
Auth: gRPC metadata x-api-key: <api-key>
Authorization Required: MANAGE_USER_ENROLLMENT with ANY or EXACT authority covering
the target user. Only an authenticated HUMAN may administer enrollment.
Request Behavior:
user_idmust identify an active human that has never completed enrollment and has no API key.- The server generates
enrollment_idwhen the caller omits it. - At most one unconsumed, unrevoked enrollment may exist for a user.
rotate_existing=falsereturnsALREADY_EXISTSwhen a live enrollment exists.rotate_existing=trueatomically revokes an existing open enrollment and creates its replacement. An expired open enrollment is replaced without requiring this flag.- The server applies its fixed enrollment lifetime; callers cannot select an expiration.
Response: Enrollment metadata and the one-time raw enrollment credential. The credential cannot be read again and must be delivered to the target human over a secure channel.
Side Effects: Atomically creates one enrollment and, when rotating, permanently revokes the previous open enrollment. It does not create an API key, role, grant, or login mapping.
Error Codes (in precedence order):
UNAUTHENTICATED: Missing or invalid administrator authentication.INVALID_ARGUMENT: Malformed user or enrollment UUID.FAILED_PRECONDITION: The caller is a service principal.NOT_FOUND: The target human does not exist.PERMISSION_DENIED: Caller lacksMANAGE_USER_ENROLLMENTon the target user.FAILED_PRECONDITION: The user is deleted or no longer eligible for initial enrollment.ALREADY_EXISTS: A live enrollment exists without rotation, or the requested enrollment UUID is already occupied.ABORTED: A concurrent lifecycle, credential, or authorization change invalidated creation.INTERNAL: Unexpected server or database failure.
Idempotency: Not replayable as a secret-returning operation. If the response is lost, use a caller-provided enrollment UUID to inspect the outcome, then revoke and replace any committed enrollment. The raw credential is never disclosed twice.
GetUserEnrollment
Retrieves non-secret metadata for one current or historical enrollment.
| Type | |
|---|---|
| Request | goodmem.v1.GetUserEnrollmentRequest |
| Response | goodmem.v1.GetUserEnrollmentResponse |
Auth: gRPC metadata x-api-key: <api-key>
Authorization Required: MANAGE_USER_ENROLLMENT with ANY or EXACT authority covering
user_id. Only an authenticated HUMAN may administer enrollment.
Request Behavior: Both UUIDs are required. The service resolves and authorizes the target
user before resolving the enrollment under the pair (user_id, enrollment_id). An enrollment
belonging to another user is therefore indistinguishable from an absent enrollment.
Response: Current or historical enrollment metadata. Raw enrollment credential material is never returned.
Side Effects: None; this is a read-only operation.
Error Codes (in precedence order):
UNAUTHENTICATED: Missing or invalid administrator authentication.INVALID_ARGUMENT: Malformed user or enrollment UUID.FAILED_PRECONDITION: The caller is a service principal.NOT_FOUND: The target user or enrollment does not exist under the requested pair.PERMISSION_DENIED: Caller lacksMANAGE_USER_ENROLLMENTon the target user.INTERNAL: Unexpected server or database failure.
Idempotency: Read-only and safe to retry.
ListUserEnrollments
Lists one stable page of current and historical enrollments for a human user.
| Type | |
|---|---|
| Request | goodmem.v1.ListUserEnrollmentsRequest |
| Response | goodmem.v1.ListUserEnrollmentsResponse |
Auth: gRPC metadata x-api-key: <api-key>
Authorization Required: MANAGE_USER_ENROLLMENT with ANY or EXACT authority covering
user_id. Only an authenticated HUMAN may administer enrollment.
Request Behavior:
user_idis required and may identify an active user or retained tombstone.max_resultsdefaults to 50 and may not exceed 1,000.next_tokenis opaque and bound to the target user, request principal, and exact authenticating API key when present.- Pending, expired, consumed, and revoked enrollments all participate in the page.
Response: Enrollment metadata ordered by descending creation time and enrollment UUID.
next_token is absent after the final page. Raw enrollment credentials are never included.
Side Effects: None; this is a read-only operation.
Error Codes (in precedence order):
UNAUTHENTICATED: Missing or invalid administrator authentication.INVALID_ARGUMENT: Malformed user UUID, invalid page size, or invalid continuation token.FAILED_PRECONDITION: The caller is a service principal.NOT_FOUND: The target user does not exist in the retained lifecycle view.PERMISSION_DENIED: Caller lacksMANAGE_USER_ENROLLMENTon the target user.INTERNAL: Unexpected server or database failure.
Idempotency: Read-only and safe to retry. Concurrent enrollment changes may alter later pages.
RevokeUserEnrollment
Permanently revokes one outstanding enrollment credential.
| Type | |
|---|---|
| Request | goodmem.v1.RevokeUserEnrollmentRequest |
| Response | goodmem.v1.RevokeUserEnrollmentResponse |
Auth: gRPC metadata x-api-key: <api-key>
Authorization Required: MANAGE_USER_ENROLLMENT with ANY or EXACT authority covering
user_id. Only an authenticated HUMAN may administer enrollment.
Request Behavior: Both UUIDs are required. The target user is resolved and authorized before the enrollment pair is resolved. Repeating an authorized revocation preserves and returns its original revocation time and actor. A consumed enrollment cannot be revoked.
Response: Terminal enrollment metadata, including revocation provenance.
Side Effects: The first successful call records permanent revocation time and the exact authenticated principal or API key as revoking actor. The enrollment row is retained.
Error Codes (in precedence order):
UNAUTHENTICATED: Missing or invalid administrator authentication.INVALID_ARGUMENT: Malformed user or enrollment UUID.FAILED_PRECONDITION: The caller is a service principal.NOT_FOUND: The target user or enrollment does not exist under the requested pair.PERMISSION_DENIED: Caller lacksMANAGE_USER_ENROLLMENTon the target user.FAILED_PRECONDITION: The enrollment was consumed.ABORTED: A concurrent completion or authorization change invalidated revocation.INTERNAL: Unexpected server or database failure.
Idempotency: Authorized retries preserve and return the original revocation provenance.
CompleteUserEnrollment
Exchanges one valid enrollment credential for its human's initial API key.
| Type | |
|---|---|
| Request | goodmem.v1.CompleteUserEnrollmentRequest |
| Response | goodmem.v1.CompleteUserEnrollmentResponse |
Auth: No ordinary API-key metadata. The required enrollment credential authenticates only this completion operation and is validated inside the completion transaction.
Authorization Required: Possession of the pending, unexpired, unrevoked enrollment
credential. MANAGE_USER_ENROLLMENT is not evaluated during completion.
Request Behavior:
enrollment_tokenis always required.api_key_idandraw_api_keyare an all-or-nothing optional pair.- When both are omitted, the server generates the API-key UUID and canonical raw
gm_key. - When both are supplied, the client must retain the exact tuple for retry safety.
- The enrollment credential and raw API key are input-only secrets and must never be logged.
- First completion requires an active human with no API key and no previously consumed enrollment.
- An exact retry of a client-supplied tuple succeeds with
already_completed=trueand changes no durable state. A server-generated completion cannot be replayed or redisclosed. - Every other nonblank unusable enrollment credential receives the same authentication error.
Response: Metadata for the self-owned, inheriting initial API key, whether the call was an exact retry, and the one-time raw API key only after a fresh server-generated completion. Client-supplied raw material and enrollment credentials are never echoed.
Side Effects: On first completion, atomically creates one active API key for the enrolled human and permanently consumes the enrollment. It assigns no role or grant.
Error Codes:
INVALID_ARGUMENT: The enrollment credential is blank; exactly one optional key field is present; the supplied UUID is malformed; or the supplied raw API key is not canonical.UNAUTHENTICATED: The enrollment credential is invalid, unknown, expired, revoked, bound to a deleted or ineligible user, consumed after server generation, consumed with a different client tuple, or otherwise unusable.ALREADY_EXISTS: The proposed API-key UUID or verifier is already used by another key.ABORTED: A concurrent completion, revocation, deletion, or credential publication won.INTERNAL: Unexpected server or database failure.
Idempotency: Client-supplied mode is retry-safe only with the exact original tuple. Server- generated mode is not safely retryable after an ambiguous response because raw material is returned exactly once and cannot be recovered.
InitializeSystem
Initializes the singleton GoodMem instance and its first root human.
| Type | |
|---|---|
| Request | goodmem.v1.InitializeSystemRequest |
| Response | goodmem.v1.InitializeSystemResponse |
Auth: None. This and CompleteUserEnrollment are the only methods in UserService that do
not require ordinary API-key authentication.
Authorization Required: None. Availability is limited by the singleton initialization state.
Request: Empty. Initialization values are generated by the server.
Side Effects on First Initialization:
- Atomically creates the first
HUMANprincipal and human profile. - Creates the singleton GoodMem instance owned by that principal.
- Creates the ownership-mirroring
ROOTassignment and initialADMINassignment. - Creates and returns the one-time raw bootstrap API key.
Subsequent Calls:
- Perform no credential-producing side effect.
- Return
already_initialized=trueinstead of returningALREADY_EXISTS. - Never reveal the bootstrap credential again.
Response: An InitializeSystemResponse describing whether initialization occurred. The raw
bootstrap API key is populated only on the successful first call.
Error Codes:
INTERNAL: Unexpected provisioning or database failure.
Idempotency: Idempotent with respect to durable initialization. Only the successful first call returns the raw bootstrap API key, so callers must save it immediately.
Examples:
grpcurl -plaintext \
-d '{}' \
localhost:8080 goodmem.v1.UserService/InitializeSystemMessages
User
A human user backed by a durable HUMAN principal.
Human users are permanently self-owned. Labels, lifecycle state, and audit provenance are stored on the shared principal, while email, username, and display name are human-profile fields. A deleted user remains a durable tombstone and cannot be restored or recreated under the same UUID.
All fields are OUTPUT_ONLY. Timestamps are UTC. Audit actor identifiers may name either a
principal or the exact API key used for the mutation.
| Field | Type | Description |
|---|---|---|
user_id | bytes | OUTPUT_ONLY; UUID (16 bytes), immutable and permanently occupied after creation. |
email | string | OUTPUT_ONLY; unique, nonempty email address. Uniqueness includes deleted users. |
display_name | string | OUTPUT_ONLY; optional human-facing name. Presence distinguishes absence from an empty string. |
username | string | OUTPUT_ONLY; optional unique username. Uniqueness includes deleted users. |
labels | goodmem.v1.User.LabelsEntry | OUTPUT_ONLY; mutable labels; at most 20 entries with keys matching [a-z0-9._-]. |
enrollment_summary | ...odmem.v1.UserEnrollmentSummary | OUTPUT_ONLY; enrollment posture when explicitly requested and independently authorized. Absent for deleted users and when the caller lacks MANAGE_USER_ENROLLMENT on this user. |
created_at | google.protobuf.Timestamp | OUTPUT_ONLY; creation timestamp. |
updated_at | google.protobuf.Timestamp | OUTPUT_ONLY; timestamp of the most recent profile or lifecycle mutation. |
created_by_id | bytes | OUTPUT_ONLY; exact audit actor UUID (16 bytes) that created the user. |
updated_by_id | bytes | OUTPUT_ONLY; exact audit actor UUID (16 bytes) responsible for the most recent mutation. |
deleted_at | google.protobuf.Timestamp | OUTPUT_ONLY; permanent soft-deletion timestamp; absent while active. |
deleted_by_id | bytes | OUTPUT_ONLY; exact audit actor UUID (16 bytes) that deleted the user; absent while active. |
User.LabelsEntry
| Field | Type | Description |
|---|---|---|
key | string | |
value | string |
UserEnrollmentSummary
Non-secret bootstrap posture for one active human user.
| Field | Type | Description |
|---|---|---|
bootstrap_eligible | bool | OUTPUT_ONLY; true when no enrollment has ever been consumed and the user has no API key. An open enrollment may coexist with eligibility and is described by the fields below. |
open_enrollment_status | ...oodmem.v1.UserEnrollmentStatus | OUTPUT_ONLY; current state of the one open enrollment, when present. Only PENDING and EXPIRED are valid here; terminal CONSUMED and REVOKED enrollments are not open. |
open_enrollment_expires_at | google.protobuf.Timestamp | OUTPUT_ONLY; exclusive completion deadline. Present exactly with open_enrollment_status. |
CreateUserRequest
Request to create a human user without implicit security side effects.
| Field | Type | Description |
|---|---|---|
user_id | bytes | Optional client-provided UUID (16 bytes); the server generates one when absent. |
email | string | Required unique, nonblank email identifier; at most 255 characters. |
username | string | Optional unique username; an empty present value is treated as absent. |
display_name | string | Optional human-facing name; an empty present value is treated as absent. |
labels | ....CreateUserRequest.LabelsEntry | Optional labels; at most 20 entries, keys/values at most 255 chars, keys [a-z0-9._-]. |
CreateUserRequest.LabelsEntry
| Field | Type | Description |
|---|---|---|
key | string | |
value | string |
GetUserRequest
Request to resolve a user by exactly one selector, or the current user when unset.
| Field | Type | Description |
|---|---|---|
user_id | bytes | User UUID (16 bytes). |
email | string | Exact email address. |
username | string | Exact username. |
include_deleted | bool | Include permanent tombstones in the lookup lifecycle view; does not bypass READ_USER. |
ListUsersRequest
Request for one stable, authorization-filtered user page.
| Field | Type | Description |
|---|---|---|
include_deleted | bool | Include tombstones in the candidate lifecycle view; does not bypass authorization. |
label_selectors | ...ersRequest.LabelSelectorsEntry | Conjunction of exact key/value matches against principal labels. |
max_results | int32 | Page size; defaults to 50 and must be between 1 and 1000 when present. |
next_token | string | Opaque continuation token returned by the preceding page. |
include_enrollment_summary | bool | Request enrollment posture on independently authorized active rows; defaults to false. |
ListUsersRequest.LabelSelectorsEntry
| Field | Type | Description |
|---|---|---|
key | string | |
value | string |
ListUsersResponse
One stable page of readable human users. All fields are OUTPUT_ONLY.
| Field | Type | Description |
|---|---|---|
users | goodmem.v1.User | OUTPUT_ONLY; users ordered by creation timestamp and UUID using stable keyset ordering. |
next_token | string | OUTPUT_ONLY; opaque continuation token; absent after the final page. |
ListUsersNextPageToken
Internal cursor encoded by the server; clients must treat public next_token strings as opaque.
| Field | Type | Description |
|---|---|---|
requestor_id | bytes | Authenticated request-principal UUID bound to the first page. |
authenticating_api_key_id | bytes | Exact authenticating API-key UUID, when API-key authentication was used. |
include_deleted | bool | Lifecycle filter bound to the first page. |
label_selectors | ...tPageToken.LabelSelectorsEntry | Label filters bound to the first page. |
last_created_at | google.protobuf.Timestamp | Creation timestamp of the final row returned by the preceding page. |
last_user_id | bytes | User UUID of the final row returned by the preceding page. |
include_enrollment_summary | bool | Whether enrollment-summary projection was requested on the first page. |
ListUsersNextPageToken.LabelSelectorsEntry
| Field | Type | Description |
|---|---|---|
key | string | |
value | string |
UpdateUserRequest
Request to update mutable fields of one active human user.
| Field | Type | Description |
|---|---|---|
user_id | bytes | Required user UUID (16 bytes). |
email | string | Optional replacement email identifier; when present, it must be nonblank and at most 255 chars. |
username | string | Optional replacement username; a present empty value clears the username. |
display_name | string | Optional replacement display name; a present empty value clears the display name. |
replace_labels | goodmem.v1.StringMap | Replace all labels; an empty map clears them. |
merge_labels | goodmem.v1.StringMap | Upsert entries while preserving unmentioned labels; the final map must satisfy label limits. |
DeleteUserRequest
Request to permanently soft-delete a human user.
| Field | Type | Description |
|---|---|---|
user_id | bytes | Required user UUID (16 bytes). |
UserEnrollment
Non-secret metadata for one current or historical human-user enrollment.
All fields are OUTPUT_ONLY. The raw enrollment credential is deliberately absent and can be
returned only once by CreateUserEnrollment. Status is derived from terminal fields and the
current time rather than stored as mutable state.
| Field | Type | Description |
|---|---|---|
enrollment_id | bytes | OUTPUT_ONLY; immutable enrollment UUID (16 bytes). |
user_id | bytes | OUTPUT_ONLY; UUID (16 bytes) of the HUMAN principal invited to enroll. |
credential_prefix | string | OUTPUT_ONLY; non-secret display prefix used to identify the credential safely. |
status | ...oodmem.v1.UserEnrollmentStatus | OUTPUT_ONLY; derived pending, expired, consumed, or revoked lifecycle state. |
expires_at | google.protobuf.Timestamp | OUTPUT_ONLY; exclusive expiration time for first completion. |
consumed_api_key_id | bytes | OUTPUT_ONLY; initial API-key UUID (16 bytes), present after consumption. |
created_at | google.protobuf.Timestamp | OUTPUT_ONLY; creation timestamp. |
consumed_at | google.protobuf.Timestamp | OUTPUT_ONLY; successful first-completion timestamp, present after consumption. |
revoked_at | google.protobuf.Timestamp | OUTPUT_ONLY; permanent revocation timestamp, present after revocation. |
created_by_id | bytes | OUTPUT_ONLY; exact principal or API-key actor UUID (16 bytes) that created the enrollment. |
revoked_by_id | bytes | OUTPUT_ONLY; exact principal or API-key actor UUID (16 bytes) that revoked the enrollment. |
CreateUserEnrollmentRequest
Request to create or explicitly rotate one human's enrollment credential.
| Field | Type | Description |
|---|---|---|
user_id | bytes | REQUIRED; UUID (16 bytes) of the existing HUMAN target. |
enrollment_id | bytes | OPTIONAL; client UUID (16 bytes). The server generates a UUIDv7 when absent or empty. |
rotate_existing | bool | OPTIONAL; revoke an existing live enrollment while creating its replacement; defaults false. |
CreateUserEnrollmentResponse
Result of creating an enrollment. All fields are OUTPUT_ONLY.
| Field | Type | Description |
|---|---|---|
enrollment | goodmem.v1.UserEnrollment | OUTPUT_ONLY; newly created enrollment metadata. |
enrollment_token | string | OUTPUT_ONLY; one-time raw enrollment credential. Save and deliver it securely. |
GetUserEnrollmentRequest
Request to read one enrollment under its target user.
| Field | Type | Description |
|---|---|---|
user_id | bytes | REQUIRED; UUID (16 bytes) of the HUMAN target. |
enrollment_id | bytes | REQUIRED; UUID (16 bytes) of the enrollment to read. |
GetUserEnrollmentResponse
Result of reading one enrollment. All fields are OUTPUT_ONLY.
| Field | Type | Description |
|---|---|---|
enrollment | goodmem.v1.UserEnrollment | OUTPUT_ONLY; current or historical enrollment metadata. |
ListUserEnrollmentsRequest
Request for one stable page of a human's enrollment history.
| Field | Type | Description |
|---|---|---|
user_id | bytes | REQUIRED; UUID (16 bytes) of the HUMAN target. |
max_results | int32 | OPTIONAL; defaults to 50 and must be between 1 and 1,000 when present. |
next_token | string | OPTIONAL; opaque continuation token returned by the preceding page. |
ListUserEnrollmentsResponse
One stable page of enrollment history. All fields are OUTPUT_ONLY.
| Field | Type | Description |
|---|---|---|
enrollments | goodmem.v1.UserEnrollment | OUTPUT_ONLY; enrollments ordered by descending creation timestamp and UUID. |
next_token | string | OUTPUT_ONLY; opaque continuation token, absent after the final page. |
ListUserEnrollmentsNextPageToken
Internal cursor encoded by the server; public next_token strings are opaque.
| Field | Type | Description |
|---|---|---|
user_id | bytes | Target HUMAN UUID bound to the first page. |
requestor_id | bytes | Authenticated request-principal UUID bound to the first page. |
authenticating_api_key_id | bytes | Exact authenticating API-key UUID, when API-key authentication was used. |
last_created_at | google.protobuf.Timestamp | Creation timestamp of the final row returned by the preceding page. |
last_enrollment_id | bytes | Enrollment UUID of the final row returned by the preceding page. |
RevokeUserEnrollmentRequest
Request to permanently revoke one enrollment under its target user.
| Field | Type | Description |
|---|---|---|
user_id | bytes | REQUIRED; UUID (16 bytes) of the HUMAN target. |
enrollment_id | bytes | REQUIRED; UUID (16 bytes) of the enrollment to revoke. |
RevokeUserEnrollmentResponse
Result of revoking one enrollment. All fields are OUTPUT_ONLY.
| Field | Type | Description |
|---|---|---|
enrollment | goodmem.v1.UserEnrollment | OUTPUT_ONLY; terminal enrollment metadata with original revocation provenance. |
CompleteUserEnrollmentRequest
Request to exchange one enrollment credential for its human's initial API key.
| Field | Type | Description |
|---|---|---|
enrollment_token | string | REQUIRED, INPUT_ONLY; raw enrollment credential. Never log, echo, or persist this value. |
api_key_id | bytes | OPTIONAL, INPUT_ONLY; client-generated API-key UUID (16 bytes), present only with raw_api_key. |
raw_api_key | string | OPTIONAL, INPUT_ONLY; canonical raw gm_ API key, present only with api_key_id. Never log it. |
CompleteUserEnrollmentResponse
Result of fresh or exactly replayed enrollment completion. All fields are OUTPUT_ONLY.
| Field | Type | Description |
|---|---|---|
api_key | goodmem.v1.ApiKey | OUTPUT_ONLY; initial API-key metadata. |
already_completed | bool | OUTPUT_ONLY; true when the exact completion tuple had already committed. |
raw_api_key | string | OUTPUT_ONLY; one-time key returned only after a fresh server-generated completion. |
InitializeSystemRequest
Empty request for the unauthenticated, one-time provisioning operation.
InitializeSystemResponse
Result of singleton system initialization. All fields are OUTPUT_ONLY.
| Field | Type | Description |
|---|---|---|
already_initialized | bool | OUTPUT_ONLY; true when provisioning had completed before this call. |
message | string | OUTPUT_ONLY; human-readable initialization state. |
root_api_key | string | OUTPUT_ONLY; one-time raw bootstrap API key; populated only by first initialization. |
user_id | bytes | OUTPUT_ONLY; root human UUID (16 bytes); populated only by first initialization. |
Enums
UserEnrollmentStatus
Derived lifecycle state of a retained human-user enrollment.
| Name | Value | Description |
|---|---|---|
USER_ENROLLMENT_STATUS_UNSPECIFIED | 0 | Invalid output value; never persisted. |
USER_ENROLLMENT_STATUS_PENDING | 1 | Unconsumed, unrevoked, and not yet expired. |
USER_ENROLLMENT_STATUS_EXPIRED | 2 | Open but at or beyond its expiration time. |
USER_ENROLLMENT_STATUS_CONSUMED | 3 | Successfully exchanged for an initial API key. |
USER_ENROLLMENT_STATUS_REVOKED | 4 | Permanently revoked by an administrator. |