Setup account recovery
POST
/api/v1/recovery/setup
const url = 'http://localhost:3001/api/v1/recovery/setup';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"min_guardians_required":1,"recovery_email_hash":"example","time_lock_hours":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3001/api/v1/recovery/setup \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "min_guardians_required": 1, "recovery_email_hash": "example", "time_lock_hours": 1 }'Enable social recovery and backup codes for account protection
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Recovery setup configuration
Media typeapplication/json
object
min_guardians_required
integer
recovery_email_hash
string
time_lock_hours
integer
Examplegenerated
{ "min_guardians_required": 1, "recovery_email_hash": "example", "time_lock_hours": 1}Responses
Section titled “Responses”OK
Media typeapplication/json
object
backup_codes
12 one-time codes (only shown once!)
Array<string>
message
string
success
boolean
Examplegenerated
{ "backup_codes": [ "example" ], "message": "example", "success": true}Bad Request
Media typeapplication/json
object
error
string
success
boolean
Examplegenerated
{ "error": "example", "success": true}Unauthorized
Media typeapplication/json
object
error
string
success
boolean
Examplegenerated
{ "error": "example", "success": true}Internal Server Error
Media typeapplication/json
object
error
string
success
boolean
Examplegenerated
{ "error": "example", "success": true}