Store and manage backup shares in your own infrastructure instead of using Portal-Managed Backups.
POST
/backup/fetch
webhook endpoint. After the wallet successfully recovers, a new set of signing shares are generated, which are then stored on the Portal client’s device.
POST
/backup
for backup and POST
/backup/fetch
for recover.
POST
/backup
X-Webhook-Secret
header (you can set this in the Portal Admin Dashboard).
The body of this POST
request will contain three fields:
backupMethod
- The backup method used to create the backup share. Example values: "GDRIVE"
, "GDRIVE-SECP256K1"
, "GDRIVE-ED25519"
, "ICLOUD"
, "PASSKEY"
, "PASSWORD"
, etc. This should be stored as a generic string (not an enum) by clientId
. Its value is subject to change in future releases.clientId
- The Portal ID of the user. We recommend keeping track of this.share
- A JSON stringified version of the custodian backup share.backupMethod
, clientId
, and share
value in a secure database.
"GDRIVE-SECP256K1"
and "GDRIVE-ED25519"
, you need to store both. This ensures that all necessary data is available for wallet recovery, regardless of the blockchain involved.share
is critical to protecting your users’ wallet. It is important to treat the share
value as a sensitive value and handle it accordingly. Do not log the value (or request body), be sure to store the value encrypted at rest, and understand the access control on the database.200
status code.
Here is a simple example of how to set this up using Node and Express:
/backup
webhook, another immediate request is made to /backup/fetch
right after in order to validate the custodian backup share was stored successfully. The /backup/fetch
webhook is explained in the “Handling recovery” doc.FAILED_WEBHOOK
: This error occurs when a webhook experiences an error. Unable to send backup share to configured webhook. Check your webhook status in the Portal Admin Dashboard to learn more.POST
request to [webhookBaseURL]/backup/fetch
. The request will include a X-Webhook-Secret
header (you can set this in the Portal Admin Dashboard).
The request body of this request will contain one field:
clientId
- The Portal Id of the user.clientId
. It should also return a 200
status code along with the backupShares
in the response body.
Here is a simple example of how to set this up using Node and Express:
[webhookBaseURL]/backup
route to send your server a custodian backup share to save for a client by backup method.[webhookBaseURL]/backup/fetch
endpoint to request the custodian backup shares for a user from your server.X-Webhook-Secret
header. The secret is securely generated on webhook configuration and can be viewed in the Settings Page of the web app.
35.203.150.117
, 104.155.171.139
or 35.185.20.23
.