Skip to main content

Safe Recovery UX API

Safe Recovery Service follows RESTful API standard. It uses standard HTTP methods (GET, POST, ..) to perform CRUD (Create, Read, Update, Delete) operations on our resources, and return error responses in a consistent and predictable format.

info

The following API is in a pre-release phase. Request access by contacting us.

Create recovery request

Creates a new recovery request by a guardian with a lost signer of a Safe account. Can only be initated by guardians of the account.

POST /recoveries/create

curl -X POST \
https://api.candide.dev/recoveries/$version/$network/$your_api_key/create \
-H 'Content-Type: application/json' \
-d '{
"account": "0xD422B9d638a7BA4eBeF9e33Af9456007eAB4ccba",
"newOwners": ["0x41153290c995c8c4410d50f95D87ee86A1B07eeC", "0xB97A1C3993A551f0Febf030539630ACb77E6832D"],
"newThreshold": 2,
"chainId": 1,
"signer": "0x795B9cD1E5419C54B07768d4AD09809407dfAF5b",
"signature": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
}'

Fetch recovery by address

Fetches recovery requests created by guardians of the Safe accounts by the safe address

GET /recoveries/fetchByAddress

curl -X GET \
https://api.candide.dev/recoveries/$version/$network/$your_api_key/fetchByAddress \
-H 'Content-Type: application/json' \
-d '{
"account": "0xD422B9d638a7BA4eBeF9e33Af9456007eAB4ccba",
"chainId": 1,
"nonce": 2,
}'

Fetch recovery by ID

Fetch a recovery request by ID

GET /recoveries/fetchById

curl -X GET \
https://api.candide.dev/recoveries/$version/$network/$your_api_key/fetchById \
-H 'Content-Type: application/json'

Collect a guardian signature

Collects a guardian siganture to store for later confirmation and finilization

POST /recoveries/sign

curl -X POST \
https://api.candide.dev/recoveries/$version/$network/$your_api_key/sign \
-H 'Content-Type: application/json' \
-d '{
"id": 123456789,
"signer": "0x0b16b3bD015C1e4C866A88e5Cd3f5836fECe7e8A",
"signature": "0x45a915e4fc10f6030065f199c1d9258166eb2b98e5a0fe2c4b2ee3a4ed8d6f0a2c5d6e7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5"
}'

Execute a recovery by ID

POST /recoveries/execute

Execute a recovery request by ID

curl -X POST \
https://api.candide.dev/recoveries/$version/$network/$your_api_key/execute \
-H 'Content-Type: application/json' \

Finalize recovery by ID

POST /recoveries/finalize

Finalize a recovery request by ID

curl -X POST \
https://api.candide.dev/recoveries/$version/$network/$your_api_key/finalize \
-H 'Content-Type: application/json' \

Error Handeling

The API uses standard HTTP status codes to indicate the success or failure of a request. Error responses will include a JSON object with the following structure:

​​{
​​ "error": {
​​ "code": 404,
​​ "message": "Recovery request not found"
​​ }
​​}