Skip to main content

Verify Public Key

Lookup all verified records for a given SSH public key. Diagnostic endpoint — useful when you have the key but not the associated email.

Endpoint

POST /api/shell-auth/verify-public-key

Request

{
  "ssh_public_key": "ssh-ed25519 AAAA..."
}
FieldTypeRequiredDescription
ssh_public_keystringYesSSH public key to look up

Response

Found (200)

{
  "verified": true,
  "count": 1,
  "matches": [
    {
      "user_id": "550e8400-e29b-41d4-a716-446655440000",
      "key_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
      "email": "alice@company.com",
      "is_active": true,
      "public_key_verified": true,
      "verified_at": "2026-03-01T10:30:00Z",
      "last_seen_at": "2026-03-02T15:45:00Z"
    }
  ]
}
FieldDescription
countNumber of verified records for this key
matches[].emailThe email associated with this key
matches[].verified_atWhen the key was verified
matches[].last_seen_atLast time the key was used for authentication

Not found (404)

{
  "verified": false,
  "reason": "No verified SSH key records found for this public key"
}

When to use

This endpoint is for diagnostics and debugging:
  • Checking if a key is already registered before initiating auth
  • Looking up which email is associated with a key
  • Verifying key status without knowing the email
For normal authentication flows, use POST /api/shell-auth/verify-key instead.

Example

curl -X POST https://vers.sh/api/shell-auth/verify-public-key \
  -H "Content-Type: application/json" \
  -d '{
    "ssh_public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExample..."
  }'