Enclave API Documentation
  • Welcome
  • Getting Started
    • Integrations
  • SDK
  • Integrating with Privy
  • Models
    • Passkey Models
    • Transaction Models
    • User Model
    • Smart Balance
  • API Reference
    • Health Check
    • User Details
    • Smart Balance
    • Smart Account Creation
    • Smart Account Transactions
    • Passkey Account Creation
    • Passkey Account Authentication
    • Passkey Account Transactions
    • Session Key
  • COMING SOON
    • SDKs
    • Network Support
    • Protocol Integration
    • Mobile Integration
    • Custom Integration
Powered by GitBook
On this page
  1. API Reference

Passkey Account Creation

Smart accounts with passkey as primary signer

PreviousSmart Account TransactionsNextPasskey Account Authentication

Last updated 5 months ago

  • GETGenerate registration options for WebAuthn
  • POSTVerify WebAuthn registration

Generate registration options for WebAuthn

get
Query parameters
usernamestringRequired

The username of the user to register

Example: user@example.com
Responses
200
Registration options generated successfully
application/json
Responseobject
400
User already registered
application/json
get
GET /v3/webauthn/register/generate-options?username=text HTTP/1.1
Host: 
Accept: */*
{
  "challenge": "randomChallengeString",
  "rp": {
    "name": "Example RP",
    "id": "example.com"
  },
  "user": {
    "id": "userID123",
    "name": "user@example.com",
    "displayName": "User"
  },
  "pubKeyCredParams": [
    {
      "alg": -7,
      "type": "public-key"
    }
  ]
}

Verify WebAuthn registration

post
Query parameters
usernamestringRequired

The username of the user to verify

Body
anyOptional
Responses
200
Registration verified successfully
application/json
400
Verification failed or user not found
500
Internal server error
post
POST /v3/webauthn/register/verify?username=text HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 162

{
  "id": "credentialId123",
  "rawId": "base64EncodedRawId",
  "response": {
    "attestationObject": "base64EncodedAttestationObject",
    "clientDataJSON": "base64EncodedClientData"
  }
}
{
  "username": "user@example.com",
  "wallet": {
    "scw_address": "0x123...",
    "multi_scw": [
      {
        "network": 42161,
        "address": "0x123...",
        "deployed": true
      }
    ]
  },
  "token": "jwt-token-123"
}