Update an API key
PUT /v1/apikeys/{id}: Updates an existing API key's labels or lifecycle status.
Updates an existing API key's labels or lifecycle status. Key ID, subject, ownership, key material, validity window, and creation audit fields remain immutable. Label changes require UPDATE_API_KEY; setting status=INACTIVE permanently revokes the key and requires DELETE_API_KEY; a request doing both requires both operations. Revoked keys cannot be reactivated. Side effects include updating administrative audit fields and, for revocation, recording the revocation time and actor.
ApiKeyAuthx-api-key<token>id*stringThe UUID of the API key to update
GoodMem-Timeout-Ms?integerOptional 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.
int641 <= value <= 86400000API key update details
application/json- body
Request parameters for updating an API key.
status?|New status for the API key. INACTIVE is permanent; revoked keys cannot be reactivated.
"ACTIVE""ACTIVE""INACTIVE"replaceLabels?|Replace all existing labels with this set. Mutually exclusive with mergeLabels. The stored map may contain at most 20 entries; keys and values contain at most 255 characters; keys use [a-z0-9._-].
properties <= 20{ "environment": "production", "service": "recommendation-engine"}mergeLabels?|Merge these labels with existing ones. Mutually exclusive with replaceLabels. The final stored map may contain at most 20 entries; keys and values contain at most 255 characters; keys use [a-z0-9._-].
properties <= 20{ "team": "ml-research"}Successfully updated API key
application/json- response
API key metadata without sensitive information.
apiKeyId*stringUnique identifier for the API key.
uuid"550e8400-e29b-41d4-a716-446655440000"subjectPrincipalId*stringPrincipal authenticated by this API key.
uuid"70e025f6-76ca-4cbe-b8fc-7dab8e84590a"ownerPrincipalId*stringPrincipal that administratively owns this API key.
uuid"b3303d0a-1a4a-493f-b9bf-38e37153b5a2"authorityMode*ApiKeyAuthorityModeImmutable authority derivation mode.
"INHERIT_SUBJECT""SCOPED"ceiling?array<>|Complete immutable issuance ceiling; omitted only when ceilingOmitted is true.
ceilingOmitted*booleanTrue only when a BASIC list projection intentionally omitted the immutable ceiling.
keyPrefix*stringFirst few characters of the key for display/identification purposes.
"gm_12345..."status*stringCompatibility usability status. ACTIVE means USABLE; INACTIVE combines NOT_YET_VALID, EXPIRED, and REVOKED.
"ACTIVE""ACTIVE""INACTIVE"lifecycleState*stringPrecise lifecycle state at the response evaluation instant.
"NOT_YET_VALID""USABLE""EXPIRED""REVOKED"labels*User-defined labels for organization and filtering.
{ "purpose": "production", "service": "recommendation-engine"}expiresAt?|Expiration timestamp in milliseconds since epoch. If not provided, the key does not expire.
int641672531200000validFrom*integerInclusive activation time in milliseconds since epoch.
int641640908800000revokedAt?|Permanent revocation time in milliseconds since epoch.
int641640995200000revokedById?|Exact audit actor UUID that revoked this key.
uuid"b3303d0a-1a4a-493f-b9bf-38e37153b5a2"lastUsedAt?|Last time this API key was used, in milliseconds since epoch.
int641640995200000createdAt*integerWhen the API key was created, in milliseconds since epoch.
int641640908800000updatedAt*integerWhen the API key was last updated, in milliseconds since epoch.
int641640908800000createdById*stringExact principal or API-key actor that created this API key.
uuid"b3303d0a-1a4a-493f-b9bf-38e37153b5a2"updatedById*stringExact principal or API-key actor that last updated this API key.
uuid"b3303d0a-1a4a-493f-b9bf-38e37153b5a2"curl -X PUT 'https://your-goodmem-server.example.com/v1/apikeys/550e8400-e29b-41d4-a716-446655440000' \ -H 'GoodMem-Timeout-Ms: 30000' \ -H 'Content-Type: application/json' \ -d '{ "status": "ACTIVE", "replaceLabels": { "environment": "production", "service": "recommendation-engine" }, "mergeLabels": { "team": "ml-research" }}'{ "apiKeyId": "550e8400-e29b-41d4-a716-446655440000", "subjectPrincipalId": "70e025f6-76ca-4cbe-b8fc-7dab8e84590a", "ownerPrincipalId": "b3303d0a-1a4a-493f-b9bf-38e37153b5a2", "authorityMode": "INHERIT_SUBJECT", "ceiling": [ { "assignedResource": { "resourceId": "550e8400-e29b-41d4-a716-446655440000" } } ], "ceilingOmitted": true, "keyPrefix": "gm_12345...", "status": "ACTIVE", "lifecycleState": "NOT_YET_VALID", "labels": { "purpose": "production", "service": "recommendation-engine" }, "expiresAt": 1672531200000, "validFrom": 1640908800000, "revokedAt": 1640995200000, "revokedById": "b3303d0a-1a4a-493f-b9bf-38e37153b5a2", "lastUsedAt": 1640995200000, "createdAt": 1640908800000, "updatedAt": 1640908800000, "createdById": "b3303d0a-1a4a-493f-b9bf-38e37153b5a2", "updatedById": "b3303d0a-1a4a-493f-b9bf-38e37153b5a2"}