List the public key credentials of the WebAuthn Registrations or Passkeys registered to a specific User.
List WebAuthn Credentials
Path parameters
The user_id of an active user the Passkey or WebAuthn registration should be tied to.
The domain for Passkeys or WebAuthn. Defaults to window.location.hostname.
Response fields
The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
A list of WebAuthn credential objects.
The unique, public ID of the WebAuthn credential.
The public key for the WebAuthn credential in base64 format.
The unique ID for the Passkey or WebAuthn registration.
The type of the WebAuthn credential. Examples include public-key.
const stytch = require('stytch');
const client = new stytch.Client({
project_id: 'PROJECT_ID',
secret: 'SECRET',
});
const params = {
user_id: "user-test-16d9ba61-97a1-4ba4-9720-b03761dc50c6",
domain: "example.com",
};
client.webauthn.listCredentials(params)
.then(resp => { console.log(resp) })
.catch(err => { console.log(err) });
{
"credentials": [
{
"credential_id": "AAbb55jpkgGGAA4AFvmBBA==",
"type": "public-key",
"webauthn_registration_id": "webauthn-registration-test-5c44cc6a-8af7-48d6-8da7-ea821342f5a6",
"public_key": "pQECAbBbCCCCdDdd12E34ffGhhIjKLMN0PqrSTuVWxyZ+AbBbCCCCdDdd12E34ffGhhIjKLMN0PqrSTuVWxyZ12c+/AbcdE1z123Xc1=",
}
],
"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
"status_code": 200
}
{
"status_code": 404,
"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
"error_type": "webauthn_registration_not_found",
"error_message": "WebAuthn registration could not be found.",
"error_url": "https://stytch.com/docs/api/errors/404"
}
{
"status_code": 429,
"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
"error_type": "too_many_requests",
"error_message": "Too many requests have been made.",
"error_url": "https://stytch.com/docs/api/errors/429"
}
{
"status_code": 500,
"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
"error_type": "internal_server_error",
"error_message": "Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us know what went wrong.",
"error_url": "https://stytch.com/docs/api/errors/500"
}