GoodMemGoodMem

UserEnrollments

Methods on this page are called as client.user_enrollments.<method>(...) on a Goodmem instance.

Classai.pairsys.goodmem.client.api.UserEnrollmentsAPI (extends internal UserEnrollmentsAPIBase).

import ai.pairsys.goodmem.client.Goodmem;

try (Goodmem client = Goodmem.builder()
        .baseUrl("http://localhost:8080")
        .apiKey("gm_...")
        .build()) {
    // client.user_enrollments.<method>(...)
}

Async variants

Every method listed below also exists on ai.pairsys.goodmem.client.api.AsyncUserEnrollmentsAPI (accessed via asyncClient.user_enrollments on an AsyncGoodmem) with the same parameter list, wrapped in CompletableFuture<T>. Paginated list methods return CompletableFuture<AsyncPage<T>>. See the async client guide for composition patterns.

import ai.pairsys.goodmem.client.AsyncGoodmem;

try (AsyncGoodmem asyncClient = AsyncGoodmem.builder()
        .baseUrl("http://localhost:8080")
        .apiKey("gm_...")
        .build()) {
    asyncClient.user_enrollments.<method>(...)  // returns CompletableFuture<T>
}

Method Summary

Modifier and TypeMethodDescription
CompleteUserEnrollmentResponsecomplete(CompleteUserEnrollmentRequest)Complete human-user enrollment

Method Detail

complete(CompleteUserEnrollmentRequest)

CompleteUserEnrollmentResponse complete(CompleteUserEnrollmentRequest request)

Javadoccomplete(CompleteUserEnrollmentRequest)

Exchanges a one-time enrollment credential for the human's initial self-owned API key. This endpoint does not use ordinary API-key authentication. Omit both optional key fields for server generation; a fresh response discloses the raw key exactly once and cannot be safely retried after an ambiguous outcome. Supply and retain both fields for client mode, where only an exact tuple retry is safe and raw material is never echoed. Status precedence is request-shape errors (400), then the same generic authentication failure for every nonblank unusable enrollment (401); key conflicts or concurrent lifecycle winners return 409, rate limits return 429, and unexpected failures return 500.

HTTPPOST /v1/user-enrollments:complete

Parameters

ReturnsCompleteUserEnrollmentResponse

Throws

Example

CompleteUserEnrollmentResponse completeUserEnrollmentResponse = client.user_enrollments.complete(CompleteUserEnrollmentRequest.builder()
            // …set required fields…
            .build());

REST equivalent

curl -X POST 'http://localhost:8080/v1/user-enrollments:complete' \
  -H "x-api-key: gm_..." \
  -H "Content-Type: application/json" \
  -d '{
    "enrollmentToken": "gme_..."
  }'

Errors

Every method on this page may throw the standard HTTP-error class hierarchy rooted at GoodmemException:

BadRequestException (400), AuthenticationException (401), PermissionDeniedException (403), NotFoundException (404), ConflictException (409), UnprocessableEntityException (422), RateLimitException (429), InternalServerException (5xx), or the generic ApiException for any other 4xx/5xx. All are unchecked (RuntimeException). See Errors.

All error classes live in ai.pairsys.goodmem.client.errors and are unchecked (RuntimeException). Async siblings complete the returned CompletableFuture exceptionally with the same types, wrapped in CompletionException at await time. See Errors on the index for the full table.