List WebAuthn Credentials
List all registered WebAuthn credentials for the authenticated user.
Quick Navigation
Endpoint
GET /api/v1/webauthn/credentials
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <access_token> |
Response
Success (200)
{
"success": true,
"data": {
"credentials": [
{
"id": 1,
"device_name": "iPhone 14 Pro",
"credential_id": "credential_id_base64",
"created_at": "2024-01-01T10:00:00Z",
"last_used_at": "2024-01-01T14:00:00Z",
"usage_count": 15
},
{
"id": 2,
"device_name": "YubiKey 5",
"credential_id": "credential_id_base64",
"created_at": "2024-01-02T10:00:00Z",
"last_used_at": "2024-01-02T11:00:00Z",
"usage_count": 3
}
],
"total_count": 2
},
"message": "WebAuthn credentials retrieved successfully"
}
Error Codes
| Status | Code | Description |
|---|---|---|
| 401 | UNAUTHORIZED | Invalid or missing token |
| 500 | CREDENTIAL_LISTING_FAILED | Internal server error |
Data Flow
-
Authentication
- Verify access token
- Get current user
-
Credentials Query
- Query WebAuthnCredential table
- Filter by user ID
- Order by created_at DESC
-
Data Formatting
- Format credential details
- Include usage statistics
- Include timestamps
-
Response
- Return credentials list
- Return total count
Features
- List all registered credentials
- Show usage statistics
- Display credential names
- Include creation and last used dates
- Safe credential ID display
Example
curl -X GET https://api.rivergen.com/api/v1/webauthn/credentials \
-H "Authorization: Bearer <access_token>"
Related Endpoints
- Delete Credential - Remove a credential
- Start Registration - Add new credential