GoodMemGoodMem
ReferenceAPIREST APIUsers

Create a human-user enrollment

POST /v1/users/{userId}/enrollments: Creates a short-lived, one-time enrollment credential for an existing dormant human.

POST
/v1/users/{userId}/enrollments

Creates a short-lived, one-time enrollment credential for an existing dormant human. Requires MANAGE_USER_ENROLLMENT with ANY or EXACT authority on the target user. The raw credential is returned only once. rotateExisting atomically revokes and replaces a live enrollment; an expired enrollment is replaced automatically.

Authorization

ApiKeyAuth
headerx-api-key<token>

Path Parameters

userId*string

Human-user UUID

Header Parameters

GoodMem-Timeout-Ms?integer

Optional waiting budget in milliseconds, measured from REST servlet ingress and shared across all internal gRPC calls. Supply one decimal integer from 1 to 86400000. Omission adds no deadline. Existing shorter deadlines still apply. Expiry returns HTTP 504 before streaming starts; after streaming starts, no successful completion event is sent. Use SSE or opt into GoodMem-Stream-Terminal for an explicit terminal outcome. Retrieval work is cooperatively cancelled. An accepted mutation may still commit after timeout or disconnect; a failed response does not imply rollback.

Formatint64
Range1 <= value <= 86400000

Request Body

application/json
  1. body

Options for issuing a one-time enrollment credential to the user named by the request path.

enrollmentId?|

Optional client-provided enrollment UUID; generated when omitted.

Formatuuid
Example"0198b9f4-c42f-7ae3-8c56-44d827ea03bd"
rotateExisting?|

Whether an existing live enrollment may be revoked and atomically replaced.

Defaultfalse

Response Body

Enrollment created; save the one-time token immediately

application/json
  1. response

New enrollment metadata and its one-time raw enrollment credential.

enrollment*

OUTPUT_ONLY; non-secret metadata for the created enrollment.

enrollmentToken*string

OUTPUT_ONLY; one-time raw enrollment credential. Save and deliver it securely.

Match^gme_[a-z2-7]{52}$
Length56 <= length <= 56
Example"gme_mzxw6ytboiww6z3foj2xezltoqxxezltoqxxezltoqxxezltoqxa"
Example Request
curl -X POST 'https://your-goodmem-server.example.com/v1/users/70e025f6-76ca-4cbe-b8fc-7dab8e84590a/enrollments' \  -H 'GoodMem-Timeout-Ms: 30000' \  -H 'Content-Type: application/json' \  -d '{  "enrollmentId": "0198b9f4-c42f-7ae3-8c56-44d827ea03bd"}'
Example Response
{  "enrollment": {    "enrollmentId": "0198b9f4-c42f-7ae3-8c56-44d827ea03bd",    "userId": "70e025f6-76ca-4cbe-b8fc-7dab8e84590a",    "credentialPrefix": "gme_mzxw6y",    "status": "PENDING",    "expiresAt": 1786752000000,    "consumedApiKeyId": "550e8400-e29b-41d4-a716-446655440000",    "createdAt": 1786665600000,    "consumedAt": 1786669200000,    "revokedAt": 1786669200000,    "createdById": "b3303d0a-1a4a-493f-b9bf-38e37153b5a2",    "revokedById": "b3303d0a-1a4a-493f-b9bf-38e37153b5a2"  },  "enrollmentToken": "gme_mzxw6ytboiww6z3foj2xezltoqxxezltoqxxezltoqxxezltoqxa"}