Update passkey
Update the user ID or passkey username.
PATCH https://api.passlock.dev/{tenancyId}/passkeys/{passkeyId} HTTP/1.1Authorization: Bearer {apiKey}Accept: application/jsonContent-Type: application/json
{ "userId": "myCustomUserId", "username": "jdoe@example.com"}Note: All fields are optional
HTTP Response:
HTTP/1.1 202 AcceptedContent-Type: application/json
{ "_tag": "Passkey", "id": "sewqeeqx69cr7axut7kat", "userId": "puubifsmidah0f8c0y9bm", "enabled": true, "credential": { "id": "bW9wN3IzenE0enJ5OXVnZXoxOWF4", "userId": "MTVkMTFmdHM1Yzg0bDN0anpieG9w", "username": "jdoe@example.com", "aaguid": "0000-0000-0000-0000", "backedUp": true, "counter": 0, "deviceType": "multiDevice", "transports": ["internal"], "publicKey": "dGhpcy1pcy1hLWNib3ItcHVibGljLWtleQ", "rpId": "example.com" }, "platform": { "icon": "https://api.passlock.dev/aaguid/0000-0000-0000/icon.svg", "name": "Apple Passwords" }, "createdAt": 1770123293, "updatedAt": 1770123293, "lastUsed": 1770123293}import { updatePasskey } from "@passlock/server";
const tenancyId = "myTenancyId";const apiKey = "myApiKey";
const passkeyId = "myPasskeyId";const userId = "updatedUserId";const username = "updatedUsername";
const result = await updatePasskey({ passkeyId, userId, username, tenancyId, apiKey});
// in Node.js result.credential.publicKey is a Uint8ArrayResponse properties
Section titled “Response properties”The raw HTTP response has the same shape as Get passkey.
If you call @passlock/server.updatePasskey(), the returned Passkey object decodes credential.publicKey to a Uint8Array in the same way as getPasskey().