Recovery - Integration Guide

This guide explains how to enable and manage wallet recovery for your users. Recovery allows users to regain access to their wallet in case of passkey loss or device failure.

📊 View Flow Diagram

1. Enable Recovery

Enabling recovery requires two steps: first, prepare the recovery operation, then sign it with a passkey.

Step 1: Prepare Recovery Operation

Endpoint : POST /v1.2/safes/operations

Headers :

Body (JSON) :

ENABLE_RECOVERY Operation :

Request Example :

POST /v1.2/safes/operations
Content-Type: application/json
Authorization: Bearer <access_token>

{
  "safeAddress": "0xd676c6188195372EC269E9C2cAf815C56436A679",
  "operations": [
    {
      "type": "ENABLE_RECOVERY",
      "firstName": "Jane",
      "lastName": "Doe",
      "birthDate": "1990-01-01",
      "birthCity": "Paris",
      "birthCountry": "France"
    }
  ]
}

Response (200 OK) :

{
  "credentialRequestOptions": {
    "challenge": "<base64url_encoded_userOpHash>",
    "rpId": "foo.domain",
    "userVerification": "required",
    "timeout": 60000,
    "allowCredentials": [
      {
        "id": "<base64url>",
        "type": "public-key"
      }
    ]
  },
  "data": {
    "userOpHash": "0xabc...123"
  }
}
💾 To Store :

Step 2: Sign Recovery Operation

Endpoint : PUT /v1.2/safes/operations

Headers :

Body (JSON) :

Request Example :

PUT /v1.2/safes/operations
Content-Type: application/json
Authorization: Bearer <access_token>

{
  "credential": {
    "id": "AVZs0qRCBSmfThZWu37g...",
    "rawId": "AVZs0qRCBSmfThZWu37g...",
    "type": "public-key",
    "response": {
      "authenticatorData": "SZYN5YgOjGh0NBcPZHZgW4/krrmihjLHmVzzuoMdl2MFAAAAAQ...",
      "clientDataJSON": "eyJ0eXBlIjoid2ViYXV0aG4uZ2V0IiwiY2hhbGxlbmdlIjoi...",
      "signature": "MEUCIQC..."
    }
  }
}

Response (200 OK) :

{
  "userOpHash": "0xabc...123",
  "status": "SIGNED",
  "safeAddress": "0xd676c6188195372EC269E9C2cAf815C56436A679"
}
💡 Note : After signing, the operation status becomes SIGNED, then EXECUTED when the bundler submits it to the blockchain, and finally CONFIRMED after block confirmations. Recovery requires a delay (default 1 day = 86400 seconds) before it can be executed. Final execution is performed by the IBEX team via an administrative endpoint after the delay expires.

2. Check Recovery Status

You can check the recovery status of a Safe to see if recovery is enabled, pending, or can be executed.

Endpoint : GET /v1.1/recovery/status/:safeAddress

Headers :

Path Parameters :

Request Example :

GET /v1.1/recovery/status/0xd676c6188195372EC269E9C2cAf815C56436A679
Authorization: Bearer <access_token>

Response (200 OK) :

{
  "safeAddress": "0xd676c6188195372EC269E9C2cAf815C56436A679",
  "recoveryEnabled": true,
  "recoveryAddress": "0x303f215950f7B07Ae45FD98590d503E0242E7de3",
  "delay": 86400,
  "pendingRecovery": false,
  "canExecute": false,
  "executeAfter": null,
  "dataRecovery": true,
  "pending": [],
  "executed": [
    {
      "userOpHash": "0xdef...456",
      "transactionHash": "0x789...abc",
      "status": "EXECUTED",
      "createdAt": "2025-08-24T16:58:20.100Z",
      "updatedAt": "2025-08-24T16:59:10.450Z"
    }
  ]
}
📋 Response Fields :

3. Cancel Recovery

If a user wants to cancel an ongoing recovery operation, they can use the CANCEL_RECOVERY operation.

Step 1: Prepare Cancel Recovery Operation

Endpoint : POST /v1.2/safes/operations

Body (JSON) :

CANCEL_RECOVERY Operation :

Request Example :

POST /v1.2/safes/operations
Content-Type: application/json
Authorization: Bearer <access_token>

{
  "safeAddress": "0xd676c6188195372EC269E9C2cAf815C56436A679",
  "operations": [
    {
      "type": "CANCEL_RECOVERY"
    }
  ]
}

Response (200 OK) :

{
  "credentialRequestOptions": {
    "challenge": "<base64url_encoded_userOpHash>",
    "rpId": "foo.domain",
    "userVerification": "required",
    "timeout": 60000,
    "allowCredentials": [
      {
        "id": "<base64url>",
        "type": "public-key"
      }
    ]
  },
  "data": {
    "userOpHash": "0xdef...456"
  }
}

Step 2: Sign Cancel Recovery Operation

Endpoint : PUT /v1.2/safes/operations

Same as Step 2 of Enable Recovery. Submit the WebAuthn credential to finalize the cancellation.

Request Example :

PUT /v1.2/safes/operations
Content-Type: application/json
Authorization: Bearer <access_token>

{
  "credential": {
    "id": "AVZs0qRCBSmfThZWu37g...",
    "rawId": "AVZs0qRCBSmfThZWu37g...",
    "type": "public-key",
    "response": {
      "authenticatorData": "SZYN5YgOjGh0NBcPZHZgW4/krrmihjLHmVzzuoMdl2MFAAAAAQ...",
      "clientDataJSON": "eyJ0eXBlIjoid2ViYXV0aG4uZ2V0IiwiY2hhbGxlbmdlIjoi...",
      "signature": "MEUCIQC..."
    }
  }
}
💡 Note : Canceling recovery requires passkey authentication to ensure only the wallet owner can cancel recovery operations.

Summary of Data to Store

Technical Deep Dive - For AI Integration

This section provides detailed technical information for AI systems integrating the IBEX API recovery functionality.

Recovery Module Architecture

The recovery system uses a Safe module pattern:

ENABLE_RECOVERY Operation Flow

Step 1: POST /v1.2/safes/operations

Step 2: PUT /v1.2/safes/operations

CANCEL_RECOVERY Operation Flow

Step 1: POST /v1.2/safes/operations

Step 2: PUT /v1.2/safes/operations

Recovery Status Endpoint

GET /v1.1/recovery/status/:safeAddress

State Management

SafeOperation Status Flow for Recovery:

Error Handling

Key Implementation Files

← Back to Main Guide