Start an anonymous-user upgrade.
POST
/api/auth/upgrade
Code sample: Shell / cURL
curl --request POST \ --url https://auth.example.com/api/auth/upgrade \ --header 'Content-Type: application/json' \ --data '{ "method": "email" }'Request Body required
Section titled “Request Body required ” Media type application/json
object
method
required
string
Example
{ "method": "email"}Responses
Section titled “ Responses ”Successful JSON response.
Media type application/json
object
success
required
boolean
user_id
required
string
upgrade_token
required
string
instructions
required
object
method
string
endpoint
string
description
string
next_step
string
Example
{ "success": true, "user_id": "anon_123", "upgrade_token": "upgrade_123", "instructions": { "method": "email", "endpoint": "/api/auth/email-codes/send", "description": "Verify email with OTP", "next_step": "Call /api/auth/upgrade/complete after verification" }}